@@ -19,14 +19,11 @@ type SwarmConfig struct {
19
19
// `Transports.Relay` if specified.
20
20
DisableRelay bool `json:",omitempty"`
21
21
22
- // DisableRelayService disables the limited relay (circuit v2 relay).
23
- DisableRelayService bool
24
-
25
- RelayServiceOpts RelayResources
22
+ RelayService RelayService
26
23
27
24
// EnableAutoRelay enables the "auto relay" feature.
28
25
//
29
- // When both EnableAutoRelay and EnableRelayHop are set, this go-ipfs node
26
+ // When both EnableAutoRelay and RelayService.Enabled are set, this go-ipfs node
30
27
// will advertise itself as a public relay. Otherwise it will find and use
31
28
// advertised public relays when it determines that it's not reachable
32
29
// from the public internet.
@@ -39,36 +36,39 @@ type SwarmConfig struct {
39
36
ConnMgr ConnMgr
40
37
}
41
38
42
- // RelayResources configures the resources of the relay.
43
- // For any value set to 0, a reasonable default will be used.
44
- type RelayResources struct {
39
+ // RelayService configures the resources of the circuit v2 relay.
40
+ // For every field a reasonable default will be defined in go-ipfs.
41
+ type RelayService struct {
42
+ // Enables the limited relay (circuit v2 relay).
43
+ Enabled Flag
44
+
45
45
// Limit is the (optional) relayed connection limits.
46
46
Limit RelayLimit
47
47
48
48
// ReservationTTL is the duration of a new (or refreshed reservation).
49
49
ReservationTTL Duration
50
50
51
51
// MaxReservations is the maximum number of active relay slots.
52
- MaxReservations int
52
+ MaxReservations OptionalInteger
53
53
// MaxCircuits is the maximum number of open relay connections for each peer; defaults to 16.
54
- MaxCircuits int
54
+ MaxCircuits OptionalInteger
55
55
// BufferSize is the size of the relayed connection buffers.
56
- BufferSize int
56
+ BufferSize OptionalInteger
57
57
58
58
// MaxReservationsPerPeer is the maximum number of reservations originating from the same peer.
59
- MaxReservationsPerPeer int
59
+ MaxReservationsPerPeer OptionalInteger
60
60
// MaxReservationsPerIP is the maximum number of reservations originating from the same IP address.
61
- MaxReservationsPerIP int
61
+ MaxReservationsPerIP OptionalInteger
62
62
// MaxReservationsPerASN is the maximum number of reservations origination from the same ASN.
63
- MaxReservationsPerASN int
63
+ MaxReservationsPerASN OptionalInteger
64
64
}
65
65
66
66
// RelayLimit are the per relayed connection resource limits.
67
67
type RelayLimit struct {
68
68
// Duration is the time limit before resetting a relayed connection.
69
69
Duration Duration
70
70
// Data is the limit of data relayed (on each direction) before resetting the connection.
71
- Data int64
71
+ Data OptionalInteger
72
72
}
73
73
74
74
type Transports struct {
0 commit comments