Step6: Staking miners

Staking miner using delegate wallet

In step 3.1 there were 2 options i.e.

  1. Pre-Generated Wallet

  2. Auto-Generated Wallet

Pre-Generated Wallet

Users that opted to go with option 1 they needs to stake their providers manually using below steps:

  1. You need to have preinstalled go with version 1.20. or you can install it by following it's official docs.

  2. Install make utility using command sudo apt install make.

  3. Create .zcn folder in your home directory and create config.yaml file using below commands.

    cd ~
    mkdir .zcn
    touch config.yaml
  4. Copy and paste the below content to config.yaml file i.e. generated above.

    block_worker: https://mainnet.zus.network/dns/
    signature_scheme: bls0chain
    min_submit: 20 # in percentage
    min_confirmation: 5 # in percentage
    confirmation_chain_length: 3
    store_unlock_duration_sec: 2
    max_txn_query: 15
    query_sleep_time: 3
  5. Clone zwalletcli repository and run make install in order to create zwallet binary. You can use below commands to do so.

    git clone https://github.com/0chain/zwalletcli
    cd zwalletcli
    make install
    mv zwallet ..
    cd ..
  6. Run below command to stake miner

    ./bin/zwallet mn-lock --miner_id <miner-id> --tokens 50000 --wallet <delegate_wallet_name>

Auto-Generated Wallet

Run below script to stake miners using delegate wallet. We will be using the same delegate wallet that was generated in step 3.1 using script. Make sure you haven't moved/removed delegate_wallet.json from the server. If you have moved please replace it /var/0chain/delegate_wallet.json again. Once staking is completed, you can move it to you local.

wget -N https://raw.githubusercontent.com/0chain/zcnwebappscripts/as-deploy/0chain/stake_miner.sh ; bash stake_miner.sh &> ./miner_staking.log

Once it is successfully staked, you will see the below msg on script completion.

locked with: <txn-hash-id>

Last updated