Commit Graph

154 Commits

Author SHA1 Message Date
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
ftocal db3a54270a
fix: use full address (#193) 2023-03-16 15:42:34 -03:00
ftocal bf0a18434c
Update deployment for tx-tracker (#192) 2023-03-16 11:10:54 -03:00
ftocal bc41f7bf7a
fix spy dependencies (#191) 2023-03-16 10:32:39 -03:00
ftocal 824ba3c7f9
Add contract watcher component (#190)
* init contract-watcher

* Add processor and blockain watchers

* Add pagination and save last blocknumber procesed by chain

* Add processing by blocks

* Add contract-watcher deploy manifest

* Add endpoint to get globalTransactions by Id

* Add originTX to get globalTransactionById endpoint

* Add wait time for new blocks

* Add initial block for evm watcher

* Add rate limit for evm watcher

* Handle testnet environment and small fixes

* Update wormhole dependencies

* Fix api documentation for swagger

---------

Co-authored-by: Agustin Pazos <agpazos85@gmail.com>
2023-03-15 16:52:50 -03:00
agodnic 86f1e12f1c
Use a Go workspace (#184)
Use a Go workspace to simplify working with multiple modules at a time.
2023-03-14 17:13:41 -03:00
agodnic 2b50eb5116
[TX TRACKER] Add component that obtains transaction data (#159)
### Summary

This pull request adds a new component under the directory `txtracker`.

This component retrieves information about portal token bridge transfers (i.e.: sender address, receiver address, timestamp), and persists the data in MongoDB.

### Chains supported

The blockhains currently supported are:
* Terra (27% of outgoing transfers)
* Solana (25%)
* BSC (25%)
* Eth (14%)
* Polygon (4%)

The remaining chains will be added iteratively as needed.
2023-03-14 15:49:10 -03:00
ftocal 867f1c2962
[API/PARSER] Chain activity and last transaction endpoints (#175)
* Fix analytic vaa metric and close metric client

* Add analytic component manifest

* Add metrics for cross chain activity endpoint

* Feature/add endpoint get vaa count (#171)

* Add trasaction controller + service

* Init getLastTrx endpoint

* Add endpoint for chain activity

* Add configmap and secrets for influx
Change Dockerfiles to support common library

* Add vaa_count endpoint

* Add cross-chain activity endpoint

* Fix vaa_count endpoint

* Add influx to api-service manifest

* Make response and add docs for chain activity endpoint

* Fix api deploy

* Fix lasl-trx json name

* Fix chain activity endpoint

* Fix doc and endpoint route last-txs

---------

Co-authored-by: Agustin Pazos <agpazos85@gmail.com>
2023-03-07 16:25:42 -03:00
agodnic d51695999a
[FLY] Remove duplicated code (#172)
Remove duplicated constants, use the definitions in the `common` package instead.
2023-03-06 14:36:40 -03:00
agodnic f169af3d37
[FLY] Fix an issue related to `.env` files (#173)
Fix an issue in which fly was not correctly populating the `P2P_NETWORK`
variable from an `.env` file.
2023-03-06 14:36:14 -03:00
agodnic c1dea6ea4d
[PARSER/PIPELINE] Update .gitignore (#174) 2023-03-06 14:35:53 -03:00
agodnic b3ec0bcc9e
[API] Fix pagination in `GET /api/v1/governor/notional/available/{chainId}` (#168)
### Summary

Changes:
* Fix `page` and `pageSize` parameters in `GET /api/v1/governor/notional/available/{chainId}`.
* Sort results by ascending guardian address to enforce deterministic output.

Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/162
2023-03-01 10:44:27 -03:00
walker-16 9ba11aab24
Feataure/add analytic component (#164)
* Add Readme, dockerfile, go module init

* Add config package and main

* Add infrastructure package [health/ready]

* Add common lib

* Add http/queue package

* build healtcheck to influx cloud version

* Add vaa_count metric

* Enable pyth message
2023-02-28 17:58:26 -03:00
agodnic 533b83ad28
[API] Accept additional address formats (#170)
### Summary

Context: https://github.com/wormhole-foundation/wormhole-explorer/issues/154

This PR modifies all endpoints that receive an emitter/guardian address to accept a wider range of formats.
After this pull request, all of these are equivalent:
* `0x000000000000000000000000f890982f9310df57d00f659cf4fd87e65aded8d7`
* `000000000000000000000000f890982f9310df57d00f659cf4fd87e65aded8d7`
* `0xf890982f9310df57d00f659cf4fd87e65aded8d7`
* `f890982f9310df57d00f659cf4fd87e65aded8d7`

### Testing plan
* Added unit tests for the parsing code.
* Tested manually a few of the affected endpoints.
2023-02-28 17:50:23 -03:00
ftocal b1583d5e21
add ingress for api in staging and test environments (#169) 2023-02-28 15:44:45 -03:00
agodnic cd99c446e1
[API] Format governor queries for readability (#167) 2023-02-27 11:32:12 -03:00
agodnic 4cf7577a03
[API] Remove unused query params from swagger docs (#166)
### Summary

* Swagger: remove `sortOrder` query parameter from several endpoints in which it didn't make sense.
* Swagger: remove query params `page` and `pageSize` from endpoints that return a single object.
* Sort the output of `GET /api/v1/governor/config` by ascending id.
* Refactor: remove duplicated code, format code for readability.
2023-02-24 10:47:20 -03:00
agodnic 3e01b42f20
[API] Fix incorrect route in swagger docs (#165)
The API's swagger documentation exposes a route
`GET /api/v1/governor/max_available/:chain`,
but instead it should be
`GET /api/v1/governor/notional/max_available/:chain`.
2023-02-23 16:54:40 -03:00
ftocal 33440225a7
fix guardian healtcheck in fly (#160) 2023-02-16 13:23:50 -03:00
ftocal 1076173cd5
Add deployment for pipeline (#158)
Change deployment for parser

Co-authored-by: walker-16 <agpazos85@gmail.com>
2023-02-16 11:56:10 -03:00
ftocal 27d864d91c
pipeline: new component (#146)
* pipeline: new component consuming mongo watch and publishing to sns topic

* fix: use aws config with role
2023-02-16 11:09:57 -03:00
walker-16 cbb7956f90
Feature/refactor parser to use sns sqs (#148)
* Add README to configurate SNS and subscribe with parser FIFO SQS

* Remove producer and watcher, handler new queue vaa event message
2023-02-16 10:55:54 -03:00
walker-16 e40154bf01
Improve healthcheck process to check guardian heartbeats (#156)
Co-authored-by: ftocal <fert1335@gmail.com>
2023-02-13 17:28:34 -03:00
ftocal a926f3c409
Add https to api in test (#155) 2023-02-13 10:17:19 -03:00
agodnic 4ca0bf1c0e
[API] Several fixes in `GET /api/v1/governor/limit` (#153)
### Summary

Changes to `GET /api/v1/governor/limit`:
* Fix the behavior of the parameters `page` and `pageSize` (which previously were being ignored).
* When no results are found, return an HTTP status code of 200 and set the response to an empty array.
* Remove the `sortOrder` query parameter.

The rationale for removing the `sortOrder` parameter is that sorting chains by ascending/descending chain ID doesn't seem to be a useful operation.
2023-02-10 15:58:10 -03:00
agodnic e85fa82784
[API] Remove redundant checks (#150)
Remove redundant nil checks in `api/handlers/governor/repository.go`.
2023-02-10 15:57:11 -03:00