Zwalletcli
A client CLI using GoSDK to interface the blockchain, and smart contracts for interest, lock, stake, and vesting
Install / Use
/learn @0chain/ZwalletcliREADME
zwallet - a CLI for Züs wallet
zwallet is a command line interface (CLI) to demonstrate the wallet functionalities of Züs. For more information on Züs Network and the system overview, refer to docs.zus.network.
The CLI utilizes the Züs GoSDK.
- zwallet - a CLI for Züs wallet
- Architecture
- Getting started
- Global parameters
- Commands
- Set up bash autocompletion -
zwallet completion - Creating and restoring wallets
- Exploring network nodes
- Listing all miners -
ls-miners - Listing all sharders -
ls-sharders - Listing all blobbers -
getblobbers - Listing all authorizers -
bridge-list-auth - Getting Auhorizer Configuration -
bridge-auth-config - Getting node ID by URL -
getid - Getting Storage Smart Contract Configuration -
sc-config - Getting Global Configuration -
global-config - Get Version -
get-version
- Listing all miners -
- Getting and sending tokens
- Staking on miners and sharders
- Getting the stake pools of a wallet -
mn-user-info - Removing/Killing nodes
- Bridge
- Set up bash autocompletion -
- Config
Architecture
zwallet can be configured to work with any Züs network. It uses a config and a wallet file stored on the local filesystem.
For most transactions, zwallet uses the 0dns to discover the network nodes, then creates and submits transaction(s) to the miners, and finally waits for transaction confirmation on the sharders.

Getting started
1. Installation
Prerequisites
- Go: Installation instructions for Mac, Linux and Windows can be found here.
Procedures
- Clone the
zwalletclirepo and install
git clone https://github.com/0chain/zwalletcli.git
cd zwalletcli
make install
- Add config yaml at
~/.zcn/config.yaml
The following script sets https://demo.zus.network as your network.
cat > ~/.zcn/config.yaml << EOF
block_worker: https://dev.zus.network/dns
signature_scheme: bls0chain
min_submit: 50 # in percentage
min_confirmation: 50 # in percentage
confirmation_chain_length: 3
EOF
- Run
zwalletto display the list of supported commands.
./zwallet
For machine requirements and pre-requisites, follow the guides below:
2. Run zwallet commands
The following steps assume that your terminal's working directory is inside the zwalletcli repo.
Global parameters
zwallet accept global parameters to override default configuration and can be used in any command.
| Parameter | Description | Default |
| ------------- | ------------------------------- | -------------- |
| --h,--help | Show help/parameters for a particular command | |
| --config | Config file and description | config.yaml |
| --configDir | Config directory | ~/.zcn |
| --network | Network file | network.yaml |
| --silent | Do not print detailed logs | false |
| --wallet | Wallet file | wallet.json |
| --withNonce | Nonce that will be used in transaction | 0 |
| --fee | Transaction Fee for given transaction | if not set, default is blockchain min fee |
Commands
Set up bash autocompletion - zwallet completion
Generate the autocompletion script for zwallet for the specified shell and instructions to enable them.
Sample Usage:
zwallet completion [command]
commands : bash/fish/powershell/zsh based on the specified shell
See each sub-command's help for details on how to use the generated script.
Creating and restoring wallets
Creating wallet - (any command)
Simply run create-wallet command and it will create a wallet if none exist yet.

Here is a sample with create-wallet command and this creates a wallet at default location~/.zcn/wallet.json
./zwallet create-wallet
Sample Output
wallet saved in /home/ubuntu/.zcn/wallet.json
{"client_id":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"client_key":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"keys":[{"public_key":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"private_key":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}],
"mnemonics":"xxxx xxxx xxxx xxxxx",
"version":"1.0","date_created":"2023-05-03T12:44:46+05:30","nonce":0}
Recovering wallet - recoverwallet
recoverwallet is used when restoring a lost wallet or when loading the wallet from a different computer.
Given a wallet's mnemonics, you can recover and recreate your wallet.
| Parameter | Required | Description | Default | Valid Values |
| ------------ | -------- | -------------------------------------- | ------- | ------------ |
| --mnemonic | Yes | The mnemonics of the wallet to recover | | |
| --offline | No | recover wallet without registration on blockchain| false | |

Sample command
./zwallet recoverwallet --wallet recovered_wallet.json --mnemonic "pull floor crop best weasel suit solid gown filter kitten loan absent noodle nation potato planet demise online ten affair rich panel rent sell"
Sample output
Wallet recovered!!
Verify recovered wallet
cat ~/.zcn/recovered_wallet.json
Exploring network nodes
Listing all miners - ls-miners
The list of miners are retrieved using the Miner smart contract.
| Parameter | Required | Description | Default | Valid Values |
| ----------- | -------- | -------------------- | ------- | ----------------- |
| --json | No | Print output as JSON | | <empty to enable> |
| --active | No | Gets active miners only, set it false to get all miners | true | boolean |
| --all | No | Include all registered miners, default returns the first page of miners | | <empty to enable> |
| --limit | No | Limits the number of miners returned | 20 | integer |
| --offset | No | Skips the number of miners mentioned | | integer |
| --stakable| No | Gets stakable miners only if set to true | false | boolean |

./zwallet ls-miners
Sample output
- ID: cdb9b5a29cb5f48b350481694c4645c2db24500e3af210e22e2d10477a68bad2
- Host: demo1.zus.networ
