Merge pull request #7204 from filecoin-project/feat/natmap-config
config for disabling NAT port mapping
This commit is contained in:
commit
b0293fe0e5
@ -195,7 +195,6 @@ var LibP2P = Options(
|
|||||||
Override(new(routing.Routing), lp2p.Routing),
|
Override(new(routing.Routing), lp2p.Routing),
|
||||||
|
|
||||||
// Services
|
// Services
|
||||||
Override(NatPortMapKey, lp2p.NatPortMap),
|
|
||||||
Override(BandwidthReporterKey, lp2p.BandwidthCounter),
|
Override(BandwidthReporterKey, lp2p.BandwidthCounter),
|
||||||
Override(AutoNATSvcKey, lp2p.AutoNATService),
|
Override(AutoNATSvcKey, lp2p.AutoNATService),
|
||||||
|
|
||||||
@ -277,6 +276,8 @@ func ConfigCommon(cfg *config.Common, enableLibp2pNode bool) Option {
|
|||||||
Override(AddrsFactoryKey, lp2p.AddrsFactory(
|
Override(AddrsFactoryKey, lp2p.AddrsFactory(
|
||||||
cfg.Libp2p.AnnounceAddresses,
|
cfg.Libp2p.AnnounceAddresses,
|
||||||
cfg.Libp2p.NoAnnounceAddresses)),
|
cfg.Libp2p.NoAnnounceAddresses)),
|
||||||
|
|
||||||
|
If(!cfg.Libp2p.DisableNatPortMap, Override(NatPortMapKey, lp2p.NatPortMap)),
|
||||||
),
|
),
|
||||||
Override(new(dtypes.MetadataDS), modules.Datastore(cfg.Backup.DisableMetadataLog)),
|
Override(new(dtypes.MetadataDS), modules.Datastore(cfg.Backup.DisableMetadataLog)),
|
||||||
)
|
)
|
||||||
|
@ -348,23 +348,36 @@ Format: multiaddress`,
|
|||||||
|
|
||||||
Comment: ``,
|
Comment: ``,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Name: "DisableNatPortMap",
|
||||||
|
Type: "bool",
|
||||||
|
|
||||||
|
Comment: `When not disabled (default), lotus asks NAT devices (e.g., routers), to
|
||||||
|
open up an external port and forward it to the port lotus is running on.
|
||||||
|
When this works (i.e., when your router supports NAT port forwarding),
|
||||||
|
it makes the local lotus node accessible from the public internet`,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Name: "ConnMgrLow",
|
Name: "ConnMgrLow",
|
||||||
Type: "uint",
|
Type: "uint",
|
||||||
|
|
||||||
Comment: ``,
|
Comment: `ConnMgrLow is the number of connections that the basic connection manager
|
||||||
|
will trim down to.`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "ConnMgrHigh",
|
Name: "ConnMgrHigh",
|
||||||
Type: "uint",
|
Type: "uint",
|
||||||
|
|
||||||
Comment: ``,
|
Comment: `ConnMgrHigh is the number of connections that, when exceeded, will trigger
|
||||||
|
a connection GC operation. Note: protected/recently formed connections don't
|
||||||
|
count towards this limit.`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "ConnMgrGrace",
|
Name: "ConnMgrGrace",
|
||||||
Type: "Duration",
|
Type: "Duration",
|
||||||
|
|
||||||
Comment: ``,
|
Comment: `ConnMgrGrace is a time duration that new connections are immune from being
|
||||||
|
closed by the connection manager.`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"MinerAddressConfig": []DocField{
|
"MinerAddressConfig": []DocField{
|
||||||
|
@ -292,8 +292,21 @@ type Libp2p struct {
|
|||||||
BootstrapPeers []string
|
BootstrapPeers []string
|
||||||
ProtectedPeers []string
|
ProtectedPeers []string
|
||||||
|
|
||||||
ConnMgrLow uint
|
// When not disabled (default), lotus asks NAT devices (e.g., routers), to
|
||||||
ConnMgrHigh uint
|
// open up an external port and forward it to the port lotus is running on.
|
||||||
|
// When this works (i.e., when your router supports NAT port forwarding),
|
||||||
|
// it makes the local lotus node accessible from the public internet
|
||||||
|
DisableNatPortMap bool
|
||||||
|
|
||||||
|
// ConnMgrLow is the number of connections that the basic connection manager
|
||||||
|
// will trim down to.
|
||||||
|
ConnMgrLow uint
|
||||||
|
// ConnMgrHigh is the number of connections that, when exceeded, will trigger
|
||||||
|
// a connection GC operation. Note: protected/recently formed connections don't
|
||||||
|
// count towards this limit.
|
||||||
|
ConnMgrHigh uint
|
||||||
|
// ConnMgrGrace is a time duration that new connections are immune from being
|
||||||
|
// closed by the connection manager.
|
||||||
ConnMgrGrace Duration
|
ConnMgrGrace Duration
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user