0

Is there any way to get all full nodes by RPC call?

Afaik full node contains information of other full nodes in the network and was wondering how to request that.

I red the documentation on Bitcoin Core Apis and all I found is getpeerinfo which returns a list of connected nodes but the JSON it gave me seem to not contain that information.

Does anyone know if this data is accessable and how to get it?

2 Answers 2

1

You cannot request this information, because it does not exist.

There is no central registry of nodes, nor do they have identities to begin with. Full nodes do maintain a database of IP addresses of peers they now about, but that is not, and is not intended to be, a comprehensive list of all nodes on the network.

The closest that exists are network crawlers who ask around for IP addresses and try connecting to them (some DNS seed report results based on crawler information), but even that is only an approximation, and can only discover nodes that are reachable. The vast majority of full nodes only make outgoing connections.

1
  • Thanks a lot for this information but i am building my own blockchain from scratch and are wondering how bitcoin calculates 51% of the network if it does not have a list of all peers
    – Noah Bergh
    Feb 6 at 14:55
0

getpeerinfo returns information about currently connected peers, but not the entire network. Since Bitcoin is a decentralised peer-to-peer network, no peer can possibly establish an accurate view of the full network connection graph.

Consider how these peer connections are established which are returned by getpeerinfo. When your node is started, it will bootstrap a list of peer endpoint addresses from known seed servers. Once a sufficient number of addresses is acquired, it begins connections (This address list is actively amended as new addresses are propagated to your node after the seed session).

  • Outbound connections: Up to N peers on address list acquired during the seed session.
  • Inbound connections: Accepts connections from up to M peers connecting to your node
  • Manual connections: Configured permanent peers your node (attempts) to maintain connections to.

There is a configurable limit to all types of connections for your node. In any case, the limited view of the network means your node will never have a full view of the global Bitcoin p2p network.

2
  • Thank you for your answer. What I ment was to call seeders listed here: github.com/bitcoin/bitcoin/blob/… for list of "full nodes" but I still dont know how to request that and even if I manage to get that data from all seeds, will the list contain all "full nodes" or just few.
    – Lucas K.
    Feb 4, 2019 at 18:53
  • 1
    They don’t return a “full list” either.
    – Claris
    Feb 5, 2019 at 2:04

Your Answer

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

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