wormhole-explorer/api
agodnic c25ebcb6fc
New endpoint: top chain pairs by number of transfers (#307)
### Summary

Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/275

This pull request implements the endpoint `GET /api/v1/top-chain-pairs-by-num-transfers`, which returns the chain pairs that have the most transfers.Internally, the endpoint uses data summarized daily to speed up query execution times.

This endpoint has a mandatory query parameter named timerange, which must be set to `7d`, `15d` or `30d`.
2023-05-12 13:05:18 -03:00
..
docs New endpoint: top chain pairs by number of transfers (#307) 2023-05-12 13:05:18 -03:00
handlers New endpoint: top chain pairs by number of transfers (#307) 2023-05-12 13:05:18 -03:00
internal Add summarization data for tx_count endpoint (#296) 2023-05-10 18:18:32 -03:00
middleware New endpoint: top chain pairs by number of transfers (#307) 2023-05-12 13:05:18 -03:00
response
routes New endpoint: top chain pairs by number of transfers (#307) 2023-05-12 13:05:18 -03:00
rpc
types
.gitignore
Dockerfile
Makefile
README.md
go.mod 250 governornotionalavailable sending an invalid chainid returns invalid data (#270) 2023-04-27 13:56:18 -03:00
go.sum 250 governornotionalavailable sending an invalid chainid returns invalid data (#270) 2023-04-27 13:56:18 -03:00
main.go Add summarization data for tx_count endpoint (#296) 2023-05-10 18:18:32 -03:00

README.md

API

How to build

make build

Config

You will need to set some env variables with the prefix WORMSCAN

  • WORMSCAN_DB_MONGO
  • WORMSCAN_DB_NAME
  • WORMSCAN_PORT

for example:

WORMSCAN_DB_URL=mongodb://localhost:27017/wormhole WORMSCAN_PORT=5555 ./api

API Documentation

Documentation is automagically generated via swaggo using annotations on code and placed inside doc/ folder.

To install swag tool run this

go install github.com/swaggo/swag/cmd/swag@latest

To generate or update the doc run:

make doc