📝
smartbch
  • Introduction
  • Whitepaper
  • FAQ
  • Mainnet
  • Testnets
  • Join Amber testnet as a Validator
  • Developer's Guide
    • Introduction
    • Deploy contracts using Truffle
    • Deploy contracts using Remix
    • JSON-RPC Endpoints
    • Staking Scheme
    • XHedge Smart Contract
    • Decision of the minimum gas price
  • Sha-Gate Bridge
    • Sha-Gate Specification
    • Sha-Gate Risk Analysis
    • Sha-Gate's Covenant
  • In-Depth Design Documents
    • Introduction
    • MoeingADS's General Ideas
    • MoeingADS's RabbitStore
    • MoeingADS's internal architecture
    • Benchmarking MoeingADS
    • Benchmarking MoeingEVM and MoeingADS
    • Benchmarking Testnet
    • Transaction Reordering in smartBCH
    • Transaction Parallel Execution in smartBCH
    • Send back-to-back Transactions
    • Data structures in world state
  • SmartBCH Evolution Proposals (SEPs)
    • SEP101: Store values with arbitrary length
    • SEP102: Adjustment of Used Gas
    • SEP109: On-chain Verification of Verifiable Random Functions
    • SEP18: Blockchain cheques on smartBCH
    • SEP20: Tokens on smartBCH
    • SEP206: Manipulate Native Token as a SEP20 Token
    • SEP201: Simple Stochastic Payment
  • Archives
    • Single Node Private Testnet
    • Multi-Node Testnet
    • Fake RPC Server for Testing
    • Test using MetaMask
Powered by GitBook
On this page

Was this helpful?

Join Amber testnet as a Validator

PreviousTestnetsNextIntroduction

Last updated 2 years ago

Was this helpful?

This document introduces how to join the amber as a validator node.

Before you start, you must have a trusted server running bitcoincashnode's client with RPC enabled. The executable smartbchd will connect to it for querying staking information.

1. build the binary

Running the steps of .

Then clone the source code of smartBCH and build the executable of smartbchd.

cd ~/smart_bch
git clone -b v0.4.2 --depth 1 https://github.com/smartbch/smartbch
cd smartbch
go build -tags "params_amber cppbtree" github.com/smartbch/smartbch/cmd/smartbchd

After successfully executing the above commands, you'll get a ~/smart_bch/smartbch/smartbchd file for amber.

2. prepare the working directory

cp ~/smart_bch/smartbch/smartbchd ~/build/smartbchd
cd ~
rm -rf .smartbchd
~/build/smartbchd init mynode --chain-id 0x2711
wget https://github.com/smartbch/artifacts/releases/download/v0.0.5/dot.smartbchd.tgz
tar zxvf dot.smartbchd.tgz
cp -rf dot.smartbchd/* .smartbchd/

3. Prepare the validator keys

Then, copy the priv_validator_key.json to work directory by running command below:

cp ./priv_validator_key.json ~/.smartbchd/config/

4. Modify App config

Open the ~/.smartbchd/config/app.toml file to modify the information of the bitcoincashnode's client with RPC enabled.

# BCH mainnet rpc url
mainnet-rpc-url = "http://ip-address:8332"

# BCH mainnet rpc username
mainnet-rpc-username = "<my user name>"

# BCH mainnet rpc password
mainnet-rpc-password = "<my password>"

5. start smartbchd

cd ~/build
~/build/smartbchd start --mainnet-genesis-height=602983

6. Build createValidator Tx

Using validator private key and consensus pubkey generated in step 3 to build command below:

./smartbchd staking \
--validator-key=<your validator private key> \
--staking-coin=1 \
--consensus-pubkey=<your consensus pub key> \
--introduction=<your validator introduction> \
--type=create \
--nonce=0 \
--gas-price=10000000000 \
--chain-id=0x2711	

This command generate createValidator tx raw data, send it in step 8 below.

7. Get some BCH to Send Tx

Get some BCH from some one has BCH in smartBCH already to your validator account. To check your account balance like this.

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["<your validator account address>","latest"],"id":1}' -H "Content-Type: application/json" http://127.0.0.1:8545

8. Send Tx to smartBCH Amber

9. Vote your consensus pubkey in Amber Xhedge Contract

Please go to https://amber.xhedge.cash/ to split your BCH to LeverNFT and HedgeNFT, and vote for your validator just created.

Running step 1 and step 2 of to generate validator key and consensus pubkey.

Please follow step 1, 2 of .

this document
this doc
this doc