☁️
Züs
  • About Züs
  • Concepts
    • Architecture
      • Mining on the Züs Blockchain
        • Onboarding a New Miner or Sharder
        • Block Production Protocol
        • Block Finalization
        • Merkle Patricia Trees(MPT) and Recovery
        • View Change and Distributed Key Generation(DKG)
      • Payment
      • Storage
      • Token Bridge Protocol
      • Resources
    • Tokenomics
      • Staking Process
      • Block Rewards
      • Delegation
    • Store
    • Earn
    • Build
    • NFT
  • Resources
    • Whitepapers
      • Tokenomics Paper
      • Architecture Paper
      • Storage Paper
    • Patents
      • NON-FUNGIBLE TOKEN BLOCKCHAIN PROCESSING
      • FREE STORAGE PROTOCOL FOR BLOCKCHAIN PLATFORM
      • TRANSFERRING CONTENT VIA PROXY RE-ENCRYPTION
      • STREAMING CONTENT VIA BLOCKCHAIN TECHNOLOGY
      • SPLIT-KEY WALLET ACCESS BETWEEN BLOCKCHAINS
      • ENFORCING SECURITY PARAMETERS SPECIFIED BY AN OWNER ON A BLOCKCHAIN PLATFORM
      • CLIENT AUTHENTICATION USING SPLIT KEY SIGNING ON A BLOCKCHAIN PLATFORM
      • BLOCKCHAIN CONTENT PURCHASING PROTOCOL
      • BLOCKCHAIN BASED PRIVACY COMPLIANCE PLATFORM
      • SYSTEMS AND METHODS OF SELF-ADMINISTERED PROTOCOLS ON A BLOCKCHAIN PLATFORM
      • SYSTEMS AND METHODS OF AGGREGATE SIGNING OF DIGITAL SIGNATURES ON MULTIPLE MESSAGES SIMULTANEOUSLY U
      • SYSTEMS AND METHODS OF BLOCKCHAIN PLATFORM FOR AUTOMATED ASSET BASED PROVISIONING OF RESOURCES
      • SYSTEMS AND METHODS OF SELF-FORKING BLOCKCHAIN PROTOCOL
      • SYSTEMS AND METHODS OF SUSTAINABILITY PROTOCOL USING DISTRIBUTED BLOCKCHAIN APPLICATION WITH IoT SEN
      • SYSTEMS AND METHODS OF BLOCKCHAIN PLATFORM FOR DISTRIBUTED APPLICATIONS
  • API Reference
    • Endpoints
      • Block
      • Client
      • Connection
      • DNS
      • File
      • Smart Contracts
      • Blobber Stats
      • Transactions
      • Miners and Sharders
        • Stats
        • State
        • Diagnostics
        • Configuration
        • Smart Contract State
        • Smart Contract Stats
        • Chain Stats
  • Hackathon
    • Register to Hackathon
      • How to Add Members to Hackathon Team
    • Repos
    • Documentation
  • Products
    • Bolt
      • Get Started
      • Stake
      • Activity
      • Buy ZCN
      • Sell ZCN
      • Send Tokens
      • Receive Tokens
      • Settings
        • Manage Profile
        • Wallet
        • Read Pool
      • Troubleshooting
    • Vult
      • Sign Up
      • Upload File
      • Upload an Encrypted File
      • Upload a File to a Folder
      • Share a Uploaded File
      • Move a Uploaded File
      • Delete a File
      • Make File Available Offline
      • Troubleshooting
    • Atlus
      • Dashboard Overview
      • Service Providers
      • Charts
        • Market Charts
        • Network Charts
        • Storage Charts
        • Züs Explainer
      • Blockchain
      • Server Map
    • Blimp
      • Sign Up
        • Buy ZCN for Storage
      • Use Blimp as Direct Storage
      • Use Blimp as S3 Server
        • S3 Operations
      • Use Blimp for Cloud Migration
      • Manage Allocations
        • Extend Size
        • Extend Duration
        • Add Blobber
        • Replace Blobber
        • Make allocation Immutable
        • Freeze Allocation
        • Cancel Allocation
    • Chimney
      • Get Started
      • Deploy Blobber on Own Server
      • Deploy Blobber on Rented Server
      • Stake Blobber
      • Add Blobber
      • Monitor Blobbers
      • Visualize Blobber Logs
      • View Blobber Rank
    • Chalk
      • Sign Up
      • Create NFT Collection
        • Buy ZCN for NFT via ERC token
        • Buy ZCN for NFT via Credit card
      • Explore NFT Collections
      • My NFTs
      • Profile
        • Withdraw Earnings
        • Manage Collections
  • Guides
    • Zus GO SDK
    • Zus JS SDK
    • Zbox CLI
      • Repo
      • Get Started
      • Creating and Managing Allocations
      • Uploading and Managing Files
      • Lock and Unlock Tokens
      • Tips and Troubleshooting
    • Zwallet CLI
      • Repo
      • Get Started
      • Zwallet Operations
      • Staking on miners and sharders
      • Burn and Mint Tokens using Zwallet
      • Troubleshooting
    • Add a Blobber
      • Repo
      • Getting Started
    • Add a Miner/Sharder
      • Repo
      • Getting Started
    • Setup a Blockchain
      • Repo
      • Quickstart
        • Understand the Script
      • Step 1: Set up the project
      • Step 2: Setup the network for Züs components
      • Step 3: Initialize and Build the Züs components
      • Step 4: Start Sharder and Miner Containers
      • Step 5 : Create a wallet using zwalletcli
      • Step 6: Starting the blobber containers
      • Step 7: Validate Züs deployment
      • Step 8: Creating an Allocation on Blobber
      • Restarting Sharder and Miner Containers with CleanDB.
      • Additional Tips and Troubleshooting
    • Glossary
  • Support
    • Help Center
      • Community
      • Issues on Github
      • Contact Us
