5

I need to know my node's peer identity to use it as a boot node. Didn't start the node with --node-key. Also, the node has been running for so long that I can no longer access the startup logs containing 2021-03-10 17:34:27 🏷 Local node identity is: 12D3KooWEyopp.... Is there any other way to obtain my node's peer identity?

2 Answers 2

5

you can query the local peerId through an rpc call. For example using polkadotjs

Example screenshot

Thanks!

2

If you want to use the command line...

curl -sS -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "system_localPeerId"}' http://localhost:${port}/

Replace ${port} with your --ws-port value.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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