* Add ntt protocol tasks for influx
Co-authored-by: walker-16 <agpazos85@gmail.com>
* add ntt stats endpoints to to api
* add summary ntt endpoint
* add ntt chain activity endpoint
* add ntt transfers by time endpoint
* add top ntt transfers by address
* add swagger documentation for ntt enpoints
add changes in api deployment
Co-authored-by: walker-16 <agpazos85@gmail.com>
* add ntt address job and endpoint in api
* modify ntt address job and api
* add ntt address stats job deployment
* add top holder stats
* add ntt top holder stats jobs and deployment
Co-authored-by: walker-16 <agpazos85@gmail.com>
* add doc for ntt top holder endpoint
* add job and refactor api for ntt median metrics
Co-authored-by: ftocal <fert1335@gmail.com>
* Add ntt-median-stats-hourly jobs deployment
Co-authored-by: walker-16 <agpazos85@gmail.com>
* Add middleware for not supported env for ntt endpoints
Co-authored-by: walker-16 <agpazos85@gmail.com>
---------
Co-authored-by: Fernando Torres <fert1335@gmail.com>
Add txHash query parameter in observations endpoint
Add job to add nativeTxHash in observations collection except for solana, aptos and wormchain
Add encoded txHash in obvervations collection
* changes in fly component to send governor status events
* split processor in vaaProcessor and governor processor
* add governor processsor v1
* Add endpoint in tx-tracker to calculate txHash for a vaa id
* fly-event-processor integration with new tx-tracker endpoint and refactor
* Add governor vaas endpoint in api
* api, fix amount data type in governor vaas endpoint
* fly-event-processor normalize emitter and txHash
* fly-event-processor fix nodeGovernorVaa id
* fly-event-processor control array not empty in insert/delete many operation
* add index in nodeGovernorVaas collection by vaaId
* add prometheus metrics
* add tx-tracker url for fly-event-processor deployment
* Add sns attributes into sns messages
Co-authored-by: walker-16 <agpazos85@gmail.com>
* fix governor vaa endpoint empty response
---------
Co-authored-by: Fernando Torres <fert1335@gmail.com>
* refactor to accept multiple sourceChains,targetChains and appIds
* support multiple appIds
* adjust x-chain-activity/tops to also support multiple sourceChains and targetChains
* readapt to multiple sourceChains and targetChains
* add unit-tests
* fix unit-test case names
* add unit-test to validate query construction
* fix docs
* fix length of targetChains
* add 2 new tasks for collecting chain activity every day and hour
* making progress
* change query 2
* add query by month and year
* changes on task
* more changes
* change to 1d
* add 1d
* fix query
* adjust queryies
* change the way the query is executed
* changes on query
* making more progress
* fix per year query
* add a second group of tasks for downsampling
* add app_id
* update swagger docs
* optimize new tasks
* fix W
* fix W
* start using the new measurement
* change endpoint signature
* update endpoint name
* fix indents
* code review changes
* remove unnecessary break
* Add support to scroll in tx-tracker
* Handle duplicated vaa in fly
Co-authored-by: walker-16 <agpazos85@gmail.com>
* Modify tx-tracker and pipeline to support duplicated vaas
Co-authored-by: ftocal <fert1335@gmail.com>
* Add isDuplicated flag in vaas and operations endpoints
Add new endpoint to find duplicated vaas by vaa id
Co-authored-by: walker-16 <agpazos85@gmail.com>
* Add metrics for duplicated vaas
Co-authored-by: walker-16 <agpazos85@gmail.com>
* Update node dependencies in spy
Co-authored-by: walker-16 <agpazos85@gmail.com>
* Fix promethes metrics for missing tx-hash in tx-tracker
Co-authored-by: walker-16 <agpazos85@gmail.com>
---------
Co-authored-by: Agustin Pazos <agpazos85@gmail.com>
* start
add search by chain
change chainId query param handling
change condition
only from chain
change query
add filter by appId
add payload type for operations query
add logs
add log for error in mongodb call
add more logs and recover to find possible panic
change type to float64
add more logs for troubleshooting
add more logs for troubleshooting payloadType query param
add another defer
* change query
* add exclusiveAppId,sourceChain and targetChain
* unify search criteria
* change queryies
* combine query params filters
* change implementation of sourceChain and targetChain
* insert filtering by chain and by appid as stages in aggregation pipeline
* fix appIds matching condition
* move query to a separate pipeline which starts from parsedVAA
* adjust query by appId
* add matching also for standardizedProperties
* change
* try using instead of
* simplify query
* add queryLoggging and remove other parts of the query to troubleshooting
* working
* add index creation
* update swagger docs
* tweak index performance and fix timestamp on parsedVaa collection
* start
add search by chain
change chainId query param handling
change condition
only from chain
change query
add filter by appId
add payload type for operations query
add logs
add log for error in mongodb call
add more logs and recover to find possible panic
change type to float64
add more logs for troubleshooting
add more logs for troubleshooting payloadType query param
add another defer
* change query
* add exclusiveAppId,sourceChain and targetChain
* unify search criteria
* change queryies
* combine query params filters
* change implementation of sourceChain and targetChain
* insert filtering by chain and by appid as stages in aggregation pipeline
* fix appIds matching condition
* move query to a separate pipeline which starts from parsedVAA
* adjust query by appId
* add matching also for standardizedProperties
* change
* try using instead of
* simplify query
* add queryLoggging and remove other parts of the query to troubleshooting
* working
* add index creation
* update swagger docs
* tweak index performance and fix timestamp on parsedVaa collection
* add lookup for globaltransactions
* [Issue:1052] Create job for fetching contributor stats and storing in db
revert unnecessary changes on api/handlers/stats
revert changes in go.mod and go.sum
revert change in go.work
add schedule for contributors stats job
change response parsing order
changes due to draft-pr review
move on with contributors activity implementation
change to every hour
fix typo
change contributor stats implementation to do a single write transaction
normalize to UTC contributors activity timestamp
add cronjob schedule for contributors
[Issue:1052][Part 2] Create endpoint to expose contributors stats and activities (#1123)
* add endpoint for retrieving stats and activity
* remove model.go file and move types to service file
* add unit tests to contributors service
* integrate new contributors controller
* fix more stuff
fix unit-tests
changes due to pr review
fix query
fix unit-tests
fix total_value_secure
move constantes to common pkg
remove extra changes
rename contributor to protocols
finish renames
Changes for deployment
adjust different response types from different protocols contributors
fix controller test
big refactor in activty job and stats job since protocols are returning different formats
api responding fine
remove uneccessary generics
target dbconsts
fix
Delete deploy/common/env/staging-mainnet.env
undo unwanted changes
readd staging-mainnet.env
fix unit-tests
add missing protocols_stats/activity_version
remove property protocols_json
fix JOB_ID env var in protocols-activity.yaml
fix typos in env vars configs
change tu numbers
changes due to own review
add new line
* add swagger docs
### Description
This pull request adds the parameter `toChain` to the endpoint `GET /api/v1/vaas/{emitterChain}/{emitterAddress}`.
Other VAA-related endpoints do not support this parameter.
Additionally, for performance reasons, a composite index must be created in MongoDB: `db.parsedVaa.createIndex({"emitterChain": -1, "emitterAddr": -1, "rawStandardizedProperties.toChain": -1, "indexedAt": -1})`
### Description
This pull request removes two unused fields from the `GlobalTransaction.OriginTx` JSON model:
* `timestamp`: this field is always set to the VAA's timestamp, making it redundant. Moreover, for EVM chains we need one extra RPC node request to get it. So better get rid of it.
* `chainId`: this field is always set to the VAA's emitter chain, making it redundant.
### Summary
This pull request modifies the API service to expose two endpoints for the Wormhole Scan UI:
* `GET /api/v1/transactions`: data needed to render the transactions list page.
* `GET /api/v1/transactions/{chain}/{id}/{sequence}`: data needed to render the transaction detail page.
### Summary
The `api` component was importing and initializing the notional cache, but not using it.
This pull request removes the unnecessary dependency.
### Description
Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/451.
The Wormhole Scan UI needs to provide a link to the emitter address for each VAA.
This pull request adds a field containing decoded emitter addresses in the following endpoints:
* `GET /api/v1/transactions`: field `emitterNativeAddress`
* `GET /api/v1/vaas*`: field `emiterNativeAddr`
* Replace start_time and end_time query parameters with fixed ranges at the endpoint of the chain activity
Add InfluxDB tasks for enpdoint chain-activity for each timeSpan
Add cache for chain-activity endpoint
* Code review updates
### Summary
Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/385
This pull request implements a new endpoint, `GET /api/v1/transactions`, which will be consumed by the wormhole explorer UI.
The endpoint returns a paginated list of transactions, in which each element contains a brief overview of the transaction (ID, txHash, status, etc.).
It exposes offset-based pagination via the parameters `page` and `pageSize`. Also, results can be obtained for a specific address by using the `address` query parameter.
The response model looks like this:
```json
{
"transactions": [
{
"id": "1/5ec18c34b47c63d17ab43b07b9b2319ea5ee2d163bce2e467000174e238c8e7f/12965",
"timestamp": "2023-06-08T19:30:19Z",
"txHash": "a302c4ab2d6b9a6003951d2e91f8fdbb83cfa20f6ffb588b95ef0290aab37066",
"originChain": 1,
"status": "ongoing"
},
{
"id": "22/0000000000000000000000000000000000000000000000000000000000000001/18308",
"timestamp": "2023-06-08T19:17:14Z",
"txHash": "00000000000000000000000000000000000000000000000000000000000047e7",
"originChain": 22,
"destinationAddress": "0x00000000000000000000000067e8a40816a983fbe3294aaebd0cc2391815b86b",
"destinationChain": 5,
"tokenAmount": "0.12",
"usdAmount": "0.12012",
"symbol": "USDC",
"status": "completed"
},
...
]
}
```
### Limitations of the current implementation
1. Doesn't return the total number of results (this may result in a performance issue when we filter by address)
2. Can only filter by receiver address (we don't have sender information in the database yet)
### Summary
This pull request fixes an issue in which all observation-related endpoints were returning results sorted by `id` (https://github.com/wormhole-foundation/wormhole-explorer/issues/358). The expected behavior is to sort results based on descending timestamp order instead.
Also, swagger docs were updated to document this behavior.
### Summary
Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/320
This pull request adds the `24h_messages` field to the response in `GET /api/v1/scorecards`. This field indicates the total number of VAAs emitted in the last 24 hours, including messages from PythNet.
Also, the analytics component has been updated to generate a new metric for this purpose. There is a task that summarizes data every 5 minutes to speed up query times. The data is retained for 24 hours only. For this particular metric, writes to InfluxDB are being batched to improve performance.
### 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`.
### 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")
```
* 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>
### 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.
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`.
### 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.
### Summary
Updating from swaggo v1.8.9 to v1.8.10 caused issues with the generated swagger file.
The issue was solved by moving the handler for `GET /swagger.json` outside the `/doc` directory.