Open twoeths opened 3 years ago
Using this
const keypair = createKeypairFromPeerId(conn.remotePeer);
const nodeIdValue = nodeId(keypair.publicKey);
const enr = network.discv5?.getKadValue(nodeIdValue);
if (enr) {
enrStr = enr.encodeTxt();
}
I can only find enr of 1 per 10-15 peers. I guess one of the reasons is not all peers go through discv5, they could come from libp2p. @wemeetagain are there any apis to request enr of these peers somehow?
If we know that the peer is running discv5 (and we know which port), we can issue a discv5 PING to the peer, then the PONG will include their ENR.
Currently, there is no foolproof way to retrieve a peer's ENR from their peer-id+ip+tcp since we don't know their discovery port. We would need something like https://github.com/ethereum/consensus-specs/pull/3861
Describe the bug
enr field is empty when I issue this curl
Expected behavior
enr should have some value inside like in the api spec https://ethereum.github.io/beacon-APIs/#/Node/getPeer