How to Setup Multiple BigchainDB Nodes

Posted By : Harikesh

Oct 30, 2019

BigchainDB node has three main components:-

1. BigchainDb

2. Tendermint

3. MongoDB

 

Let’s take a tour of how they connect to each other and how they work.

 

  1. Transaction is Posted to BigchainDB web frontend

  2. Transactions are collected into a block

  3. Block is sent to Tendermint for replication

  4. Tendermint asks each node to CHECK the block.

  5. Node validates block schema and ID and says valid if it's valid

  6. Tendermint asks each node to DELIVER the block.

  7. Node write block to bigchainDb table.

  8. Voting pipeline votes on block validity

NOTE:-

Tendermint is the software through Bigchaindb replicate the data from one machine to other machines securely and consistently. So Tendermint play an important role in multiple node connection.


 

There are two ways to add more nodes to the network

  1. We can add a new node as a validator node

  2. Or, we can add a new node as a non-validator node


 

Non-Validator Node Setup

Non-Validator Node is not participating directly, but will verify and keep up with the consensus protocol.  

 

These are the following steps to add non-validator node:-

  1. Copy the genesis.json file of coordinator node present in ~/.tendermint/config.

  2. And paste it  in ~/.tendermint/config of other node

  3. Run Tendermint init, it will create priv_validator.json with respect  to the new JSON (Note:- if priv_validator is already found .Please regenerate because init never overwrite the existing one)

  4. Run Tendermint node using --p2p.persistent_peers command.  

 

Re-generate priv_validator.json file

  1. Run Tendermint gen_validator it will create new priv_validator.json

  2. Overwrite old priv_validator.json with the new one.  

  3. Run Tendermint unsafe_reset_all (Remove all the data and WAL, reset this node's validator to genesis state)


 

Validator Node Setup

Validator node is also participating in the consensus by proposing blocks and voting on them.

 

These are the following steps to add validator node

  1. Add validators in the  genesis.json before starting the network. Example is given below 

     "validators":[
          {
             "pub_key":{
                "type":"AC26791624DE60",
                "value":"<Member 1 public key>"
             },
             "power":10,
             "name":"<Member 1 name>"
          },
          {
             "pub_key":{
                "type":"AC26791624DE60",
                "value":"<Member 2 public key>"
             },
             "power":10,
             "name":"<Member 2 name>"
          }...

     

  1. Generator new priv_validator.json

  2. Copy its pub_key into genesis.json

  3. Update the new genesis.json  into ~/.tendermint/config

  4. Copy the new genesis.json and priv_validator.json into the new machine.

  5. And run Tendermint node on both the machine using --p2p.persistent_peers. 

    Note: The key ‘name’ is the Member’s moniker

Leave a

Comment

Name is required

Invalid Name

Comment is required

Recaptcha is required.

blog-detail

November 21, 2024 at 12:51 pm

Your comment is awaiting moderation.

By using this site, you allow our use of cookies. For more information on the cookies we use and how to delete or block them, please read our cookie notice.

Chat with Us
Telegram Button
Youtube Button

Contact Us

Oodles | Blockchain Development Company

Name is required

Please enter a valid Name

Please enter a valid Phone Number

Please remove URL from text