Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

discv5: implementations list #163

Open
fjl opened this issue Oct 3, 2020 · 5 comments
Open

discv5: implementations list #163

fjl opened this issue Oct 3, 2020 · 5 comments

Comments

@fjl
Copy link
Collaborator

fjl commented Oct 3, 2020

This issue is for collecting links to all implementations.
Please put a comment with a link to the source code.
Please also provide a shell command that will run the discv5 listener.

@fjl
Copy link
Collaborator Author

fjl commented Oct 3, 2020

go-ethereum:

https://github.com/ethereum/go-ethereum/tree/master/p2p/discover

how to run a discv5 node:

go build ./cmd/devp2p
./devp2p discv5 listen -nodekey ... -addr 127.0.0.1:9000

@AgeManning
Copy link
Contributor

rust-discv5:

https://github.com/sigp/discv5

Version 5.1 is currently in a PR at this repository in the version-5.1 branch. Once it interops it will be merged down. Its in between different 5.1 versions currently.

To a run node, which periodically sends FINDNODE requests:

cargo run --example find_nodes -- 127.0.0.1 9001 false

NOTE: This will still bind to 0.0.0.0 but the ENR will display 127.0.0.1. You can set this to your local/external IP to modify the ENR emitted. It will listen on 9001. The final boolean indicates if you want to generate a random node_id. false indicates a fixed hard-coded id for debugging.

@kdeme
Copy link

kdeme commented Oct 5, 2020

nim-eth:

https://github.com/status-im/nim-eth

Version 5.1 is in a PR, branch is discv5-v1: https://github.com/status-im/nim-eth/tree/discv5-v1

You can use the dcli tool to test:

# Install required modules
nimble install
# Build dcli, v5.1
nim c -d:chronicles_log_level:trace -d:release -d:UseDiscv51:true --threads:on eth/p2p/discoveryv5/dcli
# Run it, e.g.
./eth/p2p/discoveryv5/dcli --log-level:debug --nat:extip:127.0.0.1 --bootnode:enr:<base64 encoding of ENR>
# Just ping another node
./eth/p2p/discoveryv5/dcli ping enr:<base64 encoding of ENR>

@pipermerriam
Copy link
Member

ddht

https://github.com/ethereum/ddht/

v5.1 implementation in PR: ethereum/ddht#92

Repository has installation and development setup instructions

@Nashatyrev
Copy link
Member

Nashatyrev commented Oct 7, 2020

Java v5.1 discovery is implemented: https://github.com/Nashatyrev/discovery/tree/feature/v5.1-last-updates-1
(PR pending to merge: Consensys/discovery#76)

To run test instance:

> git clone https://github.com/Nashatyrev/discovery -b feature/v5.1-last-updates-1
> cd discovery
> ./gradlew runTestDiscovery --args="127.0.0.1 9001"

CLI options:

DiscoveryTestServer arguments:
<externalIp> <listenPort> [privateKeySeed] [bootNode1] [bootNode2] ...
Examples:
23.44.56.78 9000
23.44.56.78 9000 5
23.44.56.78 9001 123 -IS4QIrMgVOYuw2mq68f9hFGTlPzJT5pRWIqKTYL93C5xasmfUGUydi2XrjsbxO1MLYGEl1rR5H1iov6gxOyhegW9hYBgmlkgnY0gmlwhLyGRgGJc2VjcDI1NmsxoQPKY0yuDUmstAHYpMa2_oxVtw0RW_QAdpzBQA8yWM0xOIN1ZHCCIyo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants