Skip to content
You are reading GoQuorum development version documentation and some displayed features may not be available in the stable release. You can switch to stable version using the version box at screen bottom.

Updated on May 3, 2021

Configuring Raft consensus

To enable Raft consensus, specify the --raft command line option when starting GoQuorum.

Raft requires that all initial nodes in the cluster are configured as static peers. The order of the enode IDs in the static-nodes.json file must be the same across all peers.

The enode IDs must include a raftport querystring parameter specifying the Raft port for each peer.

Example

`enode://abcd@127.0.0.1:30400?raftport=50400`

For the Raft network to work, 51% of the peers must be up and running. We recommend having an odd number of at least 3 peers in the network.

Adding Raft members

To add a verifier node to the cluster, attach to a JS console and issue raft.addPeer(enodeId).

To add a learner node to the cluster, attach to a JS console and issue raft.addLearner(enodeId).

To promote a learner to a verifier in the cluster, attach to a JS console of a leader or verifier node and issue raft.promoteToPeer(raftId).

The enode ID must include a raftport querystring parameter like the enode IDs in the static-nodes.json file.

The addPeer and addLearner calls allocate and return a Raft ID not already in use. After addPeer or addLearner, start the new GoQuorum node with the --raftjoinexisting and --raft command line options. Use the Raft ID returned by addPeer or addLearner as the argument for --raftjoinexisting.

Removing Raft members

To remove a node from the cluster, attach to a JS console and issue raft.removePeer(raftId). raftId is the number of the node to be removed. For initial nodes in the cluster, raftId number is the 1-indexed position of the enode ID for the node in the static peers list. Once a node is removed from the cluster, it is permanent. The Raft ID cannot reconnect to the cluster in the future. If rejoining, the node must specify a new Raft ID returned by addPeer or addLearner.

Minting frequency

By default, blocks are minted no more frequently than every 50ms. When transactions arrive:

  • If it has been at least 50ms since the last block, a new block is minted immediately.
  • If it has been less that 50ms, a new block is minted 50ms after the previous block was minted. Waiting prevents Raft being flooded with blocks.

The rate limiting achieves a balance between transaction throughput and latency.

Configure the minting frequency using the --raftblocktime command line option when starting GoQuorum.

Raft transport layer

Blocks are communicated over the HTTP transport layer built into etcd Raft.

By default, GoQuorum listens on port 50400 for the Raft transport. Use the --raftport command line option to change the port.

By default, the number of peers is 25. Use the --maxpeers N command line option to configure the maximum number of peers where N is expected size of the cluster.

ConsenSys has acquired Quorum from J.P. Morgan. Please read the FAQ.
Questions or feedback? You can discuss issues and obtain free support on GoQuorum Slack channel.
For paid professional support by ConsenSys, contact us at quorum@consensys.net