Add IPv6 DHT support#5
Open
Aaron1011 wants to merge 9 commits intomafintosh:masterfrom
Open
Conversation
This was referenced Oct 17, 2016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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-dhtand everything below it on the protocol stack (k-rpcandk-rpc-socket).torrent-discoverymaintains up to twoDHTinstances, 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-cliare 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 anipv6parameter to control if ak-rpcinstance is used forIPv4orIPv6. 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 withIPv4andIPv6rpc instances without duplicating code.Notes:
Caveats: