libplanet icon indicating copy to clipboard operation
libplanet copied to clipboard

PeerDiscoveryException occurs when a new swarm is created.

Open s2quake opened this issue 1 year ago • 0 comments

When a new swarm is created in SwarmOptions and the same BoundPeer is set in StaticPeers and BootstrapOptions.SeedPeers, the following exception is thrown

Libplanet.Net.Protocols.PeerDiscoveryException: All seeds are unreachable.
   at Libplanet.Net.Protocols.KademliaProtocol.BootstrapAsync(IEnumerable`1 bootstrapPeers, Nullable`1 dialTimeout, Int32 depth, CancellationToken cancellationToken)
   at Libplanet.Net.Swarm.BootstrapAsync(IEnumerable`1 seedPeers, Nullable`1 dialTimeout, Int32 searchDepth, CancellationToken cancellationToken)
   at Libplanet.Net.Swarm.BootstrapAsync(CancellationToken cancellationToken)

If only StaticPeers is set, the following exception is thrown.

Libplanet.Net.Protocols.PeerDiscoveryException: No seeds are provided.  If it is intended you should conditionally invoke BootstrapAsync() only when there are seed peers.
   at Libplanet.Net.Protocols.KademliaProtocol.BootstrapAsync(IEnumerable`1 bootstrapPeers, Nullable`1 dialTimeout, Int32 depth, CancellationToken cancellationToken)
   at Libplanet.Net.Swarm.BootstrapAsync(IEnumerable`1 seedPeers, Nullable`1 dialTimeout, Int32 searchDepth, CancellationToken cancellationToken)
   at Libplanet.Net.Swarm.BootstrapAsync(CancellationToken cancellationToken)

However, if only BootstrapOptions.SeedPeers is set, the problem does not occur.

s2quake avatar Nov 12 '24 04:11 s2quake