ain icon indicating copy to clipboard operation
ain copied to clipboard

mainnet-api.defichain.io not delivering up-to-date data since Fort Canning

Open DerFuchs opened this issue 3 years ago • 3 comments

Hey 👋

I don't know where to put that, so making a bug report seems to be the most appropriate way.

I am the developer of DeFiChain Masternode Monitor. The software depends heavily on the "old" API. Since there's no documentation for Ocean, I decided to not make the transition to it. So, the software keeps requesting most of its data from the vanilla API. This API is kind of broken since Fort Canning.

What happened:

The API under https://mainnet-api.defichain.io still delivers data - But at least some of the endpoints do not deliver updated data anymore since Fort Canning took place some days ago.

Example:

https://mainnet-api.defichain.io/api/DFI/mainnet/address/8Ht3oDDj2uHeoae3mKALM6kVmsuJaj3SSm/txs https://mainnet-api.defichain.io/api/DFI/mainnet/address/8Ht3oDDj2uHeoae3mKALM6kVmsuJaj3SSm/balance

That's a master node's collateral address, which keeps receiving block rewards. Neither the TXS, nor the balance delivers data younger than Fort Canning has started.

This means that currently 184 people running 384 master nodes wonder why they keep receiving block rewards but can't see them in MaMon. And there are other projects, using this API, too.

What you expected to happen:

I expect to receive up-to-date data. 🥴

How to reproduce it (as minimally and precisely as possible):

https://mainnet-api.defichain.io/api/DFI/mainnet/address/8Ht3oDDj2uHeoae3mKALM6kVmsuJaj3SSm/txs vs. https://ocean.defichain.com/v0/mainnet/address/8Ht3oDDj2uHeoae3mKALM6kVmsuJaj3SSm/transactions

I don't know which endpoints are also affected. Maybe all because some services aren't running anymore.

Anything else we need to know?:

Please (PLEASE!) provide a documentation for Ocean ASAP. I'd like to transition to that system, but not knowing endpoints and parameters forces me to reverse-engineer that thing by sniffing packages from apps and checking how defiscan.live implemented it. But that's very ugly, TBH. I've been talking to some other community devs and all of them are becoming more and more frustrated by this.

Thank you in advance :)

DerFuchs avatar Nov 17 '21 10:11 DerFuchs

@DerFuchs: Thanks for opening an issue, it is currently awaiting triage.

The triage/accepted label can be added by foundation members by writing /triage accepted in a comment.

Details

I am a bot created to help the DeFiCh developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the DeFiCh/oss-governance-bot repository.

defichain-bot avatar Nov 17 '21 10:11 defichain-bot

Hey @DerFuchs 👋, it's truly disheartening to see this bug report

For months, the team was preparing to deprecate "explorer.defichain.com" and the entire subsystems that power it. The legacy subsystem "https://mainnet-api.defichain.io" was to our knowledge; an internal API that was never meant to be released as an API for external use.

I guess we were so very wrong, didn't mean to cause the disruption to your service. The legacy systems (old APIs) were a huge bottleneck on our development capability, we had to move away from it quickly or death by a thousand cuts from maintaining it.

After seeing this, I quickly wrote the usage documentation for Ocean REST API and published it https://jellyfish.defichain.com/ocean/

There are 13 unique categories with 40+ endpoints, I documented the 3 use cases you had mentioned above https://jellyfish.defichain.com/ocean/address

Are you using JavaScript or TypeScript by any chance? We had always published to npm a richly typed API Client with tests, JSDocs, and examples for Ocean REST API. The API project is open source with the endpoints and parameters explicitly labeled.

  • https://www.npmjs.com/package/@defichain/whale-api-client
  • https://github.com/DeFiCh/whale/tree/main/packages/whale-api-client/src/api
  • https://github.com/DeFiCh/whale/tree/main/packages/whale-api-client/src/api/address.ts
  • https://github.com/DeFiCh/whale/blob/main/packages/whale-api-client/tests/api/address.test.ts

If this is not sufficient, I am happy to add more documentation at your request.

fuxingloh avatar Nov 19 '21 02:11 fuxingloh

@fuxingloh You're a hero! Thank you. I'll have a look on that and tell you what else I need to make the transition to ocean.

I totally understand that you want that old glitter to go away. And I want to transition to ocean :D

Typescript: MaMon is using Vanilla JS, wrapped in Vue.js. So, maybe I can use whale as a library. That would be very awesome. I'll have a look on that, too!

DerFuchs avatar Nov 19 '21 15:11 DerFuchs