Installation
Official libraries for the Mobius DApp Store are available in Ruby, [Javascript]((https://github.com/mobius-network/mobius-client-js), [PHP]((https://github.com/mobius-network/mobius-client-php), and soon in Unity.
Installing Packages
Use the following snippets to install the necessary packages into your project.
$ yarn add @mobius-network/mobius-client-js
# or
$ npm install --save @mobius-network/mobius-client-js
# then
$ gem install mobius-client
# gem may require an additional installation see
# https://rubygems.org/pages/download#formats
# Add to your application's Gemfile
gem 'mobius-client'
# And then exectute
$ bundle install
# Or install it yourself with
$ gem install mobius-client
# Clone mobius-client-python
$ git clone https://github.com/mobius-network/mobius-client-python.git
# Navigate to mobius-client-python
$ cd mobius-client-python
# Run
$ python setup.py install
# Install Mobius CLI
$ gem install mobius-client
# gem may require an additional installation see
# https://rubygems.org/pages/download#formats
$ composer require mobius-network/mobius-client-php
# Install Mobius CLI
$ gem install mobius-client
# gem may require an additional installation see
# https://rubygems.org/pages/download#formats
Generating Key Pairs
The Mobius CLI is used for generating Stellar testnet key pairs for development environments while also simulating how the DApp store authentication will function in a production environment.
Account Types##
The CLI can create 4 types of Stellar testnet accounts for testing and development environments.
- DApp account - your DApp's Stellar account where you will receive payments from users
- Authorized and Funded User Account - a user's account with your DApp, signed and authorized by your developer account, funded with 1,000 testnet MOBI
- Unauthorized and Funded User Account - a user's account with your DApp, not yet signed and authorized by your developer account, funded with 1,000 testnet MOBI
- Zero Balance Account - an empty Stellar account
Generate Default Wallets ##
The below command will setup all 4 default wallets for a development environment as well as generate a simple HTML test interface that simulates the DApp Store authentication functionality. This is an all-in-one command to getting started with all key pair types for your development DApp environment.
$ mobius-cli create dev-wallet
dev-wallet.html
The dev-wallet.html file generated will be located in the folder in which the command was run. This is a simple file used to simulate the DApp store user authentication flow - you can move it to a desired location for reuse.
Generating Individual Key Pairs##
The Mobius CLI can also be used to optionally generate individual key pairs for each of the 4 different account types.
# Creates a funded wallet to be used as DApp account
# or an unauthorized but funded user account.
$ mobius-cli create dapp-account
# Creates a funded wallet signed and authorized by your DApp account.
$ mobius-cli create dapp-account -a <Your application public key>
$ mobius-cli create account
Updated almost 7 years ago