Pocket offers developers a simple Command Line Interface that will help get you started in setting up a wallet as well as obtaining network resources for your DApp by staking Pocket tokens.
Before you get started, you must first download and install:
After you have installed Pocket Core CLI on your machine, are going to initiate the CLI and create an application account by entering in:
$ pocket accounts create (Enter Password) # return Account generated successfully: Address: 190E...
Note: After you hit enter, it will prompt you to enter a passphrase. The passphrase can be whatever you like and the passphrase will be used to encrypt your generated key pair.
Once your account has been created, you can view it, along with other pre-generated accounts by entering:
$ pocket accounts list # example return (0) 190E...
#example output# (0) 1B9FF29...B2E (1) 3023332...281 (2) 41750FF...662
If you are using the Application Authorization Token SDK to connect your Application(dApp) to then network, you will need to export your accounts private key so you can sign for a relay. To export your private key, enter:
$ pocket accounts export-raw 48a8... (enter password) #return Exported Raw Private Key: 4682...
To fund the wallet, go to the Pocket Faucet and copy your application address into the address field and click Get Testnet POKT:
Now that we have the wallet funded, we need to register our account on the Pocket Network by staking our application account on the pocket network.
To query your application account, start by entering in the
pocket query app commands and provide the application address and the
--node flag using one of the dispatchers' address.
$ pocket apps stake <fromAddr> <amount> <chains> # TODO: Add example output # Query your app once your transaction goes through $ pocket query app 19D6... --node=http://<dispatch url>:26657 # Query Account balance: $ pocket query app abcd... Account Balance: 0
Updated 12 days ago