3

admin.getPeer in the past returned something like this:

admin.addPeer("enode://cc92c3aff13bb5c81f8c4a172a3847d5c6c6874a0acd607cf37f0e8bbd643d851fe727ce35245bbe22e5fc246e1efe957dd66161924692898d231541307f6d4e@47.104.183.34:36590");

With recent updates it is returning something like this:

admin.addPeer("enode://2640824ef05d35d14b46cab77e814a2b367ae0ab7906b4d3f8aa624bfc3c4705@54.86.13.24:30303");

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

| improve this question | | | | |
1

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.