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

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