getnodeaddresses | Bitcoin

The getnodeaddresses method retrieves known addresses of network peers. This can be particularly useful for new nodes looking to find peers to connect to for initial blockchain synchronization.

👍

Get you own node endpoint today

Start for free and get your app to production levels immediately. No credit card required.

You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • count (optional): The number of addresses to return. Specifying 0 will return all known addresses.

Response

  • result — an array of objects, each representing a known peer address. Each object includes the address, port, services offered by the peer, and the last time the address was seen.
  • error — an object containing an error message if an error occurred, otherwise null.
  • id — an integer representing the ID of the request.

Use case

The getnodeaddresses method is useful for bootstrapping or maintaining a healthy list of peers, ensuring a node has multiple avenues for connecting and synchronizing with the network.

Try the getnodeaddresses RPC method yourself

Language
Click Try It! to start a request and see the response here!