Skip to content

Backend service that collects bridging events for bridging explorer ui

License

LGPL-3.0, Unknown licenses found

Licenses found

LGPL-3.0
LICENSE
Unknown
license-config.json
Notifications You must be signed in to change notification settings

sprintertech/sygma-explorer-indexer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9dfa58b · Oct 23, 2024
Sep 9, 2024
Nov 10, 2022
Apr 5, 2024
Jul 18, 2023
Oct 23, 2024
Apr 5, 2024
Jun 15, 2023
Jan 4, 2024
Jun 15, 2023
Nov 10, 2022
Jun 8, 2023
Sep 16, 2021
Apr 19, 2023
Jan 8, 2024
Oct 4, 2023
Oct 4, 2023
Jan 11, 2024
May 5, 2023
Oct 24, 2023
Oct 4, 2023
Jan 8, 2024
May 5, 2023
Apr 5, 2024
Jan 8, 2024
Jul 18, 2023
Jul 12, 2023
Apr 5, 2024

Repository files navigation

Sygma Explorer Indexer

Table of Contents

Stack

Install

yarn install

Usage

Stub server

You can run stub server that will follow swagger API definition inside swagger.yml by:

yarn start:stub

Stub server will be exposed on localhost:8080. This will also expose Swagger documentation on localhost:80/swagger.

Env definition

This are the env variables that are required:

DATABASE_URL="mongodb://<HOST>:<PORT>/<DATABASE_NAME>?replicaSet=<REPLICA_NAME>&authSource=admin&retryWrites=true&w=majority"
STAGE=""
CHAIN_ANALYSIS_API_KEY=""
CHAIN_ANALYSIS_URL=""
ENVIRONMENT="" # testnet || devnet
RPC_URL_CONFIG="[ { "id": DOMAIN_ID, "endpoint": DOMAIN_ENDPOINT } ]"
COINMARKETCAP_API_KEY=""
COINMARKETCAP_API_URL=""
SNS_REGION=
TOPIC_ARN=
CRON_TIME="* */10 * * * *"
INCIDENT_TIME_MINUTES=45
WARNING_TIME_MINUTES=15
INCIDENT_TEMPLATE_PATH="incidentTemplate.ejs"
WARNING_TEMPLATE_PATH="warningTemplate.ejs"
CACHE_TTL_IN_MINS=5

Running locally

docker compose up

Build

For production build use the command:

yarn build

Testing

For testing use the command:

yarn test

Rerunning price calculations

For running a script that reruns $ price calculations using the CoinMarketCap service use the command:

yarn run fix:price-calculations

Removing duplicates and fix timestamp

This scripts is created for fixing production database entries For removing duplicates and move timestamp from transfer cllection to deposit/execution schema, in .env file define DATABASE_URL env variable, and run the script with command:

yarn run fix:remove-duplicates