### Summary
In order to compute volume metrics for each token, we need metadata about the token that is not present in the VAAs (e.g.: decimals, symbol).
That information is statically defined in `common/domain/tokenbridge.go`. This pull request adds the most relevant tokens (i.e.: the tokens that contribute the most volume) to the existing definitions. It is very likely that more token definitions will be added in the future as needed.
The token metadata that was previously defined in the `notional` package (symbols, coingecko IDs) was also moved to `common/domain/tokenbridge.go`.
Tracking issue https://github.com/wormhole-foundation/wormhole-explorer/issues/281
* Fix global tx to keep successful status
Co-authored-by: ftocal <fert1335@gmail.com>
* Increment evm retry from 5 to 10
---------
Co-authored-by: ftocal <fert1335@gmail.com>
### Summary
This pull request adds volume metrics to influxdb. Also, it adds the 24h volume metric to `GET /api/v1/scorecards`.
Tracking issues: https://github.com/wormhole-foundation/wormhole-explorer/issues/221, https://github.com/wormhole-foundation/wormhole-explorer/issues/280
### Changes:
* The `parser` service no longer generates metrics for influxdb. All metrics-related code was removed from that service, that code was moved to the analytics service instead.
* New volume metrics were added to the analytics service.
* The notional cache was modified to use token names (i.e.: ticker symbols) as keys instead of chain IDs.
* The notional cache reader was moved to the `common/client/cache` package.
* A little bit of duplicated code between the cache reader and writer was removed.
* A 24h volume metric was added to `GET /api/v1/scorecards`.
* A dictionary that stores token metadata was added under `common/domain/tokenbridge.go`. More tokens will be added to it in the near future.
* Add client to eth transaction Receipt endpoint
* Only process evm transaction from the contractAddress
* Add function to get Status for evm and evm standard watcher
* Fix unkown status and retry count
### Summary
The output of `GET /api/v1/vaas` was not being correctly sorted. This pull request changes the behavior so that the output will be sorted by the `timestamp` field.
Additionally, duplicated code was removed in the VAA code that handles queries.
Also, there was an unused query parameter `sortBy` which was being exposed but not used. Hence it was removed.
Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/233
### Summary
Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/254
For all chains except Solana, the data in `globalTransactions.sourceTx` was somewhat duplicated, since we already had that data in the `vaas` collection.
This pull request changes the `tx-tracker` service so that no redundant data will be written, and also changes the API to look up the data from the `vaas` collection instead.
The responses from the endpoint `/api/v1/global-tx` will no longer contain the field `originTx.from`.
### Summary
This pull request adds the `GET /api/v1/scorecards` endpoint, which is required by the wormscan frontend.
Most of the fields that this endpoint should return are being omitted because the data is not currently available on the backend. Those fields will be added iteratively as the data becomes available.
The current format of the response is:
```json
{
"total_tx_count": "1300200",
"24h_tx_count": "4200"
}
```
Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/221
## Deployment details
In order to populate the `"total_tx_count"` metric, a task is needed in influxdb:
```
$ cat total-vaa-count.flux
option task = {
name: "Total number of emitted VAAs",
every: 1m
}
from(bucket: "wormhole-explorer")
|> range(start: 2018-01-01T00:00:00Z)
|> filter(fn: (r) => r._measurement == "vaa_count")
|> group(columns: ["_measurement"])
|> set(key: "_measurement", value: "total_vaa_count")
|> count()
|> map(fn: (r) => ({r with _time: now()}))
|> map(fn: (r) => ({r with _field: "total_vaa_count"}))
|> to(bucket: "wormhole-explorer", org: "xlabs")
```
### 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`
### Summary
The tx-tracker service was exceeding node RPC rate limits, which caused it to fail.
This pull request changes the APIs upon which the service depends to avoid the same issue in the future.
Also, the backfiller job has been updated accordingly.
Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/205
### Summary
Several endpoints related to VAAs and observations returned `null` when no results were found.
This commit changes the behavior to return `[]` instead, which is more ergonomic for users.
Endpoints affected:
- `GET /api/v1/observations/:chain`
- `GET /api/v1/observations/:chain/:emitter`
- `GET /api/v1/observations/:chain/:emitter/:sequence`
- `GET /api/v1/observations/:chain/:emitter/:sequence/:signer/:hash`
- `GET /api/v1/vaas/{chain_id}`
- `GET /api/v1/vaas/{chain_id}/{emitter}`
- `GET /api/v1/vaas/{chain_id}/{emitter}/{seq}`
Fix governor endpoints
A few governor endpoints were handling addresses incorrectly,
which resulted in errors.
* `GET /api/v1/governor/config/{governor_address}`
* `GET /api/v1/governor/status/{governor_address}`
This commit fixes the issue and adds doc comments to prevent the
same caveat from happening again in the future.
### Summary
This PR enables passing emitter addresses in Solana format when the `chainId` parameter is set to 1. If `chainId` is set to a different value, the API will expect a regular Wormhole address.
Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/189
### Endpoints affected
- `GET /api/v1/global-tx/{chain_id}/{emitter}/{seq}`
- `GET /api/v1/observations/:chain/:emitter`
- `GET /api/v1/observations/:chain/:emitter/:sequence`
- `GET /api/v1/observations/:chain/:emitter/:sequence/:signer/:hash`
- `GET /api/v1/vaas/{chain_id}/{emitter}`
- `GET /api/v1/vaas/{chain_id}/{emitter}/{seq}`
### Example
These two calls should be equivalent:
- `GET /api/v1/vaas/1/ec7372995d5cc8732397fb0ad35c0121e0eaa90d26f828a534cab54391b3a4f5` (address in Wormhole format)
- `GET /api/v1/vaas/1/Gv1KWf8DT1jKv5pKBmGaTmVszqa56Xn8YGx2Pg7i7qAk` (the same address, in Solana format)