wormhole-explorer/analytics
agodnic 3c8b28d69f
Fix inconsistencies in analytics-related endpoints (#557)
### Description

Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/535.

This pull request fixes an inconsistency between the endpoints `GET /api/v1/x-chain-activity` and `GET /api/v1/top-chain-pairs-by-num-transfers`.

The inconsistency arose because the endpoints computed the data in slightly different ways.

It was resolved by modifying the `GET /api/v1/top-chain-pairs-by-num-transfers` endpoint to use the same data source as `GET /api/v1/x-chain-activity`.
2023-07-19 15:03:43 -03:00
..
cmd Fix notional error with coingecko and add endpoint to push metrics in… (#551) 2023-07-18 11:33:17 -03:00
coingecko Fix and refactor of analytics (#376) 2023-06-01 16:32:00 -03:00
config Add prometheus metrics in analytics (#488) 2023-07-03 11:51:20 -03:00
consumer Fix and refactor of analytics (#376) 2023-06-01 16:32:00 -03:00
http Fix notional error with coingecko and add endpoint to push metrics in… (#551) 2023-07-18 11:33:17 -03:00
internal/metrics Add prometheus metrics in analytics (#488) 2023-07-03 11:51:20 -03:00
metric Add prometheus metrics in analytics (#488) 2023-07-03 11:51:20 -03:00
parser Fix and refactor of analytics (#376) 2023-06-01 16:32:00 -03:00
prices Fix and refactor of analytics (#376) 2023-06-01 16:32:00 -03:00
queue Fix and refactor of analytics (#376) 2023-06-01 16:32:00 -03:00
scripts Fix inconsistencies in analytics-related endpoints (#557) 2023-07-19 15:03:43 -03:00
support Fix and refactor of analytics (#376) 2023-06-01 16:32:00 -03:00
.env.example Fix and refactor of analytics (#376) 2023-06-01 16:32:00 -03:00
.gitignore Fix and refactor of analytics (#376) 2023-06-01 16:32:00 -03:00
Dockerfile Fix and refactor of analytics (#376) 2023-06-01 16:32:00 -03:00
Makefile Fix and refactor of analytics (#376) 2023-06-01 16:32:00 -03:00
README.md Fix and refactor of analytics (#376) 2023-06-01 16:32:00 -03:00
go.mod Add prometheus metrics in analytics (#488) 2023-07-03 11:51:20 -03:00
go.sum Add prometheus metrics in analytics (#488) 2023-07-03 11:51:20 -03:00

README.md

Config sns topic

aws --profile localstack --endpoint-url=http://localhost:4566 sns create-topic --name vaas-pipeline.fifo --attributes FifoTopic=true,ContentBasedDeduplication=false

Config SQS FIFO with dead letter queue localstack

aws --profile localstack --endpoint-url=http://localhost:4566 sqs create-queue --queue-name=wormhole-vaa-analytic-dlq-queue.fifo --attributes "FifoQueue=true"

aws --profile localstack --endpoint-url=http://localhost:4566 sqs create-queue --queue-name=wormhole-vaa-analytic-queue.fifo --attributes FifoQueue=true,MessageRetentionPeriod=3600,ReceiveMessageWaitTimeSeconds=5,VisibilityTimeout=20,RedrivePolicy=""{\"deadLetterTargetArn\":\"arn:aws:sqs:us-east-1:000000000000:wormhole-vaa-analytic-dlq-queue.fifo\",\"maxReceiveCount\":\"2\"}""

Subscribe SQS FIFO to vaas-pipeline.fifo topic

aws --profile localstack --endpoint-url=http://localhost:4566 sns subscribe --topic-arn arn:aws:sns:us-east-1:000000000000:vaas-pipeline.fifo --protocol sqs --notification-endpoint http://localhost:4566/000000000000/wormhole-vaa-analytic-queue.fifo

Check message in the dead letter queue localstack

aws --profile localstack --endpoint-url=http://localhost:4566 sqs receive-message --queue-url=http://localhost:4566/000000000000/wormhole-vaa-analytic-dlq-queue.fifo