cardano-community / guild-operators

Artifacts and scripts created by Guild operators
https://cardano-community.github.io/guild-operators
MIT License
354 stars 177 forks source link

Is the api.clio.one/htopology API used in TopologyUpdater maintained on GitHub? #784

Closed robinboening closed 3 years ago

robinboening commented 3 years ago

Hey folks 👋

can anyone point me to a GitHub repo for the api.clio.one/htopology API? Its used by the topologyUpdater.sh script hosted in this repository here. https://github.com/cardano-community/guild-operators/blob/alpha/scripts/cnode-helper-scripts/topologyUpdater.sh#L135-L136

I expected the repo for the API to be hosted on the https://github.com/clio-one account, but I didn't find it there.

Not am I only interested in the algorithm how it returns peers but I also believe I found a bug I'd like to report / fix:

The response body contains invalid JSON if you send a request including the customPeers parameter from a (yet) unregistered IP.

Thank you! Robin

gufmar commented 3 years ago

Hello

First thank you for pointing this out. It is already fixed now, and was online for around 24h after I added support for some additional testnets.

For explanation: the topologyUpdater was never intended to run for such a long time and for so many users. the idea was to have a quick hack and time saving solution for the first couple of weeks after shelley mainnet launch (august 2020)

so currently there is no public repository for this. I still await the testdrive and introduction of P2P. But may also think about a complete re-implementation in Python and by using an unlicensed SQL database server.

robinboening commented 3 years ago

Thank you @gufmar, for the fast response and the explanation!

It is already fixed now

Is your fix online already? I still receive the invalid JSON for a request like this one: https://api.clio.one/htopology/v1/fetch/?max=15&magic=234567865&customPeers=1.2.3.4:3001

You'll see the Producers array includes two objects, but the comma is missing.

# https://api.clio.one/htopology/v1/fetch/?max=15&magic=234567865&customPeers=1.2.3.4:3001

{
  "resultcode": "402",
  "datetime":"2021-02-16 23:12:26",
  "clientIp": "x.xxx.xxx.xxx", "iptype": 4,
  "msg": "IP is not (yet) allowed to fetch this list", 
  "Producers": [   { "addr": "1.2.3.4", "port": 3001, "valency": 1 }  { "addr": "relays-new.cardano-mainnet.iohk.io", "port": 3001, "valency": 2, "debug":"default fallback result" } ]
 }
gufmar commented 3 years ago

sorry, I forgot to save, saw it around 10 minutes ago. is now definitively online

robinboening commented 3 years ago

🎉 thank you!

tdiesler commented 3 years ago

Great work - thanks. This is related to https://github.com/input-output-hk/cardano-node/issues/2362