1f47f887da
### Summary This pull request adds the functionality to search for VAAs using Solana tx hashes, e.g.: `GET /api/v1/vaas?txHash=2qnNNBQQQ152sGkQ1Rnq2Kdr48LvdN4oXwnTWyEmJqYYWFusLWxbwhpGS5KTXH1bKKx9gg9BLZMKd3g1cXiy7QMz`. Also, the VAA objects returned by the API now have a new field `nativeTxHash`, which contains the tx hash that generated the VAA in the native format of the emitter chain. Tracking issues: https://github.com/wormhole-foundation/wormhole-explorer/issues/212, https://github.com/wormhole-foundation/wormhole-explorer/issues/214 ### Testing guidelines Endpoints affected: * `GET /api/v1/vaas` now supports Solana tx hashes by using the `?txHash=` query parameter. This search is limited to VAAs created by the portal token bridge. * Some VAAs returned by the API should have a new field `nativeTxHash`. All VAAs related to the portal token bridge should have this field set. * An internal refactoring affected pretty much all routes under `GET /api/v1/vaas*`, which should be re-tested. * In the response of `/api/v1/global-tx/`, the field `originTx.signer` has been renamed to `originTx.from` |
||
---|---|---|
.. | ||
docs | ||
handlers | ||
internal | ||
middleware | ||
response | ||
routes | ||
rpc | ||
types | ||
.gitignore | ||
Dockerfile | ||
Makefile | ||
README.md | ||
go.mod | ||
go.sum | ||
main.go |
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