|
9 | 9 |
|
10 | 10 | config "github.com/libp2p/go-libp2p/config"
|
11 | 11 | bhost "github.com/libp2p/go-libp2p/p2p/host/basic"
|
| 12 | + autorelay "github.com/libp2p/go-libp2p/p2p/host/relay" |
12 | 13 |
|
13 | 14 | circuit "github.com/libp2p/go-libp2p-circuit"
|
14 | 15 | crypto "github.com/libp2p/go-libp2p-crypto"
|
@@ -249,19 +250,15 @@ func EnableAutoRelay() Option {
|
249 | 250 | // discover relays
|
250 | 251 | func StaticRelays(relays []pstore.PeerInfo) Option {
|
251 | 252 | return func(cfg *Config) error {
|
252 |
| - cfg.StaticRelays = relays |
| 253 | + cfg.StaticRelays = append(cfg.StaticRelays, relays...) |
253 | 254 | return nil
|
254 | 255 | }
|
255 | 256 | }
|
256 | 257 |
|
257 |
| -// DefaultRelays configures the static relays to use the known PL-operated relays |
258 |
| -func DefaultRelays() Option { |
| 258 | +// DefaultStaticRelays configures the static relays to use the known PL-operated relays |
| 259 | +func DefaultStaticRelays() Option { |
259 | 260 | return func(cfg *Config) error {
|
260 |
| - for _, addr := range []string{ |
261 |
| - "/ip4/147.75.80.110/tcp/4001/p2p/QmbFgm5zan8P6eWWmeyfncR5feYEMPbht5b1FW1C37aQ7y", |
262 |
| - "/ip4/147.75.195.153/tcp/4001/p2p/QmW9m57aiBDHAkKj9nmFSEn7ZqrcF1fZS4bipsTCHburei", |
263 |
| - "/ip4/147.75.70.221/tcp/4001/p2p/Qme8g49gm3q4Acp7xWBKg3nAa9fxZ1YmyDJdyGgoG6LsXh", |
264 |
| - } { |
| 261 | + for _, addr := range autorelay.DefaultRelays { |
265 | 262 | a, err := ma.NewMultiaddr(addr)
|
266 | 263 | if err != nil {
|
267 | 264 | return err
|
|
0 commit comments