network/one.yaml
file of the zwallet github repo which we will copy to a new config.yaml
file in our local system . The config.yaml file and all the other 0chain components information will be stored in a .zcn
folder located in the home directory of the file system.config.yaml
file located at $HOME/.zcn
path of your system. The config.yaml
file contents should be similar to the code snippet below :block_worker
field. These network details are automatically fetched from the blockWorker's network API. Preferred Blobbers are also present which you can uncomment for using specified storage providers for handling your files.block_worker
field for the desired network. In this case we will change it to beta.0chain.net
. After changes it should look similar to the file below:zwallet
command and it will create a wallet if none exist yet.faucet
command which will create a wallet with test tokens at default location~/.zcn/wallet.json
wallet.json
file located in the zcn folder in linux home directory../zwallet getbalance
command:Get balance failed.
error when running ./zwallet getbalance
command. Run the ./zwallet faucet --methodName pour --input "{Pay day}"
command and then check the balance again.faucet
command will get test tokens into the wallet for transactional purposes and make the wallet usable. Successful Response of the faucet
command:zwallet
can accept the following global parameters to override default configuration and can be used with any command.--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.--verbose
provide additional details as to what the particular Zbox command is doing.--verbose
by default with all ZWallet commands as it helps provide level of detail that can be helpful for troubleshooting problems.-wallet
are useful when you are using multiple wallets and want to specify a second wallet../zwallet createmswallet
command. Parameters/ flags which can be added with the command syntax can be viewed using ./zwallet createmswallet --help
./zwallet createmswallet --help
command:./zwallet createmswallet
command demonstrates in the help section above, it will create a ms (multi-signature) wallet using mandatory flags numsigners
threshold
.testn
flag can also be used but by default it is set to false.numsigners
flag in the createmswallet command specify the the number of accounts that can sign the vote for the transaction. The variable passed is an integerthreshold
flag in the createmswallet command specify the minimum number of votes required for the transaction to pass. The variable passed is an integer.testn
is an optional flag and if set to true will test ending votes from all signer accounts. When not specified it is set to false and votes from only threshold number of signer accounts is used.wallet.json
located in the zcn folder in linux home directory.testn
flag and setting it to true
.~/.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:.zcn
directory. To check its contents use:./zwallet recoverwallet
command can be used to restore your lost wallet or loading your wallet on a different computer../zwallet recoverwallet --help
commandwallet.json
file located in .zcn
directory until specified.penalty sound feed follow come paddle rule brand shift embrace olive expire bundle join churn actress chief venue picnic old tower cover lake zebra
recovered_wallet.json
./zwallet register
command can be used to register a wallet to a blockchain in case of a blockchain network reset or change. The wallet which gets registered on the new blockchain network by default is the wallet located in ~/.zcn/wallet.json
file./zwallet send
command is used to transfer tokens from one wallet to another. Parameters for send command can be viewed using ./zwallet send --help
.--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.fee
flag is optional.wallet.json
file. To send tokens use:--wallet
global parameter../zwallet lockconfig
command../zwallet lockconfig
shows the global configuration for locking tokens for interest such as minimum token and minimum lock period (duration)../zwallet lock
command is used to lock tokens for interest. The tokens are deducted from the wallet balance and are available back in the wallet by unlocking. Unlocking of tokens is only possible when the lock duration has passed../zwallet lock --help
./zbox getlockedtokens
command is used to know the amount of locked tokens and how much interest is gained over time through locking.locked
variable which uses a boolean. time_left
variable has a negative value which means lock duration has not passed. Tokens earned through locking and locked tokens balance is also specified.pool_id
at a safer place as it is required to unlock tokens at a later time../zwallet unlock
command. Parameters for unlock command can be viewed using ./zwallet unlock --help
.--pool_id
is a required flag whereas --fee
flag is optional. For demonstration lets unlock the tokens we locked in the lock tokens section. The pool_id
can be viewed using the./zwallet getlockedtokens
command../zwallet ls-miners
list the miners retrieved using the Miner smart contract. Parameters can be viewed using ./zwallet ls-miners --help
flag.--json
flag can be passed to retrieve miners as JSON data../zwallet ls-sharders
list the sharders retrieved using the Miner smart contract. Parameters can be viewed using ./zwallet ls-sharders --help
flag.--all
flag can be passed to retrieve all the available sharders where as --json
flag will retrieve sharders as JSON data../zwallet mn-config
command../zwallet mn-config
command displays the configuration and current requirements for staking../zwallet mn-info
command can be used to get staking info for a particular sharder or miner.mn-info
command can be viewed using ./zwallet mn-info --help
--id
flag requires a particular miner and sharder ID which can be fetched using the ls-miners
or ls-sharders
command. For demonstration we are using a particular miner id fetched using ls-miners
command../zwallet mn-lock
command. Parameters for locking the tokens can be viewed using the ./zwallet mn-lock --help
../zwallet mn-user-info
command can be used. Parameters for the ./zwallet mn-user-info
can be viewed using the --help
tag..zcn
directory. As mentioned above --client_id
flag is optional and if you do not specify a particular wallet client_id. It will find the stake pool related to wallet config in default wallet.json
file.--json
flag../zwallet mn-pool-info
command can be used to get stake pool info for a particular miner/sharder. Parameters can be viewed using the ./zwallet mn-pool-info --help
--id
flag requires miner/sharder ID which can be fetched using ls-miners
or ls-sharders
command,pool_id
is generated when you lock stake tokens for a miner/sharder node, you can copy the pool_id from the response text or can view it using mn-user-info
command../zwallet mn-unlock
command. Parameters for locking the tokens can be viewed using the ./zwallet mn-unlock --help
ls-miners
or ls-sharders
command whereaspool_id
is generated when you lock stake tokens for a miner/sharder node ,you can view it using mn-user-info
command../zwallet mn-update-settings
command is used to update the staking config of a node. Parameters for the command can be viewed using --help
flag.ls-miners
or ls-sharders
command. Variables that can be updated are max stake, min stake and number of delegate pools.mn-update-settings.
vp-config
command../zwallet vp-add
command which require specific parameters. To view parameters use the --help
flag.--d
destination flag by which certain amount of tokens gets transferred to receiver's wallet requires values in the form of wallet client_id: amount of tokens. The destination--d
parameter has to be repeated for transferring to more than one destination whereas lock duration and minimum locked tokens for the vesting pool is required and has to match specified vesting pool config limit. Also, the number of tokens locked should match or more than the sum of destination amounts specified to create a read pool.--start_time
flag../zwallet vp-list
command is used to display the vesting pool list for a given wallet. Parameters can be viewed using --help
flag.cat
command. If not specified it will use the wallet at ~/.zcn/wallet.json
vp-info
command. Check the troubleshooting section for solution../zwallet vp-info
can be used to view information for a particular vesting pool. Parameters can be viewed using the ./zwallet vp-info --help
vp-list
command.vp-info
command. Check the troubleshooting section for resolution../zwallet vp-trigger
command is used to instantly transfer vesting tokens to destination wallets before expiration time. Parameters can be viewed using the ./zwallet vp-trigger --help
command.vp-list
command. To demonstrate the vp-trigger
functionality we will consider a vesting pool which has some vested tokens to transfer to destination wallets. Here is vp-info
of a vesting pool before triggering.vp-trigger
on this pool and transfer the tokens right away.