From bb4cb46038b482aa28c9f63a415f4e4b2b1e0a05 Mon Sep 17 00:00:00 2001 From: wangkui0508 Date: Thu, 27 May 2021 15:46:33 +0800 Subject: [PATCH] Update runmultinode.md --- developers-guide/runmultinode.md | 38 +++++++++++++------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/developers-guide/runmultinode.md b/developers-guide/runmultinode.md index dcc22f7..c3bd1c0 100644 --- a/developers-guide/runmultinode.md +++ b/developers-guide/runmultinode.md @@ -4,13 +4,13 @@ This document shows how to start a testnet of smartBCH with multiple nodes. We suggest to use ubuntu 20.04. -In these nodes, just pick one to generate the genesis file. And all the other nodes do not generate the genesis file, instead, they use the generated genesis file as is. +Among these nodes, just pick one to generate the genesis file. And all the other nodes do not generate the genesis file, instead, they use the generated genesis file as is. ### 1. On the nodes which do not generate the genesis file #### Step 0: Prepare -Follow the instructions in [running a single-node testnet](./runsinglenode.md), and Just finish the steps 0, 1, 2, 3 and 4 described in it. +Follow the instructions in [running a single-node testnet](./runsinglenode.md), and just finish the steps 0, 1, 2, 3 and 4 described in it. @@ -51,7 +51,7 @@ The output hex string is consensus pubkey which will be used in `generate-genesi 7b2241646472657373223a5b3136362c3234382c3230392c39312c32342c3137382c3138352c36302c3139312c3132372c3137342c32352c33332c3133322c3230342c3231372c3232342c35392c3235302c3234345d2c225075626b6579223a5b3136302c3132302c3131332c3230392c382c38382c32332c3135362c32372c3137392c3139332c3234302c3231352c3138362c3137392c31372c332c31392c39312c3131382c3234392c3130372c3130372c3230392c3234302c3130362c39312c3139322c3231312c38302c3234382c39385d2c22526577617264546f223a5b3136362c3234382c3230392c39312c32342c3137382c3138352c36302c3139312c3132372c3137342c32352c33332c3133322c3230342c3231372c3232342c35392c3235302c3234345d2c22566f74696e67506f776572223a312c22496e74726f64756374696f6e223a2268617070796d616e222c225374616b6564436f696e73223a5b302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c305d2c2249735265746972696e67223a66616c73657d ``` -The `validator-address` uses the one we get at step 1, and the `consensus-pubkey` is the one we get at step 2. +The `validator-address` is the one we get at step 1, and the `consensus-pubkey` is the one we get at step 2. The output hex string contains the information of a validator. Send the this hex string to the node who is genesis-generator. @@ -70,7 +70,7 @@ tar zxvf dot.smartbchd.tgz cp -rf dot.smartbchd/* .smartbchd/ ``` -The balance number and the test-keys are not importance, because these information will be overwritten by the genesis.json file in the `dot.smartbchd` directory. +In the `./smartbchd init` command, the balance number and the test-keys are not importance, because these information will be overwritten by the genesis.json file coming from the `dot.smartbchd` directory. @@ -92,27 +92,19 @@ Now start the node: #### Step 6: activate validator -before you activate your genesis validator, try to get testnet BCH in your validator address, it need at least +Before you activate your genesis validator, try to get testnet BCH in your validator address, it needs at least ``` 1000000000000000000000 bch ``` -you can connect smartBCH team to get testnet bch, you can check your balance with below command: - -replace `your_validator_address` with your genesis validator address +You can ask the genesis-generator to send you some testnet BCH. And you can check your balance with below command (Replace `your_validator_address` with your genesis validator address): ``` curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["your_validator_address","latest"],"id":1}' -H "Content-Type: application/json" http://localhost:8545 ``` -After you have enough bch, you can follow below: - -replace the `--validator-key` with your validator private key - -repace the `--staking-coin` with `1000000000000000000000` or even more you have. - -⚠️Keep your private key safe, and execute this command on a secure, offline machine +After you have enough bch, you can run the following command: ``` ./build/smartbchd staking \ @@ -122,23 +114,23 @@ repace the `--staking-coin` with `1000000000000000000000` or even more you have. --chain-id=0x2711 ``` -replace `--your_tx_data` with what hex string get above. +Note: replace the content after `--validator-key` with your validator private key, and repace the content after `--staking-coin` with `1000000000000000000000` or even more you have. + +⚠️Keep your private key safe, and execute this command on a secure, offline machine + +Then broadcast the transaction (replace `--your_tx_data` with what hex string get above): ``` curl -X POST --data '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["you_tx_data"],"id":1}' -H "Content-Type: application/json" http://localhost:8545 ``` -now, you had send a editValidator tx to staking contract,check the tx receipt - -replace `your_tx_hash` with what the hex string you get above. +Now, you had send an `editValidator` transaction to staking contract. Check this transaction's receipt (replace `your_tx_hash` with what the hex string you get above): ``` curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["your_tx_has"],"id":1}' -H "Content-Type: application/json" http://localhost:8545 ``` -if the `status` displays `0x1`, congratulations, your genesis validator actived now. - - +If the `status` is `0x1`, congratulations, your genesis validator is activated now. @@ -152,7 +144,7 @@ Just finish the steps 0-9 as [running a single-node testnet](./runsinglenode.md) #### Step 1: add genesis validator info to genesis.json using hex strings sent by other nodes -Using `./build/smartbchd add-genesis-validator` multiple times, one time with one hex string sent by one node. Finally we'll get all the validators' information in the genesis.json file.h +Using `./build/smartbchd add-genesis-validator` multiple times, one time with one hex string sent by one node. Finally you'll include all the validators' information in the genesis.json file. Then, make a copy of the `~/.smartbchd` directory, excluding the `node_key.json` file.