Using The CLI For Nodes

Pocket offers developers a simple CLI to help get you started with creating a wallet as well as obtaining network resources for your Pocket node by staking POKT tokens.

Prerequisites:

Before you get started, you must first download and build:

Viewing the CLI:

To view the CLI all we need to do is type in pocket along with the helper flag:

$  pocket -h

You will see all of the global flags and their descriptions.

Creating An Account:

Every node needs an account (whether automatically created or imported) to connect to the Pocket Network. If you are a user who is connecting a node for the first time, whatever account that is created first, will be the default account of that node will connect to whenever it starts. This is why it's important to know, that if you have an existing funded account and you want to use in your new(or existing environment) to import it first before you execute your node.

In order to set up a node on the Pocket Network and service relay requests, you will first need to create an account.

$  pocket accounts create

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 by entering:

$  pocket accounts list
#example output#

(0) 1B9FF29...B2E
(1) 3023332...281
(2) 41750FF...662

Importing An Account

You can import an existing account into your Pocket CLI by using the import-raw function name to import and store your account.

Note: You will need to enter a new passphrase to encrypt and store your account.

$   pocket accounts import-raw <account private key>

enter encrypt passphrase:

# Returns:
account imported sucessfully 
<account address>

Funding The Wallet:

To fund the wallet, go to the Testnet Pocket Faucet and copy your application address into the address field and click Get Testnet POKT:

Pocket Faucet

Pocket Faucet

Updated 25 days ago



Using The CLI For Nodes


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.