Powered by GitBook
On this page
  • Global Parameters
  • Creating a Second Wallet
  • Recovering a wallet
  • Sending tokens to another wallet
  1. Guides
  2. Zwallet CLI

Zwallet Operations

Global Parameters

zwallet can accept the following global parameters to override default configuration and can be used with any command.

Flags:
      --config string      config file (default is config.yaml)
      --configDir string   configuration directory (default is $HOME/.zcn)
      --fee float          transaction fee for the given transaction (if unset, it will be set to blockchain min fee)
  -h, --help               help for zwallet
      --network string     network file to overwrite the network details (if required, default is network.yaml)
      --silent             Do not print sdk logs in stderr (prints by default)
      --wallet string      wallet file (default is wallet.json)
      --withNonce int      nonce that will be used in transaction (default is 0)
​
​

The --network and --config flags are used to specify yaml file for network configuration used by zbox, by default files are stored in .zcn directory are used.

Sample Command:

./zwallet <command> --wallet wallet2.json​

Creating a Second Wallet

The wallet by default gets saved at the location~/.zcn/wallet.json. To create a second or multiple wallets wallet you must use the --wallet flag and create a new json file. Here is a command for creating a second wallet with some test tokens. The configuration for second wallet is saved in new_wallet.json file:

./zwallet create-wallet --wallet wallet2.json

Response:

wallet saved in /$PATH/.zcn/wallet2.json

The second wallet will also be saved in .zcn directory. To check its contents use:

cat ~/.zcn/wallet2.json

Sample Response:

{"client_id":"0a145e6df5d9c0e8307bdec84a73b01e9ea0dc10a8c09128253935d7a10d6f13","client_key":"272b168ed806d09b2937f90185093d5c68130479f3afeb7c5ec91394d011ac1289adcf093a2c3121de5f0549e6863a8f946758367847bb27fdb93e48d505fa94","keys":[{"public_key":"272b168ed806d09b2937f90185093d5c68130479f3afeb7c5ec91394d011ac1289adcf093a2c3121de5f0549e6863a8f946758367847bb27fdb93e48d505fa94","private_key":"e699ba95136a6cffe8cd4e8e008ef5e76e4d6cadcd8f9399da407585bfaedf10"}],"mnemonics":"mask whip cotton crunch motor range solar path impose race certain pole swim decide cross donkey dove source essay update rebuild lesson chicken income","version":"1.0","date_created":"2021-05-17 20:27:27.110948873 +0000 UTC m=+0.137667608"}

Recovering a wallet

./zwallet recoverwallet command can be used to restore your lost wallet or loading your wallet on a different computer.

Parameters required for recovering your wallet can be viewed using ./zwallet recoverwallet --help command

Here are the Parameters

Usage:
  zwallet recoverwallet [flags]
​
Flags:
  -h, --help              help for recoverwallet
      --mnemonic string   mnemonic
