Step 3.1

Generating delegate wallet

There are two options to consider before generating a delegate wallet. A pre-generated delegate wallet, stored locally off the server, or an auto-generated delegate wallet stored on the server.

Pre-Generated Wallet: Advantages: Enhanced security and control of your wallet credentials. Disadvantages: A more complex process in the setup, generation, and maintenance of your wallet credentials.

Auto-Generated Wallet: Advantages: Simplicity in generating your delegate wallet, which is appealing to non-technical users. Disadvantages: Wallet is created on the server and resides there. The wallet needs to be transferred from the server to a local destination for enhanced security.

Below is the link to the script to generate the delegate wallet for miner to collect rewards.

wget -N https://raw.githubusercontent.com/0chain/zcnwebappscripts/as-deploy/0chain/generate_miner_del_wallet.sh ; bash generate_miner_del_wallet.sh

The above script can be executed using one of the below methods:

  1. If you have pre-generated the delegate wallet on your local drive, enter yes. Then enter the wallet ID when prompted for the wallet ID input.

  2. If you want the delegate wallet auto-generated for you on your server, enter no.

Using pre-generated delegate wallet to deploy 3.1

If you choose to generate the delegate wallet locally rather than the auto-generated script created on the server, you can use zwalletcli repository. Also zwalletcli detailed docs are available here.

Below are steps you can use to create a wallet on your local machine. Below are steps for linux/unix machines only.

  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://beta.zus.network/dns/
    signature_scheme: bls0chain
    min_submit: 50 # in percentage
    min_confirmation: 50 # 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 generate delegate wallet on your local

    ./zwallet create-wallet --wallet delegate_wallet.json
  7. Now run below script in order to complete step 3.1 for delegate wallet integration to miner deployment.

    wget -N https://raw.githubusercontent.com/0chain/zcnwebappscripts/as-deploy/0chain/generate_miner_del_wallet.sh ; bash generate_miner_del_wallet.sh
    1. Script will do the tools installation on the server.

    2. It will prompt for delegate wallet input as shown below. Please input yes.

  8. Now, it will prompt for delegate wallet address input. Copy the address of delegate wallet ID and paste it into the delegate wallet input above on the server. You can follow the below steps to copy the delegate wallet address.

    1. cat delegate_wallet.json

      This will display your complete delegate wallet. Here client_id with a 64-character string is the wallet address you need to copy.

  9. You can verify with the below screenshot to ensure the script is successfully executed.

Using script to auto-generate delegate wallet to deploy 3.1

  1. Run below script to generate delegate wallet and complete step 3.1 using script.

    wget -N https://raw.githubusercontent.com/0chain/zcnwebappscripts/as-deploy/0chain/generate_miner_del_wallet.sh ; bash generate_miner_del_wallet.sh
    1. Script will do the tools installation on the server.

    2. It will prompt for delegate wallet input as shown below. Please input no.

  2. Now, it will generate delegate wallet on your server with name delegate_wallet.json.

  3. You can verify with the below screenshot to ensure the script is successfully executed.

Post Setup - Wallet Management

Once your wallet is created, either through the auto-generated script or by using a pre-generated one, you should have:

  • A wallet file (like delegate_wallet.json ) that contains your wallet's public and private information.

  • A wallet ID or address, which is used for transactions.

IMPORTANT: Write down any keys or recovery phrases and store them safely in a secure location.

Last updated