terra-money / fcd-classic

Terra ETL + RestFul API Server
https://fcd.terra.dev/swagger
MIT License
63 stars 40 forks source link

Using this as an API? #154

Closed oliverbj closed 2 years ago

oliverbj commented 2 years ago

Hi all!

I am slowly dipping my toes into Terra, and saw this project. I want to built a small website (to learn), where I interact with the Terra blockchain. More specifically, I want to monitor my transactions in a dashboard kind of way.

Can I use this service as an API for that? I.e. submitting GET requests directly?

Example: GET https://fcd.terra.dev/v1/tx/terra.....

Or do I need to fork it, and run the project myself?

tvl83 commented 2 years ago

fcd.terra.dev is available to the public so you can use that. To run fcd yourself it takes a lot of hard drive space. over 150GB to store in the db (as of nov 24th).

I write scripts to retrieve data from the chain and use the public fcd server.

I also plan on running a public mirror for the fcd.

i recommend joining the terra discord for more information. I asked for an SQL dump and they had it available https://columbus-genesis.s3.ap-northeast-1.amazonaws.com/fcd-2021-11-24.dump.gz it's 156GB but would save A LOT of time to pull all the data from the chain. this dump is from Columbus-1.

hanjukim commented 2 years ago

LCD (Light Client Daemon) endpoints: https://lcd.terra.dev/swagger/

If you can find endpoint for your usage in above link, use it as much as possible. LCD interacts with the blockchain directly. Thus, it has most recent states.

Avoid to use FCD as much as possible because this project was designed to provide features those are not provided by LCD. For example, It doesn't have a such feature for querying historical transaction by specific address.

BTW, Here's newer dump of Postgres (don't forget to add ignore errors, if you are not using AWS RDS) https://columbus-genesis.s3.ap-northeast-1.amazonaws.com/fcd-2022-01-07.dump.gz

All FCD endpoints are starting /v1 prefix and list is here: https://fcd.terra.dev/swagger/

tvl83 commented 2 years ago

@hanjukim when I try to download the SQL dump it says access denied

image