3

In our dapp, we would like to offer the user to choose from a list of different mainnet nodes, so that latency is low.

Ideally, from the list of BPs the user has voted for.

How to retrieve a list of mainnet nodes (in the web app)?

1
  • Did you have a solution for this issue? Aug 14, 2019 at 10:09

2 Answers 2

2

I know you want a web API for this but the simple thing to do would be to get cleos installed and call it from an AJAX endpoint to run:

cleos -u http://api.eosnewyork.io  system  listproducers

This returns the list of BPs with URLs and then you can just call any of these BP websites with /bp.json to retrieve the API endpoints for that BP.

PS: The cleos call itself require a BP (I used EOSNewYork as an example).

2
  • If you want to know which one is "closest", you can try pinging them to see which of the BPs respond the fastest. Jun 28, 2018 at 21:27
  • Yes, I want a web API and a sever-less app.
    – friedger
    Jul 4, 2018 at 9:32
0

Another way is to use an API that is automatically geo routed based on where you are requesting from (like EOSInfra)

curl -si https://public.eosinfra.io/v1/chain/get_info

The API currently has 40ms latency from my location. Which is a reasonably good latency.

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.