Skip to content

Commit c158116

Browse files
committed
docs: document removed Relay V1 options
1 parent 6879554 commit c158116

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

core/node/groups.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,10 @@ func LibP2P(bcfg *BuildCfg, cfg *config.Config) fx.Option {
112112
}
113113

114114
enableRelayTransport := cfg.Swarm.Transports.Network.Relay.WithDefault(true) //nolint
115+
enableRelayService := cfg.Swarm.RelayService.Enabled.WithDefault(true)
115116
enableRelayClient := cfg.Swarm.RelayClient.Enabled.WithDefault(true)
116117

117-
// Warn about a deprecated option.
118+
// Force users to migrate old config.
118119
//nolint
119120
if cfg.Swarm.DisableRelay {
120121
logger.Fatal("The 'Swarm.DisableRelay' (Relay V1) config field was removed." +
@@ -140,7 +141,7 @@ func LibP2P(bcfg *BuildCfg, cfg *config.Config) fx.Option {
140141
fx.Provide(libp2p.AddrsFactory(cfg.Addresses.Announce, cfg.Addresses.AppendAnnounce, cfg.Addresses.NoAnnounce)),
141142
fx.Provide(libp2p.SmuxTransport(cfg.Swarm.Transports)),
142143
fx.Provide(libp2p.RelayTransport(enableRelayTransport)),
143-
fx.Provide(libp2p.RelayService(cfg.Swarm.RelayService.Enabled.WithDefault(true), cfg.Swarm.RelayService)),
144+
fx.Provide(libp2p.RelayService(enableRelayService, cfg.Swarm.RelayService)),
144145
fx.Provide(libp2p.Transports(cfg.Swarm.Transports)),
145146
fx.Invoke(libp2p.StartListening(cfg.Addresses.Swarm)),
146147
fx.Invoke(libp2p.SetupDiscovery(cfg.Discovery.MDNS.Enabled, cfg.Discovery.MDNS.Interval)),

docs/config.md

+8-13
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ config file at runtime.
107107
- [`Swarm.DisableBandwidthMetrics`](#swarmdisablebandwidthmetrics)
108108
- [`Swarm.DisableNatPortMap`](#swarmdisablenatportmap)
109109
- [`Swarm.EnableHolePunching`](#swarmenableholepunching)
110-
- [`Swarm.EnableAutoRelay`](#swarmenableautorelay)
111110
- [`Swarm.RelayClient`](#swarmrelayclient)
112111
- [`Swarm.RelayClient.Enabled`](#swarmrelayclientenabled)
113112
- [`Swarm.RelayClient.StaticRelays`](#swarmrelayclientstaticrelays)
@@ -122,7 +121,6 @@ config file at runtime.
122121
- [`Swarm.RelayService.MaxReservationsPerPeer`](#swarmrelayservicemaxreservationsperpeer)
123122
- [`Swarm.RelayService.MaxReservationsPerIP`](#swarmrelayservicemaxreservationsperip)
124123
- [`Swarm.RelayService.MaxReservationsPerASN`](#swarmrelayservicemaxreservationsperasn)
125-
- [`Swarm.DisableRelay`](#swarmdisablerelay)
126124
- [`Swarm.EnableAutoNATService`](#swarmenableautonatservice)
127125
- [`Swarm.ConnMgr`](#swarmconnmgr)
128126
- [`Swarm.ConnMgr.Type`](#swarmconnmgrtype)
@@ -1374,7 +1372,9 @@ Type: `flag`
13741372

13751373
### `Swarm.EnableAutoRelay`
13761374

1377-
Removed (V1): Use `Swarm.RelayClient.Enabled` (Relay V2) instead.
1375+
**REMOVED**
1376+
1377+
Use `Swarm.RelayClient.Enabled` (Relay V2) instead.
13781378

13791379
### `Swarm.RelayClient`
13801380

@@ -1520,15 +1520,9 @@ Replaced with [`Swarm.RelayService.Enabled`](#swarmrelayserviceenabled).
15201520

15211521
### `Swarm.DisableRelay`
15221522

1523-
Deprecated: Set `Swarm.Transports.Network.Relay` to `false`.
1524-
1525-
Disables the p2p-circuit relay transport. This will prevent this node from
1526-
connecting to nodes behind relays, or accepting connections from nodes behind
1527-
relays.
1528-
1529-
Default: `false`
1523+
**REMOVED**
15301524

1531-
Type: `bool`
1525+
Set `Swarm.Transports.Network.Relay` to `false` instead.
15321526

15331527
### `Swarm.EnableAutoNATService`
15341528

@@ -1687,8 +1681,9 @@ NATs.
16871681

16881682
See also:
16891683
- Docs: [Libp2p Circuit Relay](https://docs.libp2p.io/concepts/circuit-relay/)
1690-
- [`Swarm.EnableAutoRelay`](#swarmenableautorelay) for getting a public
1691-
`/p2p-circuit` address when behind a firewall.
1684+
- [`Swarm.RelayClient.Enabled`](#swarmrelayclientenabled) for getting a public
1685+
- `/p2p-circuit` address when behind a firewall.
1686+
- [`Swarm.EnableHolePunching`](#swarmenableholepunching) for direct connection upgrade through relay
16921687
- [`Swarm.RelayService.Enabled`](#swarmrelayserviceenabled) for becoming a
16931688
limited relay for other peers
16941689

0 commit comments

Comments
 (0)