This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Close #187
Removes the
ethcore-network-devp2p
crate and integrates a newsubstrate-libp2p
crate.The API of this crate is exactly the same as devp2p, so the replacement is quite straight-forward.
Once this is merged I would like to refactor a bit the networking API in order to make it less error-prone.
What the code does on the wire is it performs a random Kademlia
FIND_NODE
request every 30 seconds, and tries to open the/substrate/dot/0
protocol with each of the resulting nodes (until we reachmin_peers
, after which it only listens to connections).Consequently, in practice the bootstrap nodes should be used only for Kademlia and not for substrate/dot, unless there are not enough nodes available.
The format of a peer address in libp2p is not
enode://...@...
, but/ip4/1.2.3.4/tcp/10000/p2p/Qm...
(or/ip6/::1/tcp/10000/p2p/Qm...
) where theQm
part is the base56 encoding of a peer ID.NAT traversal "works" in the sense that nodes have knowledge of their external IP and report it. However there is no such thing as UDP hole punching implemented yet.
I will continue to push commits on this branch in order to improve readability and reliability, but you can can start playing with it if you want. Since the change surface is really low, it should be easily rebasable on any other branch.