autorelay: remove the default static relay option (#1867)

These relays were decomissioned recently.
This commit is contained in:
Marten Seemann 2022-11-11 07:30:49 +00:00 committed by GitHub
parent 8a43c6b1ae
commit bdb840fba2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 41 deletions

View File

@ -314,20 +314,6 @@ func StaticRelays(relays []peer.AddrInfo) Option {
}
}
// DefaultStaticRelays configures the static relays to use the known PL-operated relays.
// Deprecated: pass autorelay.WithDefaultStaticRelays to EnableAutoRelay.
func DefaultStaticRelays() Option {
relays := make([]peer.AddrInfo, 0, len(autorelay.DefaultRelays))
for _, addr := range autorelay.DefaultRelays {
pi, err := peer.AddrInfoFromString(addr)
if err != nil {
panic(fmt.Sprintf("failed to initialize default static relays: %s", err))
}
relays = append(relays, *pi)
}
return StaticRelays(relays)
}
// ForceReachabilityPublic overrides automatic reachability detection in the AutoNAT subsystem,
// forcing the local node to believe it is reachable externally.
func ForceReachabilityPublic() Option {

View File

@ -3,7 +3,6 @@ package autorelay
import (
"context"
"errors"
"fmt"
"time"
"github.com/libp2p/go-libp2p/core/peer"
@ -49,28 +48,6 @@ var (
errStaticRelaysPeerSource = errors.New("cannot use WithPeerSource and WithStaticRelays")
)
// DefaultRelays are the known PL-operated v1 relays; will be decommissioned in 2022.
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",
}
var defaultStaticRelays []peer.AddrInfo
func init() {
for _, s := range DefaultRelays {
pi, err := peer.AddrInfoFromString(s)
if err != nil {
panic(fmt.Sprintf("failed to initialize default static relays: %s", err))
}
defaultStaticRelays = append(defaultStaticRelays, *pi)
}
}
type Option func(*config) error
func WithStaticRelays(static []peer.AddrInfo) Option {
@ -90,10 +67,6 @@ func WithStaticRelays(static []peer.AddrInfo) Option {
}
}
func WithDefaultStaticRelays() Option {
return WithStaticRelays(defaultStaticRelays)
}
// WithPeerSource defines a callback for AutoRelay to query for more relay candidates.
// AutoRelay will call this function when it needs new candidates is connected to the desired number of
// relays, and it has enough candidates (in case we get disconnected from one of the relays).