3

I'm developing a software that will connect to "Electrum Servers", the public servers that is already avaible to use, that same that Electrum Wallet uses. The user will be able to specify a custom host if want, so is possible create a server and use that.

The main question is… How I can find all the Electrum servers? I found this page that list all the servers. How this website got this information?

How can I create something to automatically get the all the Electrum servers? If I want to create a Website/API to provide this information, how I can get it?

3
+50

Electrum has a list of default servers which you can find here: https://github.com/spesmilo/electrum/blob/afa1a4d22a31d23d088c6670e1588eed32f7114d/lib/network.py#L57. However there is no list of all Electrum servers just like there is no list of all Bitcoin nodes. This is because Electrum servers are distributed like Bitcoin nodes and anyone can run one. Electrum has a peer discovery protocol which you can read about here: https://github.com/kyuupichan/electrumx/blob/master/docs/PEER_DISCOVERY.rst. The Electrum servers will connect to each other and ask each other for a list of other Electrum servers each peer knows about. So each Electrum server builds up its own database of other Electrum servers. Then when a client connects, it asks the servers it is connected to for a list of other Electrum servers and the client also builds up its own peer database. The message for getting a list of other Electrum servers is servers.peers.subscribe and you can read about that here: https://github.com/kyuupichan/electrumx/blob/master/docs/PROTOCOL.rst#serverpeerssubscribe

So if you want to find available Electrum servers, you can begin with the default Electrum servers. Then ask each server for a list of other Electrum servers, connect to those, and so on and so forth. You do this to build up a local database of Electrum servers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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