Repository navigation
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2023, and does what #1899 asked for: default peers in beam-node.
Problem
beam-nodehas no default peers, and the shippedbeam-node.cfghaspeer=commented out. A fresh node started without--peerhas nothing to connect to. It logsRequesting block 0and 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:8100for mainnet). The node just didn't use it.Change
default_peers.{h,cpp}move fromwallet_coretocore, sobeam-nodecan use them without linking the wallet.wallet/core/default_peers.hstays as a forwarding header, so existing includes (beam-uisettings.cpp,start_view.cpp) keep working. The in-repo includes now usecore/default_peers.h.beam-node: when no--peeris given (command line or cfg), it uses the default peers of its network and logsNo 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.cfgdocuments this and lists the mainnet defaults, commented out, as Beam Node - default peers #1899 suggested.Testing
--peer, after the fix: connects to188.245.67.32:8100(eu-nodes) and5.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.ninja, all targets) andwallet_test,wallet_api_test,node_testpass (macOS arm64, Ninja RelWithDebInfo). Android is not built here; its two includes just change path.Notes for the infra side (not changed here)
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.eu-node01..04.masternet.beam.mw) resolve in DNS any more.