LinuxCommandLibrary

bootnode

SYNOPSIS

bootnode [options] [publickey]

PARAMETERS

-4
    Restrict to IPv4 only.


-5
    Enable IPv4 and IPv6 dual stack.


-c, --alloc <seed>
    4-byte hex challenge seed for peer verification.


-d, --debug
    Enable debug logging.


-h, --help
    Display help and exit.


-nodekey <file>
    Private key file (default: bootnode.key).


-nodekeyhex <key>
    Private key as 64-byte hex string.


-nodekeydir <dir>
    Node key directory (default: .).


-n
    Generate new ephemeral node key.


-p, --publicip <addr>
    Public IP to advertise for P2P.


-r, --raft
    Enable Raft consensus support.


-v
    Increase verbosity (repeat for more).


--nat <mode>
    NAT mode: none|upnp|pmp|extip:<ip>.


--v5disc
    Enable Discv5 wire protocol.


DESCRIPTION

Bootnode is a utility from the Go Ethereum (Geth) suite for creating and running bootstrap nodes in Ethereum's P2P discovery protocol (devp2p v4/v5). It serves as an initial rendezvous point for peers in private, test, or development networks, enabling nodes to discover each other without DNS.

Upon execution, bootnode generates or loads an ECDSA node key, derives the public key and enode URL, and listens for incoming discovery packets on UDP port 30301 (or configured). It outputs the enode URL (e.g., enode://pubkey@ip:port), which other Ethereum nodes reference in their bootnodes configuration for static peering.

Supports IPv4/IPv6, NAT traversal, challenge-response verification, and Raft consensus for permissioned networks. Ideal for local clusters or Ganache-like setups. Persistently stores the node key in bootnode.key unless overridden. Verbose logging aids debugging P2P connectivity issues.

CAVEATS

Not a core Linux utility; requires Go Ethereum installation. Runs indefinitely; use Ctrl+C to stop. Key files persist unless -n used. Default UDP port 30301; firewall may block.

TYPICAL USAGE

Run bootnode to generate enode:
$ bootnode
NOTE: This node has a private key stored in: bootnode.key
Private key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
Public key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
Node enode: enode://pubkey@[::]:30301?discport=0


Configure other nodes: --bootnodes enode://...

KEY MANAGEMENT

Avoid reusing keys across networks for security. Use -n for temp keys or -nodekeyhex for scripted setups.

HISTORY

Introduced in Go Ethereum ~v1.3 (2015) as part of devp2p stack. Evolved with Discv5 (2018) and Raft support for private networks.

SEE ALSO

geth(1)

Copied to clipboard