Browse Source

config: add a Deprecation annotation to P2PConfig.Seeds. (#7496)

pull/7493/head
M. J. Fromberger 2 years ago
committed by GitHub
parent
commit
7cdf560173
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 8 deletions
  1. +1
    -1
      cmd/tendermint/commands/run_node.go
  2. +5
    -3
      config/config.go
  3. +4
    -4
      test/e2e/runner/setup.go

+ 1
- 1
cmd/tendermint/commands/run_node.go View File

@ -62,7 +62,7 @@ func AddNodeFlags(cmd *cobra.Command) {
"p2p.laddr",
config.P2P.ListenAddress,
"node listen address. (0.0.0.0:0 means any interface, any port)")
cmd.Flags().String("p2p.seeds", config.P2P.Seeds, "comma-delimited ID@host:port seed nodes")
cmd.Flags().String("p2p.seeds", config.P2P.Seeds, "comma-delimited ID@host:port seed nodes") //nolint: staticcheck
cmd.Flags().String("p2p.persistent-peers", config.P2P.PersistentPeers, "comma-delimited ID@host:port persistent peers")
cmd.Flags().Bool("p2p.upnp", config.P2P.UPNP, "enable/disable UPNP port forwarding")
cmd.Flags().Bool("p2p.pex", config.P2P.PexReactor, "enable/disable Peer-Exchange")


+ 5
- 3
config/config.go View File

@ -571,9 +571,11 @@ type P2PConfig struct { //nolint: maligned
// Comma separated list of seed nodes to connect to
// We only use these if we can’t connect to peers in the addrbook
// NOTE: not used by the new PEX reactor. Please use BootstrapPeers instead.
// TODO: Remove once p2p refactor is complete
// ref: https://github.com/tendermint/tendermint/issues/5670
//
// Deprecated: This value is not used by the new PEX reactor. Use
// BootstrapPeers instead.
//
// TODO(#5670): Remove once the p2p refactor is complete.
Seeds string `mapstructure:"seeds"`
// Comma separated list of peers to be added to the peer store


+ 4
- 4
test/e2e/runner/setup.go View File

@ -316,12 +316,12 @@ func MakeConfig(node *e2e.Node) (*config.Config, error) {
}
}
cfg.P2P.Seeds = ""
cfg.P2P.Seeds = "" //nolint: staticcheck
for _, seed := range node.Seeds {
if len(cfg.P2P.Seeds) > 0 {
cfg.P2P.Seeds += ","
if len(cfg.P2P.Seeds) > 0 { //nolint: staticcheck
cfg.P2P.Seeds += "," //nolint: staticcheck
}
cfg.P2P.Seeds += seed.AddressP2P(true)
cfg.P2P.Seeds += seed.AddressP2P(true) //nolint: staticcheck
}
cfg.P2P.PersistentPeers = ""


Loading…
Cancel
Save