You can use bootnodes in GoQuorum to initially discover peers. Bootnodes are regular nodes used to discover other nodes.
Bootnodes and static nodes are parallel methods for finding peers. Depending on your use case, you can use only bootnodes, only static nodes, or both.
To find peers, configure one or more bootnodes as described on this page. To configure a specific set of peer connections, use static nodes.
Development and testing networks
In private GoQuorum networks for development or testing purposes, specify at least one bootnode.
In production networks, configure two or more nodes as bootnodes.
Specifying a bootnode
To start a node, specify a bootnode enode URL for P2P discovery, using the
geth --datadir nodeDataPath --bootnodes enode://email@example.com:30303
The default host and port advertised to other peers for P2P discovery is
127.0.0.1:30303. To specify a different host or port, use the
A GoQuorum network must have at least one operating bootnode. To allow for continuity in the event of failure, configure two or more bootnodes.
We recommend putting bootnodes on the network itself and not behind a load balancer because the enode URL relates to the node public key, IP address, and discovery ports. Any changes to a bootnode enode prevents other nodes from being able to establish a connection with the bootnode.
To ensure that a bootnode enode does not change when recovering from a complete bootnode failure:
- Create the node key pair (the private and public key) before starting the bootnode.
- When creating bootnodes in the cloud (for example, AWS or Azure), attempt to assign a static private IP address to them, and record this IP address.
We recommend that you store the bootnode configuration under source control.
Specifying multiple bootnodes
To allow for continuity in the event of failure, specify all bootnodes in a comma-separated list using the
--bootnodes option for each node, including the bootnodes.
If your network has two bootnodes, pass the following parameter to all nodes, including the bootnodes.
Having each bootnode include the other bootnodes increases the speed of discovery. Nodes ignore their own enode in the bootnodes list so you can use the same bootnode list for all bootnodes.
Adding and removing bootnodes
Adding new bootnodes is a similar process to creating bootnodes. After creating the bootnodes and adding them to the network, update the
--bootnodes command line option for each node to include the new bootnodes.
When adding bootnodes, you don't need to restart running nodes. By updating the
--bootnodes option, the next time you restart the nodes, the nodes connect to the new bootnodes.
To remove bootnodes, remove them from the
--bootnodes option for each node.