Commit Graph

179 Commits

Author SHA1 Message Date
agodnic a31d59822d
Add definitions to token dictionary (#292)
### 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
2023-05-08 17:51:18 -03:00
walker-16 e2f32c2883
Fix global tx to keep successful status (#294)
* 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>
2023-05-08 12:55:09 -03:00
agodnic d9d49ec919
Add 24h volume to scorecards (#274)
### 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.
2023-05-04 20:17:03 -03:00
walker-16 fd51f0a819
Fix endpoint last-txs to fit portal explorer requirements (#286) 2023-05-03 14:01:55 -03:00
ftocal c0a3ed2ea9
Add moonbean deploy (#284) 2023-05-03 11:05:27 -03:00
walker-16 f79057a375
273 contract watcher fix status for evm standard (#278)
* 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
2023-05-02 16:52:28 -03:00
ftocal 1e87d5f022
Fix status for solana (#277)
Add retry mechanism
2023-05-02 16:44:13 -03:00
agodnic 69ff71d440
Sort the output of `GET /api/v1/vaas` by timestamp (#267)
### 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
2023-04-28 10:18:07 -03:00
walker-16 1ea141ec95
fix pagination in governor notional available endpoint (#272) 2023-04-27 17:31:33 -03:00
walker-16 bae5f06afb
250 governornotionalavailable sending an invalid chainid returns invalid data (#270)
* Check supported chainID in endpoint governor available notional by chain

* check supported chainID in endpoint mx notional available by chainID
2023-04-27 13:56:18 -03:00
walker-16 c0ec64c749
fix moonbeam ratelimit (#269) 2023-04-27 11:17:31 -03:00
walker-16 45af329b56
Add moonbeam to contract-watcher mainent, testnet (#268) 2023-04-27 10:17:43 -03:00
ftocal a381bbdb8f
Fix in solana watcher when api endpoint fails (#266) 2023-04-26 16:58:30 -03:00
walker-16 459f74d3d2
change txhash pipeline retry to 5 (#264) 2023-04-25 17:19:00 -03:00
ftocal 58e2879068
Filter vaa and observation for pyth message in testnet (#263) 2023-04-25 16:23:07 -03:00
agodnic 09870f3d65
[tx-tracker / api] Avoid duplicating data (#256)
### 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`.
2023-04-25 15:34:29 -03:00
walker-16 3ea4603baf
return empty array and not null in 200 empty repsonse governor limit … (#261)
return empty array and not null in 200 empty repsonse governor limit endpoint
2023-04-25 14:50:44 -03:00
ftocal c9bd4e0dbe
Add oasis support to contract watcher (#258) 2023-04-25 14:48:26 -03:00
walker-16 4a49d1f4cd
discard pyth message to get txhash in testnet (#260) 2023-04-25 12:04:47 -03:00
ftocal 4e0c077a63
Add aptos support to contract watcher (#255) 2023-04-24 12:02:19 -03:00
walker-16 f8b631c71f
Add avalanche to contract-watcher (#253) 2023-04-21 18:30:20 -03:00
walker-16 ffeb5927f8
Add notional cache client (#241)
* Add notional cache client

* gracefull shutdown pubsub and distributed cache
2023-04-20 17:02:25 -03:00
agodnic c8aba636e4
[API/ANALYTICS] Scorecards endpoint (#232)
### 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")

```
2023-04-20 16:01:10 -03:00
ftocal 18efc01460
Increase memory resources for contract-watcher (#248)
Increase memory resources for contract-watcher in staging and production environments
2023-04-20 12:54:30 -03:00
walker-16 ce83e1c3a6
Add gracefull shutdown to explorer api (#244) 2023-04-19 14:30:46 -03:00
ftocal 4f438ae188
Add notional asset lookup (#239)
* Add notional job

* fix coingecko integration

* Add deployment for notional jobs

---------

Co-authored-by: Agustin Pazos <agpazos85@gmail.com>
2023-04-18 12:09:31 -03:00
gipsh 3c597917f5
Improve txhash handler (#237)
* txHash separate handler

* remove unused code

* tests

* improve test and fix error

---------

Co-authored-by: gipsh <gipsh@gmail.com>
2023-04-17 10:42:28 -03:00
walker-16 40956d2391
Fix pipeline delpoy (#236) 2023-04-14 14:35:37 -03:00
walker-16 2028277b30
Avoid process pyth message in analytic (#235) 2023-04-14 12:11:47 -03:00
ftocal abf4a690da
Fix: adjust k8s resources limit and request (#234) 2023-04-13 16:35:27 -03:00
walker-16 deff9cd596
Fix empty txhash in vaa (#231)
* Fix empty txhash in vaa

* improve from code review txhash null
2023-04-13 09:59:27 -03:00
agodnic ebbe0ad045
[analytics] Style fixes, remove duplicated code (#230) 2023-04-12 17:51:16 -03:00
agodnic 6fcf8f8270
Add route `GET /api/v1/address/{address}` (#228)
### Summary

This pull request adds the new route `GET /api/v1/address/{address}`, which returns the transactions in which the given address participated.

Examples:
* https://api.staging.wormscan.io/api/v1/address/0x0000000000000000000000001ef2e0219841d1a540d99c432a6eddb75deed1b7
* 000000000040d99c432a6eddb75deed1b7
* 000000000040d99c432a6eddb75deed1b7?page=0&pageSize=2
* 000000000040d99c432a6eddb75deed1b7?page=1&pageSize=2
* https://api.staging.wormscan.io/api/v1/address/1111111111114Sd894pYPPeXjZCDN5Gv8KCzwFGN

Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/222
2023-04-12 15:51:33 -03:00
agodnic 24673d4f31
Optimize tx-tracker backfiller (#220)
### Summary
The backfiller for tx-tracker data was not running as fast as it should. It was optimized it in order to reduce processing times.
2023-04-12 15:46:16 -03:00
walker-16 d009a616c8
Fix contract-watcher terra watcher & set initial block (#227) 2023-04-10 10:13:17 -03:00
agodnic 1f47f887da
[API/TX-TRACKER] Add support for Solana tx hashes (#218)
### 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`
2023-04-05 10:33:28 -03:00
walker-16 a5df48c967
Add start_date, end_date validation controller (#216) 2023-04-04 10:49:27 -03:00
agodnic 2da5719d49
[tx-tracker] Fix issues related to rate limits (#213)
### 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
2023-03-30 12:25:16 -03:00
agodnic d0cf9cc04b
[API] Fix issue in VAA search filters (#211)
### Summary

Searching for VAAs with the `txHash` and the `parsedPayload` parameters simultaneously wasn't working correctly. This commit fixes the problem.

Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/210
2023-03-27 16:14:38 -03:00
agodnic 02ffff93bf
[TX-TRACKER] Add support for Celo (#209)
### Summary
This pull request upgrades the tx-tracker service, adding support for transactions originated in the Celo blockchain.

Tracking issue: #206
2023-03-27 16:14:12 -03:00
ftocal e1298f54ee
logging as json (#208) 2023-03-23 15:36:50 -03:00
agodnic 93427d6dfc
[API] Fix serialization issue in HTTP responses (#204)
### 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}`
2023-03-22 14:18:11 -03:00
agodnic 50547e1140
[API] Fix governor endpoints (#202)
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.
2023-03-22 13:41:11 -03:00
ftocal 32c1361782
fix: use of decimal for huge numbers (#203) 2023-03-22 13:38:43 -03:00
agodnic 29f7900c7d
[API] Accept emitter addresses in Solana format (#200)
### 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)
2023-03-21 16:12:23 -03:00
ftocal cbeeba1681
Fix timestamp and blockNumber for EVM and Solana blochains (#199) 2023-03-21 15:59:40 -03:00
ftocal 5527268969
Fix destinationTx.timestamp type in globalTransactions collection (#198)
fix destinationTx.timestamp type in globalTransactions collection
2023-03-21 11:57:46 -03:00
walker-16 3729014d72
Add terra to contract watcher (#195)
* Add terra to contract watcher

* Add Terra in contract-watcher deploy

---------

Co-authored-by: Fernando Torres <fert1335@gmail.com>
2023-03-20 17:08:00 -03:00
agodnic e5818a9dee
[TX TRACKER] Add backfiller for source transactions (#194)
### Summary

This pull request adds a Kubernetes job that backfills missing data (i.e.: transactions that the tx-tracker service has not processed).
2023-03-20 16:36:19 -03:00
ftocal ff1feea973
Add solana support to contract watcher (#197)
* Add solana support to contract watcher

* Add rate limit to Solana client

* Add Solana in deploy
2023-03-20 15:56:31 -03:00