Merge pull request #1953 from jimpick/feat/libp2p-announce-addresses
Make libp2p swarm Announce / NoAnnounce addresses configurable
This commit is contained in:
@@ -371,6 +371,9 @@ func ConfigCommon(cfg *config.Common) Option {
|
||||
Override(new(dtypes.BootstrapPeers), modules.ConfigBootstrap(cfg.Libp2p.BootstrapPeers)),
|
||||
),
|
||||
),
|
||||
Override(AddrsFactoryKey, lp2p.AddrsFactory(
|
||||
cfg.Libp2p.AnnounceAddresses,
|
||||
cfg.Libp2p.NoAnnounceAddresses)),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
+7
-3
@@ -39,9 +39,11 @@ type API struct {
|
||||
|
||||
// Libp2p contains configs for libp2p
|
||||
type Libp2p struct {
|
||||
ListenAddresses []string
|
||||
BootstrapPeers []string
|
||||
ProtectedPeers []string
|
||||
ListenAddresses []string
|
||||
AnnounceAddresses []string
|
||||
NoAnnounceAddresses []string
|
||||
BootstrapPeers []string
|
||||
ProtectedPeers []string
|
||||
|
||||
ConnMgrLow uint
|
||||
ConnMgrHigh uint
|
||||
@@ -78,6 +80,8 @@ func defCommon() Common {
|
||||
"/ip4/0.0.0.0/tcp/0",
|
||||
"/ip6/::/tcp/0",
|
||||
},
|
||||
AnnounceAddresses: []string{},
|
||||
NoAnnounceAddresses: []string{},
|
||||
|
||||
ConnMgrLow: 150,
|
||||
ConnMgrHigh: 180,
|
||||
|
||||
Reference in New Issue
Block a user