Configuring your wallet

Configuring the wallet you use to run transactions via the CLI tools.

Before you can use the CLIs to manage your data on the network, you need to have a wallet. A wallet is simply a file (in JSON format) that contains your keys, by which you can access your account on the network.

The wallet has:

  • Your client ID.

  • You Public Key,

  • Your Private Key.

  • Your Mnemonics.

  • Your initial nonce.

Example for a wallet:

{
  "client_id": "ba6ab426644f2b326b1da3dd426229fed19eed85387deaf72e05cb0fa4c5abbb",
  "client_key": "f6ac7fa910e56ac605f99707455b2a07a8230de8efe34cb1f40d80568c3fcc0e955c899624514216523c8a9e8e8db294e69ed81912fecdadc1544f0ea580b01e",
  "keys": [
    {
      "public_key": "f6ac7fa910e56ac605f99707455b2a07a8230de8efe34cb1f40d80568c3fcc0e955c899624514216523c8a9e8e8db294e69ed81912fecdadc1544f0ea580b01e",
      "private_key": "02f3a1ad1514c520542527d91d0aaf43af8fbfa92437b44c85d1e55f35b86a01"
    }
  ],
  "mnemonics": "arctic sunny beef human powder cool jungle shift cabin ginger license mixture onion elevator render inspire morning limb square crater limb forest consider virus",
  "version": "1.0",
  "date_created": "2024-04-25T17:38:24+02:00",
  "nonce": 0
}

All the commands of the CLI tools expect the wallet file (named wallet.json) to be saved in the configDir (which is by default ~/.zcn).

Creating a new wallet

If you don't have a wallet already, you can create a new wallet using zwalletcli

./zwallet create-wallet

This will create you a new wallet and store it as: ~/.zcn/wallet.json

You can also specify different name for your wallet:

./zwallet create-wallet --name my-custom-wallet

Getting tokens to your wallet

Now that you created your tokens, you need to fund it with some tokens to be able to pay transaction fees and storage cost, or even to stake providers for reward. There are a couple of different ways by which you can achieve this:

Getting tokens using Bolt Webapp

Once you generated the wallet, you can use Bolt app to fund some tokens to it, as follows:

  1. Login to Bolt using your wallet, check the Export Wallet feature documentation in Bolt for more details.

  2. Connect your Metamask wallet as prompted.

  3. Use bolt to deposit tokens to your exported wallet using the ERC-20 tokens in your Metamask wallet. Check the DEX flow documentation for more information.

Sending tokens from an existing wallet

If you have an existing wallet which has tokens, you can send tokens from it to your newly created wallet. You can do this either using the send command of Zwallet CLI, or using Bolt (check Send/Receive feature documentation of Bolt).

Note that in order to use send command to send tokens from your existing wallet, you'll need to have the wallet in JSON format in a file on your system and provide its path to the CLI, as defined in the next section.

Using the wallet in your commands

All CLI commands use the wallet stored in your ~/.zcn directory and named wallet.json by default. To specify a different wallet name and path:

./zwallet <some-command> --wallet my-custom-wallet

This will make the command use ~/.zcn/my-custom-wallet.json as your wallet. Also to change the default path where it gets the wallet file:

./zwallet <some-command> --wallet my-custom-wallet --configDir myzus

This will make the command use the wallet stored in ./myzus/my-custom-wallet but will also use the config.yaml file stored in the same directory.

Last updated