File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import (
1616 "slices"
1717 "strings"
1818 "sync"
19+ "testing"
1920 "time"
2021
2122 "github.com/libp2p/go-libp2p"
@@ -86,8 +87,17 @@ func NewClient(config Config) (Client, error) {
8687 return nil , err
8788 }
8889
89- // Get bootstrap peers from DHT library for DHT bootstrapping
90- bootstrapPeers := dht .GetDefaultBootstrapPeerAddrInfos ()
90+ // Get bootstrap peers based on environment
91+ // Test mode: empty list for fast, isolated tests
92+ // Production: IPFS default bootstrap peers
93+ var bootstrapPeers []peer.AddrInfo
94+ if testing .Testing () {
95+ bootstrapPeers = []peer.AddrInfo {}
96+ clientLogger .Infof ("Test mode detected - using no bootstrap peers (isolated mode)" )
97+ } else {
98+ bootstrapPeers = dht .GetDefaultBootstrapPeerAddrInfos ()
99+ clientLogger .Infof ("Using %d default IPFS bootstrap peers" , len (bootstrapPeers ))
100+ }
91101
92102 // Parse custom relay peers if provided
93103 customRelayPeers := parseRelayPeersFromConfig (config .RelayPeers , clientLogger )
You can’t perform that action at this time.
0 commit comments