Finding my peers network addresses bitcoin

557 Views Asked by At

I'm trying to get all of the current ip addresses for the peers connected to my node. A bit similar to what bitnodes is doing. I can't figure out if there is an API call to be sent from the bitcoind client which returns a list of addresses.

I've read about the getaddr message but have no idea how to send it to the node's peers.

1

There are 1 best solutions below

0
On

You can use the getpeerinfo command, Returns data about each connected node.