Updated 2019-12-02

Bootnodes

Bootnodes are used to initially discover peers. A bootnode is a regular node a node uses to discover nodes.

Tip

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 bootnodes and statics nodes. For example, you run multiple nodes on MainNet (discovery via bootnode) but want to ensure your nodes are always connected (using static nodes).

To find peers, configure one or more bootnodes as described below. To configure a specific set of peer connections, use static nodes.

Mainnet and public testnets

For mainnet, Rinkeby, Ropsten, and Görli, Hyperledger Besu predefines a list of enode URLs.

Private networks

In private networks for development or testing purposes, specify at least one bootnode.

In production networks, configure two or more nodes as bootnodes.

Specify a bootnode

To start a node specifying a bootnode for P2P discovery, use the --bootnodes option to specify the enode of the bootnode.

Example

besu --genesis-file=privateNetworkGenesis.json --data-path=nodeDataPath --bootnodes=enode://c35c3ec90a8a51fd5703594c6303382f3ae6b2ecb99bab2c04b3794f2bc3fc2[email protected]127.0.0.1:30303

The default host and port for P2P peer discovery is 127.0.0.1:30303. Use the --p2p-host and --p2p-port option to specify a host and port.

By default, peer discovery listens on all available network interfaces. If the device that Besu runs on must bind to a specific interface, use the --p2p-interface option to specify the network interface to use.