discv4 discovery of v1.x releases. Each node
runs:
- a Bitcoin Core-style address manager (
addrman) that stores up to ~65k peer records in stochastic “new” and “tried” bucket tables, keyed by a per-node secretnKey; - the
parallax-disc/1RLPx subprotocol, carrying a mandatory session-openingHellofollowed byGetPeers/Peers/YourAddrgossip messages on top of existing TCP sessions —Hellomust be each side’s first disc message, and anything else first ends the session; - a BIP324-style v2 handshake that lets two nodes authenticate a
TCP connection knowing only each other’s
ip:port— no persistent secp256k1 identity, no enode URL, no ENR.
The --legacy-discovery flag
--legacy-discovery controls how much of the v1.x transport surface
the node exposes. UDP discovery and legacy RLPx handshake acceptance
are coupled: they share the same v1.x identity model (persistent
secp256k1 key, enode URL, ENR record), so the flag drives both in
lockstep.
auto is the transitional posture: the node answers inbound discv4
PING/FINDNODE so v1.x peers can still contact it, but the addrman is
the primary dial source. Most mainnet operators will never need to
change it.
on matches pre-2.0 behaviour — discv4.RandomNodes() is plumbed
into the dial scheduler, useful when debugging against a pure v1.x
network.
off is the v3.0 posture available as an early opt-in: no UDP
socket, the listener rejects anything that isn’t the v2 magic byte
0xA0, and the dialer refuses addrman entries that carry a legacy
NodeID. The enode URL logged at startup becomes diagnostic-only —
no peer handshake consumes the persistent secp256k1 key in this mode.
Topology examples
The canonical three-role mainnet setup:parallax-disc/1
gossip through B.
Addrbook persistence
The addrman persists to<datadir>/addrbook.rlp on clean shutdown
and reloads it on next startup. The on-disk format is versioned
(v1 today); upgrades introduce a new version byte plus a migration
function rather than appending fields in place.
Unknown newer file versions are refused without truncation — a
downgrade-then-upgrade never loses the original file.
Operator RPC
The admin namespace exposes the addrbook and dial controls:admin_addnode <ip:port | <addr>.onion:port | enode://…>— pin a peer assource=manual; persists across restarts and is heavily weighted in dial selection (a 4x chance multiplier, not a strict front-of-queue guarantee).admin_removenode <ip:port | <addr>.onion:port | enode://…>— inverse of addnode.admin_addrbookStatus— read-only addrbook snapshot (total/new/tried, per-source counts).admin_addrbookResetKey— regeneratenKeyand clear the tried table. Operator-only; use after a crediblenKeyleak.admin_dialV2 <ip:port | <addr>.onion:port>— directly dial a remote over the v2 handshake. Operator-testing entry point.
admin_setban <subnet> <add|remove> [bantime] [absolute]admin_listbannedadmin_clearbanned
parallax-cli subcommands are addnode, removenode,
addrbook-status, addrbook-resetkey, dialv2, setban,
listbanned, clearbanned.

