From 6b84f8c6b1e73254d23cca9ac31a567723b0bddc Mon Sep 17 00:00:00 2001 From: Jun Song <87601811+syjn99@users.noreply.github.com> Date: Thu, 6 Mar 2025 03:21:22 +0900 Subject: [PATCH] Add p2p address format for CLI users (#14886) * Add address format for CLI users * Add changelog --- changelog/syjn99_cli-peer-address-format.md | 3 +++ cmd/flags.go | 15 ++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 changelog/syjn99_cli-peer-address-format.md diff --git a/changelog/syjn99_cli-peer-address-format.md b/changelog/syjn99_cli-peer-address-format.md new file mode 100644 index 0000000000..8b591b5851 --- /dev/null +++ b/changelog/syjn99_cli-peer-address-format.md @@ -0,0 +1,3 @@ +### Added + +- Add acceptable address types for static peers \ No newline at end of file diff --git a/cmd/flags.go b/cmd/flags.go index 6c1c44e8d9..ae2ad834ab 100644 --- a/cmd/flags.go +++ b/cmd/flags.go @@ -93,15 +93,20 @@ var ( Name: "no-discovery", Usage: "Enable only local network p2p and do not connect to cloud bootstrap nodes", } - // StaticPeers specifies a set of peers to connect to explicitly. + // StaticPeers specifies a set of peers to connect to explicitly, accepting following format of addresses: + // enode, multiaddr, enr. StaticPeers = &cli.StringSliceFlag{ - Name: "peer", - Usage: "Connect with this peer, this flag may be used multiple times. This peer is recognized as a trusted peer.", + Name: "peer", + Usage: "Connect with this peer, this flag may be used multiple times. " + + "This peer is recognized as a trusted peer." + + "Accepts enode, multiaddr, and enr formats.", } // BootstrapNode tells the beacon node which bootstrap node to connect to BootstrapNode = &cli.StringSliceFlag{ - Name: "bootstrap-node", - Usage: "The address of bootstrap node. Beacon node will connect for peer discovery via DHT. Multiple nodes can be passed by using the flag multiple times but not comma-separated. You can also pass YAML files containing multiple nodes.", + Name: "bootstrap-node", + Usage: "The enr/enode address of bootstrap node. Beacon node will connect for peer discovery via DHT. " + + "Multiple nodes can be passed by using the flag multiple times but not comma-separated. " + + "You can also pass YAML files containing multiple nodes.", Value: cli.NewStringSlice(params.BeaconNetworkConfig().BootstrapNodes...), } // RelayNode tells the beacon node which relay node to connect to.