diff options
| author | Bitflash <btf01@proton.me> | 2026-07-29 16:01:43 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-29 16:01:43 -0300 |
| commit | ab24958f1470cb62a4637126345fdf14c2ec0bd4 (patch) | |
| tree | de3c1ca3888a531fef6240b14eca79655e226907 /src/net.h | |
| parent | f9d839e4e53ba5e4ca4829e52ef9470fd116d784 (diff) | |
net: compiled-in bootstrap seeds, so a first run does not need a relay (#36)
* net: compiled-in bootstrap seeds, so a first run does not need a relay
A node with no cache has only the Nostr relays. If they are down, blocked or
slow, a first run has no way into the network at all -- and that is the one
moment a user has no patience for. Seeds are the floor under that.
A seed entry is an address and an encryption key. Deliberately no meeting node:
the rendezvous relay pairs on the service's public key, and a `.btf` address is
that key, so a client can find a seed by trying the known relays in turn.
Recording which relay a seed was on would rot the moment it failed over, which
is exactly the failure this project spent weeks chasing -- advertising a
rendezvous somebody is not registered at.
Seeds carry no authority. They serve the same signed, self-certifying
descriptors as any peer, so a hostile seed can stall a bootstrap but cannot
forge a peer or feed a false chain.
The compiled list is empty. Which nodes become permanent public bootstrap
targets is a decision for whoever runs the network, not a default, and it is
close to irreversible once binaries are distributed. Empty is valid: discovery
falls back to Nostr exactly as before. /btfseed=ADDRESS:ENCHEX (repeatable)
appends at runtime, for testing and for private networks.
Tested against the live network, clean datadir, no cache, three seeds carrying
no meeting node:
btfpeers: no cache yet, falling back to seeds
btfseed: trying 3 seed(s) across 3 relay(s)
btfseed: reached q5jxyzn...btf via 90.156.222.107:8434
btfseed: 3 seed(s) answered
* net: add the Almaty bootstrap node to the seed list
Dedicated node, no wallet balance, no mining, running beside the rendezvous
relay on the same host. It exists only to answer a first dial.
Fresh datadir, no flags, compiled list only:
btfpeers: no cache yet, falling back to seeds
btfseed: trying 1 seed(s) across 3 relay(s)
btfseed: reached ygffz37...btf via 90.156.222.107:8434
btfseed: 1 seed(s) answered
btfpeers: kept 2 of 2 descriptor(s)
5.2 seconds from nothing to a peer, against 36s for a cold start that had to go
through the relays. The seed then handed over two more peers by exchange, which
the cache keeps for next time.
Diffstat (limited to 'src/net.h')
| -rw-r--r-- | src/net.h | 3 |
1 files changed, 3 insertions, 0 deletions
| @@ -29,6 +29,9 @@ CNode* ConnectNodeBtfResolved(const string& strBtfAddr, const string& strMeeting | |||
| 29 | void ThreadBtfAccept(void* parg); | 29 | void ThreadBtfAccept(void* parg); |
| 30 | void ThreadBtfConnect(void* parg); | 30 | void ThreadBtfConnect(void* parg); |
| 31 | extern string strBtfConnect; | 31 | extern string strBtfConnect; |
| 32 | // Bootstrap seeds added at runtime with /btfseed=ADDRESS:ENCHEX (repeatable). | ||
| 33 | // The compiled-in list lives in net.cpp; these are appended to it. | ||
| 34 | extern std::vector<std::pair<std::string, std::string> > vBtfExtraSeeds; | ||
| 32 | 35 | ||
| 33 | // --- .btf peer exchange --------------------------------------------------- | 36 | // --- .btf peer exchange --------------------------------------------------- |
| 34 | // Peers gossip signed descriptors so discovery survives a relay outage. Both | 37 | // Peers gossip signed descriptors so discovery survives a relay outage. Both |