Using the CLI

Pocket Core offers a Command Line Interface (CLI) that you will need to manage your node's wallet, stake tokens, start your Pocket Node, and other services to help maintain your Node. You can begin using the Pocket Core CLI after you have downloaded and configured it on your computer (or server) by either downloading the Binary or Docker file to configure your environment.


Installing the CLI:

Installing using Hombrew:

On a Mac or Linux, to install Pocket-Core using Homebrew just run the following commands in your terminal:

$   brew tap pokt-network/pocket-core
$   brew install pokt-network/pocket-core/pocket

# (Optional) 
# Once installed, refresh your terminal screen to incorporate the installation

And that's it! To see a quick example on how to interact with the CLI, click here.

Building from Source

Before we download the binary, you'll need to install the cleveldb dependency:

# For linux: 
$  apt-get update && apt-get install -y libleveldb-dev build-essential

# For mac OSX
$  brew install leveldb

Open up your shell(or terminal) and download the Pocket Core repo from GitHub in the destination directory of your choosing.

# using git clone: 
$  git clone

# using curl:
$  curl -LJO

# using wget:
$  wget --no-check-certificate --content-disposition

After the repo has been downloaded, go into the pocket-core folder and swap the latest release candidate:

$  git checkout tags/RC-0.5.1

After you have swapped to the latest release candidate, build your binary and add it to your PATH down below.

# First make sure you have $GOPATH setup
echo $GOPATH

# Example output on MacOS
/Users/<your username>/go

# Inside the pocket-core folder, build your pocket binary and put it in the $GOPATH/bin directory
go build -tags cleveldb -o $GOPATH/bin/pocket ./app/cmd/pocket_core/main.go

Last, we're going to navigate to our $HOME directory and run:

mkdir -p .pocket/config && cd .pocket/config; curl -O

Your CLI is now built and ready to go!

Test Your Installation

To test your installation, we are going to check our CLI version. In the terminal, enter:

$   Pocket Version

# returns

Using the CLI

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.

Creating or Import an Account:

Every application needs an account in order to send relays to its desired blockchain through the network. To create or import an account, enter:

$  pocket accounts create
(Enter Password) 

# return 
Account generated successfully:
Address: 190E...
$  pocket accounts import-raw <private key>

Whether you've created or imported an account, it will prompt you to enter a passphrase that will be used to locally encrypt your private key and generate a success message(see below):

Account generated successfully:
Address: 45D50DB64E90C0109C778DAAB7EF36676FC03866
Account imported successfully:

You can view your accounts that you have created or imported using the list command:

$  pocket accounts list

# example return
(0) 45D50DB64E90C0109C778DAAB7EF36676FC03866

Exporting An Account:

If you are using the Application Authorization Token SDK to connect your Application(dApp) to the Pocket blockchain, you will need to export your accounts private key so you can sign your relays. To export your private key, enter:

$ pocket accounts export-raw 45D50DB64E90C0109C778DAAB7EF36676FC03866

(enter password)


Exported Raw Private Key:

Funding The Account:

Funding your wallet is different for Testnet and mainnet:


To fund your wallet, you're going to use the faucet to send test POKT tokens to your validator account. While your node is running, open a new terminal window and do the following:

  1. Enter: pocket accounts get-validator
  2. Copy your validator address and paste it in your validator address below. and click Get Testnet POKT



It is recommended to wait 15 minutes before you go to the next step to ensure the staking transaction goes through and propagates throughout the network.


Staking Your Account:

Stake your application on the Pocket blockchain by entering:

# Staking Command
$  pocket apps stake <fromAddr> <amount> <chains> --remoteCLIURL https://<Node URL>

# example command w/ dummy values connecting to multiple blockchains
pocket nodes stake 45D50DB64E90C0109C778DAAB7EF36676FC03866 50000000 0020,0021,0022,0023,0031,0032 --remoteCLIURL <testnet or mainnet>

Query an Account

To query your application account, start by entering in the pocket query app commands and provide the application address and the --remoteCLIURL flag using one of the Testnet dispatchers address for testnet or the Mainnet Dispatcher and Seed List ]

Updated 20 days ago

Using the CLI

Suggested Edits are limited on API Reference Pages

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