​

A mnemonic string is required to recover and recreate your wallet. The mnemonic string is generated when you have first created your wallet and it is stored by default in wallet.json file located in .zcn directory until specified.

It is advised to safely store and copy the mnemonic string at some other location in your computer as it is used for many ZWallet functionaities.

For demonstrating the recover wallet functionality, we will find the mnemonic string for the wallet on UserA computer and recover it on UserB computer.

To find mnemonic in wallet file use cat command with the wallet file name on user A computer:

cat ~/.zcn/wallet.json

Response:

{"client_id":"26e5b70fcba3f72a475ef1dbc66e454d3b458b950d62c6ec218cc3425e3b621f","client_key":"9a463e83d67586b661187ee757187d17623205764f2a7584b7aa1383a4159c0f158090b0168ad6e3b7eaf7e5fe107eb4e71d280dc46c60d8b2b21d4eae8e711f","keys":[{"public_key":"9a463e83d67586b661187ee757187d17623205764f2a7584b7aa1383a4159c0f158090b0168ad6e3b7eaf7e5fe107eb4e71d280dc46c60d8b2b21d4eae8e711f","private_key":"4bf7ee2873b0a0c29766a72bc5ccc74f167159266c67556fa0ca87286f7a2218"}],"mnemonics":"penalty sound feed follow come paddle rule brand shift embrace olive expire bundle join churn actress chief venue picnic old tower cover lake zebra","version":"1.0","date_created":"2021-05-11 18:22:52.339539274 +0000 UTC m=+0.075234202"}root@ip-172-31-29-158:~/zboxcli/zwalletcli#
​

Here mnemonics string is penalty sound feed follow come paddle rule brand shift embrace olive expire bundle join churn actress chief venue picnic old tower cover lake zebra

Now let's recover the wallet by using this mnemonic on UserB computer. The name we will specify for the wallet would be recovered_wallet.json

Sample Command:

./zwallet recoverwallet --wallet recovered_wallet.json --mnemonic "penalty sound feed follow come paddle rule brand shift embrace olive expire bundle join churn actress chief venue picnic old tower cover lake zebra"

Response:

No wallet in path  /root/.zcn/recovered_wallet.json found. Creating wallet...
ZCN wallet created!!
Creating related read pool for storage smart-contract...
Read pool created successfully
Wallet recovered!!

Verify whether it is the same wallet using:

cat ~/.zcn/recovered_wallet.json

The contents in the json file should be same as User A computer .\

Sending tokens to another wallet

./zwallet send command is used to transfer tokens from one wallet to another. Parameters for send command can be viewed using ./zwallet send --help.

Usage:
  zwallet send [flags]
​
Flags:
      --desc string           Description
      --fee float             Transaction Fee
  -h, --help                  help for send
      --to_client_id string   to_client_id
      --tokens float          Token to send
​

Here with --desc flag the reason for sending tokens can be specified,--fee flag specifies the cost to send the certain amount of tokens(the fee is specified by the miner and gets deducted from senders wallet), client id for the reciever wallet is required and can be fetched by viewing the contents of their wallet.json file. Lastly number of tokens which has to be send to another wallet has to be specified.

Note: The desc, client id and tokens flag are required flags for send command. The command wont work without them.fee flag is optional.

For demonstration, let's send 0.1 tokens with a fee of 0.1 from our wallet to a specified client ID as a gift.

Before sending lets check our wallet balance using:

./zwallet getbalance

Sample Response:

Balance: 0.6 (0.69 USD)

By default ZWallet checks balance and send tokens from wallet specified in wallet.json file. To send tokens use:

./zwallet send --to_client_id 26e5b70fcba3f72a475ef1dbc66e454d3b458b950d62c6ec218cc3425e3b621f  --tokens .2 --desc "gift" --fee 0.1 

Response:

Send tokens success

To verify whether tokens are sent to the receiver, check the wallet balance. The tokens specified in send command and transaction fee should be deducted from your wallet balance.

Balance: 0.4 (0.45199999999999996 USD)

Note: To use a different wallet as a sender, use --wallet global parameter.

./zwallet send --to_client_id 26e5b70fcba3f72a475ef1dbc66e454d3b458b950d62c6ec218cc3425e3b621f --tokens .1 --desc "gift" --fee 0.1 --wallet another_wallet.json

PreviousGet StartedNextStaking on miners and sharders

Last updated 2 years ago