Skip to content

Commit 9f270af

Browse files
author
EchoBT
committed
feat: Hardcode default bootnode address
If --bootstrap is not specified, automatically connect to: /dns4/bootnode.platform.network/tcp/9000/p2p/12D3KooWEpZoR9A1fpMN4QGspuRSa9UYHYvnFda2GWkXXZyYgAkN This simplifies deployment - validators connect to the network automatically.
1 parent e8de0ce commit 9f270af

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

bins/validator-node/src/main.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,15 +705,21 @@ async fn main() -> Result<()> {
705705
));
706706
consensus.sync_validators();
707707

708-
// Parse bootstrap peers
708+
// Parse bootstrap peers (default to official bootnode if not specified)
709+
const DEFAULT_BOOTNODE: &str = "/dns4/bootnode.platform.network/tcp/9000/p2p/12D3KooWEpZoR9A1fpMN4QGspuRSa9UYHYvnFda2GWkXXZyYgAkN";
709710
let bootstrap_peers: Vec<_> = args
710711
.bootstrap
711712
.map(|s| {
712713
s.split(',')
713714
.filter_map(|addr| addr.trim().parse().ok())
714715
.collect()
715716
})
716-
.unwrap_or_default();
717+
.unwrap_or_else(|| {
718+
// Use default bootnode
719+
vec![DEFAULT_BOOTNODE
720+
.parse()
721+
.expect("Invalid default bootnode address")]
722+
});
717723

718724
// Create network node with deterministic peer ID derived from hotkey public key
719725
let node_config = NodeConfig {

docker-compose.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,8 @@ services:
2727
- DATA_DIR=/data
2828
- VALIDATOR_SECRET_KEY=${VALIDATOR_SECRET_KEY}
2929

30-
command:
31-
- validator-node
32-
- --data-dir
33-
- /data
34-
- --bootstrap-peer
35-
- /dns4/bootnode.platform.network/tcp/9000/p2p/12D3KooWEpZoR9A1fpMN4QGspuRSa9UYHYvnFda2GWkXXZyYgAkN
30+
# Bootstrap peer is hardcoded in the binary (bootnode.platform.network)
31+
# Override with: --bootstrap /dns4/other-node/tcp/9000/p2p/<PEER_ID>
3632

3733
healthcheck:
3834
test: ["CMD", "curl", "-sf", "http://localhost:8080/health"]

0 commit comments

Comments
 (0)