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.
k-rpc-socket | k-rpc | bittorrent-dht | torrent-discovery | webtorrent
This is one of many pull requests across the WebTorrent ecosystem to add IPv6 DHT support, as per webtorrent/bittorrent-dht#88
Per the BEP 32 statement about maintaining distinct IPv4/IPv6 DHTs and the discussion on webtorrent/bittorrent-dht#88, my implementation requires separate instances of
bittorrent-dht
and everything below it on the protocol stack (k-rpc
andk-rpc-socket
).torrent-discovery
maintains up to twoDHT
instances, one for each IP version used. Fortunately, WebTorrent already supports IPv6 peers, so no changes are needed in it beyond properly using the IPv6 DHT, if enabled in the options.The best way to run all of my changes is by using the npm link command. Assuming that all of the necessary modules (
k-rpc-socket
,k-rpc
,bittorrent-dht
,torrent-discovery
,webtorrent
, andwebtorrent-cli
are sibling directories, the following commands will set things up properly (starting from the parent directory):From there, you can test and run individual modules as you choose.
k-rpc specific notes:
As this repository does more than
k-rpc-socket,
this PR is more involve than the k-rpc-socket pr. Like ink-rpc-socket
, I add anipv6
parameter to control if ak-rpc
instance is used forIPv4
orIPv6
. Most of the changes are for implementing the encoding/decoding of IPv6 nodes, as specified in BEP 32. As ink-rpc
, I use a wrapper functions to run the tests withIPv4
andIPv6
rpc instances without duplicating code.Notes:
Caveats: