Skip to content

Commit

Permalink
Fix 'no-connections' flag for the 'node'. (#1313)
Browse files Browse the repository at this point in the history
* Fix 'no-connections' flag for the 'node'.

* Improve 'peers' and 'no-connections' options description.

---------

Co-authored-by: Alexey Kiselev <alexey.kiselev@gmail.com>
  • Loading branch information
nickeskov and alexeykiselev authored Feb 7, 2024
1 parent 0dc1325 commit e196fd3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ func (c *config) parse() {
"Log the operation of FSM. Turned off by default.")
flag.StringVar(&c.statePath, "state-path", "", "Path to node's state directory.")
flag.StringVar(&c.blockchainType, "blockchain-type", "mainnet", "Blockchain type: mainnet/testnet/stagenet.")
flag.StringVar(&c.peerAddresses, "peers", "", "Addresses of peers to connect to.")
flag.StringVar(&c.peerAddresses, "peers", "",
"Forces the node to connect to the provided peers. Format: \"ip:port,...,ip:port\".")
flag.StringVar(&c.declAddr, "declared-address", "", "Address to listen on.")
flag.StringVar(&c.nodeName, "name", "gowaves", "Node name.")
flag.StringVar(&c.cfgPath, "cfg-path", "",
Expand Down Expand Up @@ -198,7 +199,8 @@ func (c *config) parse() {
flag.StringVar(&c.bindAddress, "bind-address", "",
"Bind address for incoming connections. If empty, will be same as declared address")
flag.BoolVar(&c.disableOutgoingConnections, "no-connections", false,
"Disable outgoing network connections to peers.")
"Disable outgoing network connections to known peers."+
"This flag DOES NOT disable outgoing connections to peers from the 'peers' option.")
flag.StringVar(&c.minerVoteFeatures, "vote", "", "Miner vote features.")
flag.BoolVar(&c.disableBloomFilter, "disable-bloom", false,
"Disable bloom filter. Less memory usage, but decrease performance.")
Expand Down Expand Up @@ -568,7 +570,7 @@ func FromArgs(scheme proto.Scheme, c *config) func(s *settings.NodeSettings) err
s.GrpcAddr = c.grpcAddr
s.WavesNetwork = proto.NetworkStrFromScheme(scheme)
s.Addresses = c.peerAddresses
if c.peerAddresses == "" {
if c.peerAddresses == "" && !c.disableOutgoingConnections {
s.Addresses = defaultPeers[c.blockchainType]
}
return nil
Expand Down

0 comments on commit e196fd3

Please sign in to comment.