Skip to content

Commit

Permalink
go-ipfs-config: Merge pull request ipfs#154 from ipfs/static-relays
Browse files Browse the repository at this point in the history
improve AutoRelay configuration, add config option for static relays
  • Loading branch information
aschmahmann authored Nov 15, 2021
2 parents d226879 + aefce5a commit 1b4502c
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions config/swarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,16 @@ type SwarmConfig struct {
// EnableAutoRelay enables the "auto relay user" feature.
// Node will find and use advertised public relays when it determines that
// it's not reachable from the public internet.
EnableAutoRelay bool
//
// Deprecated: This flag is deprecated and is overriden by
// `Swarm.AutoRelay.Enabled` if specified.
EnableAutoRelay bool `json:",omitempty"`

// RelayClient controls the client side of "auto relay" feature.
// When enabled, the node will use relays if it is not publicly reachable.
RelayClient RelayClient

// RelayService.* controls the "auto relay service" feature.
// RelayService.* controls the "relay service".
// When enabled, node will provide a limited relay service to other peers.
RelayService RelayService

Expand All @@ -35,10 +42,20 @@ type SwarmConfig struct {
ConnMgr ConnMgr
}

type RelayClient struct {
// Enables the auto relay feature: will use relays if it is not publicly reachable.
Enabled Flag `json:",omitempty"`

// StaticRelays configures static relays to use when this node is not
// publicly reachable. If set, auto relay will not try to find any
// other relay servers.
StaticRelays []string `json:",omitempty"`
}

// RelayService configures the resources of the circuit v2 relay.
// For every field a reasonable default will be defined in go-ipfs.
type RelayService struct {
// Enables the limited relay (circuit v2 relay).
// Enables the limited relay service for other peers (circuit v2 relay).
Enabled Flag `json:",omitempty"`

// ConnectionDurationLimit is the time limit before resetting a relayed connection.
Expand Down

0 comments on commit 1b4502c

Please sign in to comment.