Documentation ¶
Index ¶
- Variables
- func Filter(addrs []ma.Multiaddr) []ma.Multiaddr
- type AutoRelay
- type AutoRelayHost
- type Option
- func WithBackoff(d time.Duration) Option
- func WithBootDelay(d time.Duration) Option
- func WithCircuitV1Support() Option
- func WithDefaultStaticRelays() Option
- func WithMaxAttempts(n int) Option
- func WithMaxCandidates(n int) Option
- func WithMinCandidates(n int) Option
- func WithNumRelays(n int) Option
- func WithPeerSource(peerChan <-chan peer.AddrInfo) Option
- func WithStaticRelays(static []peer.AddrInfo) Option
Constants ¶
This section is empty.
Variables ¶
var DefaultRelays = []string{
"/ip4/147.75.80.110/tcp/4001/p2p/QmbFgm5zan8P6eWWmeyfncR5feYEMPbht5b1FW1C37aQ7y",
"/ip4/147.75.80.110/udp/4001/quic/p2p/QmbFgm5zan8P6eWWmeyfncR5feYEMPbht5b1FW1C37aQ7y",
"/ip4/147.75.195.153/tcp/4001/p2p/QmW9m57aiBDHAkKj9nmFSEn7ZqrcF1fZS4bipsTCHburei",
"/ip4/147.75.195.153/udp/4001/quic/p2p/QmW9m57aiBDHAkKj9nmFSEn7ZqrcF1fZS4bipsTCHburei",
"/ip4/147.75.70.221/tcp/4001/p2p/Qme8g49gm3q4Acp7xWBKg3nAa9fxZ1YmyDJdyGgoG6LsXh",
"/ip4/147.75.70.221/udp/4001/quic/p2p/Qme8g49gm3q4Acp7xWBKg3nAa9fxZ1YmyDJdyGgoG6LsXh",
}
DefaultRelays are the known PL-operated v1 relays; will be decommissioned in 2022.
Functions ¶
Types ¶
type AutoRelayHost ¶
func NewAutoRelayHost ¶
func NewAutoRelayHost(h host.Host, ar *AutoRelay) *AutoRelayHost
func (*AutoRelayHost) Close ¶
func (h *AutoRelayHost) Close() error
type Option ¶
type Option func(*config) error
func WithBackoff ¶ added in v0.19.0
WithBackoff sets the time we wait after failing to obtain a reservation with a candidate.
func WithBootDelay ¶ added in v0.19.0
WithBootDelay set the boot delay for finding relays. We won't attempt any reservation if we've have less than a minimum number of candidates. This prevents us to connect to the "first best" relay, and allows us to carefully select the relay. However, in case we haven't found enough relays after the boot delay, we use what we have.
func WithCircuitV1Support ¶ added in v0.19.0
func WithCircuitV1Support() Option
WithCircuitV1Support enables support for circuit v1 relays.
func WithDefaultStaticRelays ¶
func WithDefaultStaticRelays() Option
func WithMaxAttempts ¶ added in v0.19.0
WithMaxAttempts sets the number of times we attempt to obtain a reservation with a candidate. If we still fail to obtain a reservation, this candidate is dropped.
func WithMaxCandidates ¶ added in v0.19.0
WithMaxCandidates sets the number of relay candidates that we buffer.
func WithMinCandidates ¶ added in v0.19.0
WithMinCandidates sets the minimum number of relay candidates we collect before to get a reservation with any of them (unless we've been running for longer than the boot delay). This is to make sure that we don't just randomly connect to the first candidate that we discover.
func WithNumRelays ¶ added in v0.19.0
WithNumRelays sets the number of relays we strive to obtain reservations with.