libplanet
libplanet copied to clipboard
Exp/libp2p
Leaving it as a draft for future reference. While working on this, I have run into several problems:
- Related to
dotnet-libp2p:IRemotePeer.DialAsync<T>()is not properly cancellable. It is impossible to timeout with aCancellationToken.- The implementation of
IServiceProvideruses severalstaticvariables to track services provided. Most notably, the instance ofIProtocolis stored in astaticHashSet<T>. A service of typeTis retrieved only by its type, hence it is impossible to have severalIServiceProviders for multipleITransports for unit testing.
- Related to
libplanet:- The whole
dotnet-libp2pstack is designed to have persistent connection between separate peers. That is, to continuously have a channel open withIRemotePeerobtained viaILocalPeer.DialAsync(). The issue may be with the underlying implementation ofIServiceProvideron thedotnet-libp2pside, but regardless, parallel or subsequent calls to a same peer seem very unreliable.
- The whole