admin.getPeer in the past returned something like this:


With recent updates it is returning something like this:


As you can see the new enode is much shorter than the original. Has something changed?

| improve this question | | | | |

A node generates a key known as the nodekey when it first starts up. This is an secp256k1, same as ethereum addresses.

Previously, the enode URI was scheme://pubkey@ip:port. This was recently updated to use scheme://keccak256(pubkey)@ip:port instead.

| improve this answer | | | | |
  • How would we retrieve a properly formatted list of peers similar to what we used to do with the old pubkey? This used to work: admin.getPeers(function(e,r){r.forEach(function(i){console.log('admin.addPeer("enode://'+i.id+'@'+i.network.remoteAddress + '");')})}) I am looking to retrieve a properly formatted list to use with admin.addPeer – rfikki Oct 9 '18 at 14:53
  • geth 1.8.17 contains an enode field in admin.peers which already contains the full admin.addPeer compatible URI – Raghav Sood Oct 9 '18 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.