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

cmd/devp2p: add more nodekey commands #26129

Merged
merged 2 commits into from
Nov 8, 2022

Conversation

fjl
Copy link
Contributor

@fjl fjl commented Nov 7, 2022

This adds two new commands which turn a node key file into a signed ENR or simply print the node ID.

Example:

$ ./devp2p key to-id node1.key
b6eb0af089fc125d0f48746c938231c15e4737a72327194a7e351e42f60a54fc

$ ./devp2p key to-enr -ip 1.2.3.4 -udp 30304 node1.key 
enr:-Iu4QAUG3OoCOHQQ3Qe5XA8tuEPgyRg7xTTsLtG5SIThHgeXPa0ktpnrTE-gFXNYgOOUuUkWVpTqW-oqvzduUwGAwyCAgmlkgnY0gmlwhAECAwSJc2VjcDI1NmsxoQOWEd6Hlr9gtrdtEGeiSm5jXhFUyief-z5eG1FYgp4yAYN0Y3CCdl-DdWRwgnZg

$ ./devp2p enrdump enr:-Iu4QAUG3OoCOHQQ3Qe5XA8tuEPgyRg7xTTsLtG5SIThHgeXPa0ktpnrTE-gFXNYgOOUuUkWVpTqW-oqvzduUwGAwyCAgmlkgnY0gmlwhAECAwSJc2VjcDI1NmsxoQOWEd6Hlr9gtrdtEGeiSm5jXhFUyief-z5eG1FYgp4yAYN0Y3CCdl-DdWRwgnZg
Node ID: b6eb0af089fc125d0f48746c938231c15e4737a72327194a7e351e42f60a54fc
URLv4:   enode://9611de8796bf60b6b76d1067a24a6e635e1154ca279ffb3e5e1b5158829e320179377f420a9817f322a623b29f750c1a52586209de3da6aea668f0c4bf4a8569@1.2.3.4:30303?discport=30304
Record has sequence number 0 and 5 key/value pairs.
  "id"        "v4"
  "ip"        1.2.3.4
  "secp256k1" a1039611de8796bf60b6b76d1067a24a6e635e1154ca279ffb3e5e1b5158829e3201
  "tcp"       30303
  "udp"       30304

@fjl fjl added this to the 1.11.0 milestone Nov 7, 2022
Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fjl fjl merged commit 9139734 into ethereum:master Nov 8, 2022
shekhirin pushed a commit to shekhirin/go-ethereum that referenced this pull request Jun 6, 2023
This adds new commands to turn a node key file into signed ENR / node ID.
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

Successfully merging this pull request may close these issues.

2 participants