Skip to content

node: connect to the default peers when no --peer is given (#2023) - #2157

Open
profinch wants to merge 1 commit into
BeamMW:masterfrom
profinch:fix/2023-node-default-peers
Open

profinch wants to merge 1 commit into
BeamMW:masterfrom
profinch:fix/2023-node-default-peers

Conversation

@profinch

@profinch profinch commented Oct 7, 2026

Copy link
Copy Markdown

Fixes #2023, and does what #1899 asked for: default peers in beam-node.

Problem

beam-node has no default peers, and the shipped beam-node.cfg has peer= commented out. A fresh node started without --peer has nothing to connect to. It logs Requesting block 0 and then waits forever, with no hint why. That is exactly the log in #2023. Reproduced on master (daf7191), fresh mainnet node, no --peer: no connection and no further log lines in 30 s.

The wallets already have a per-network list of public nodes, getDefaultPeers() (eu-nodes/us-nodes.mainnet.beam.mw:8100 for mainnet). The node just didn't use it.

Change

  • default_peers.{h,cpp} move from wallet_core to core, so beam-node can use them without linking the wallet. wallet/core/default_peers.h stays as a forwarding header, so existing includes (beam-ui settings.cpp, start_view.cpp) keep working. The in-repo includes now use core/default_peers.h.
  • beam-node: when no --peer is given (command line or cfg), it uses the default peers of its network and logs No peers specified, connecting to the default peers of <network>. For a network without a list (e.g. custom rules) it logs a warning to use --peer, instead of staying silent. With --peer, nothing changes: the defaults are not added.
  • beam-node.cfg documents this and lists the mainnet defaults, commented out, as Beam Node - default peers #1899 suggested.

Testing

  • Fresh mainnet node, no --peer, after the fix: connects to 188.245.67.32:8100 (eu-nodes) and 5.161.134.203:8100 (us-nodes) within ~1 s, starts requesting headers, and discovers more peers through them (1,000+ log lines in 40 s instead of 20).
  • --peer=127.0.0.1:1: only that peer is tried, no defaults.
  • --network masternet: picks the masternet list.
  • Full build (ninja, all targets) and wallet_test, wallet_api_test, node_test pass (macOS arm64, Ninja RelWithDebInfo). Android is not built here; its two includes just change path.

Notes for the infra side (not changed here)

  • On 2026-10-07 us-nodes.mainnet.beam.mw (5.161.134.203) reported tip 3,928,665, while eu-nodes and every other peer reported 4,069,942. It looks stuck about 140k blocks behind.
  • None of the masternet hosts in the list (eu-node01..04.masternet.beam.mw) resolve in DNS any more.

A new node started without --peer had nothing to connect to: it logged
"Requesting block 0" and waited forever, with no hint why. The wallets
already have a default peer list per network (getDefaultPeers), the node
didn't use it (BeamMW#1899).

- Move default_peers.{h,cpp} from wallet_core to core, so beam-node can use
  them. wallet/core/default_peers.h stays as a forwarding header for
  existing includes (beam-ui).
- beam-node uses the default peers of its network when no --peer is given,
  and says so in the log. A network without a list (custom rules) gets a
  warning to specify --peer instead of silence.
- beam-node.cfg lists the mainnet defaults (commented out).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linux CLI node not working

1 participant