Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli): Added ability to specify
--boot-nodes
option to the init…
… command (#4453) Tested three scenarios: 1) No boot nodes specified 2) One boot node specified 3) Multiple boot nodes specified. With no boot nodes specified: ``` sandi@sandi-ThinkPad-X1-Carbon-7th ~/w/n/nearcore (add-boot-nodes)> ./target/debug/neard init --chain-id betanet --download-genesis Jun 30 17:06:22.216 INFO neard: Version: 1.2.0, Build: 0d2d66e-modified, Latest Protocol: 45 Jun 30 17:06:22.219 INFO near: Downloading genesis file from: https://s3-us-west-1.amazonaws.com/build.nearprotocol.com/nearcore-deploy/betanet/genesis.json ... Jun 30 17:06:59.992 INFO near: Saved the genesis file to: /home/sandi/.near/genesis.json ... Jun 30 17:07:13.464 INFO near: Generated for betanet network node key and genesis file in /home/sandi/.near sandi@sandi-ThinkPad-X1-Carbon-7th ~/w/n/nearcore (add-boot-nodes)> cat /home/sandi/.near/config.json ... "network": { "addr": "0.0.0.0:24567", "external_address": "", "boot_nodes": "", "max_num_peers": 40, "minimum_outbound_peers": 5, "ideal_connections_lo": 30, "ideal_connections_hi": 35, "peer_recent_time_window": { "secs": 600, "nanos": 0 }, "safe_set_size": 20, "archival_peer_connections_lower_bound": 10, "handshake_timeout": { "secs": 20, "nanos": 0 }, "reconnect_delay": { "secs": 60, "nanos": 0 }, "skip_sync_wait": false, "ban_window": { "secs": 10800, "nanos": 0 }, "blacklist": [], "ttl_account_id_router": { "secs": 3600, "nanos": 0 }, "peer_stats_period": { "secs": 5, "nanos": 0 } }, ... ``` With one boot nodes specified: ``` sandi@sandi-ThinkPad-X1-Carbon-7th ~/w/n/nearcore (add-boot-nodes) [2]> ./target/debug/neard init --chain-id betanet --download-genesis --boot-nodes ed25519:[email protected]:24567 Jun 30 17:09:04.550 INFO neard: Version: 1.2.0, Build: 0d2d66e-modified, Latest Protocol: 45 Jun 30 17:09:04.552 INFO near: Downloading genesis file from: https://s3-us-west-1.amazonaws.com/build.nearprotocol.com/nearcore-deploy/betanet/genesis.json ... Jun 30 17:10:18.975 INFO near: Saved the genesis file to: /home/sandi/.near/genesis.json ... Jun 30 17:10:31.853 INFO near: Generated for betanet network node key and genesis file in /home/sandi/.near sandi@sandi-ThinkPad-X1-Carbon-7th ~/w/n/nearcore (add-boot-nodes)> cat /home/sandi/.near/config.json { ... "network": { "addr": "0.0.0.0:24567", "external_address": "", "boot_nodes": "ed25519:[email protected]:24567", "max_num_peers": 40, "minimum_outbound_peers": 5, "ideal_connections_lo": 30, "ideal_connections_hi": 35, "peer_recent_time_window": { "secs": 600, "nanos": 0 }, "safe_set_size": 20, "archival_peer_connections_lower_bound": 10, "handshake_timeout": { "secs": 20, "nanos": 0 }, "reconnect_delay": { "secs": 60, "nanos": 0 }, "skip_sync_wait": false, "ban_window": { "secs": 10800, "nanos": 0 }, "blacklist": [], "ttl_account_id_router": { "secs": 3600, "nanos": 0 }, "peer_stats_period": { "secs": 5, "nanos": 0 } }, ... ``` With multiple boot nodes specified: ``` sandi@sandi-ThinkPad-X1-Carbon-7th ~/w/n/nearcore (add-boot-nodes)> rm -rf ~/.near/ sandi@sandi-ThinkPad-X1-Carbon-7th ~/w/n/nearcore (add-boot-nodes)> ./target/debug/neard init --chain-id betanet --download-genesis --boot-nodes ed25519:[email protected]:24567,ed25519:[email protected]:24567,ed25519:[email protected]:24567,ed25519:[email protected]:24567 Jun 30 17:12:16.514 INFO neard: Version: 1.2.0, Build: 0d2d66e-modified, Latest Protocol: 45 Jun 30 17:12:16.517 INFO near: Downloading genesis file from: https://s3-us-west-1.amazonaws.com/build.nearprotocol.com/nearcore-deploy/betanet/genesis.json ... Jun 30 17:13:46.960 INFO near: Saved the genesis file to: /home/sandi/.near/genesis.json ... Jun 30 17:14:01.344 INFO near: Generated for betanet network node key and genesis file in /home/sandi/.near sandi@sandi-ThinkPad-X1-Carbon-7th ~/w/n/nearcore (add-boot-nodes)> cat /home/sandi/.near/config.json ... "network": { "addr": "0.0.0.0:24567", "external_address": "", "boot_nodes": "ed25519:[email protected]:24567,ed25519:[email protected]:24567,ed25519:[email protected]:24567,ed25519:[email protected]:24567", "max_num_peers": 40, "minimum_outbound_peers": 5, "ideal_connections_lo": 30, "ideal_connections_hi": 35, "peer_recent_time_window": { "secs": 600, "nanos": 0 }, "safe_set_size": 20, "archival_peer_connections_lower_bound": 10, "handshake_timeout": { "secs": 20, "nanos": 0 }, "reconnect_delay": { "secs": 60, "nanos": 0 }, "skip_sync_wait": false, "ban_window": { "secs": 10800, "nanos": 0 }, "blacklist": [], "ttl_account_id_router": { "secs": 3600, "nanos": 0 }, "peer_stats_period": { "secs": 5, "nanos": 0 } }, ... ```
- Loading branch information