Skip to content

flare-foundation/verifier-indexer-api

Repository files navigation

Flare Logo

Verifier server API implementation

One can run the Verifier API service on three different sources:

  • BTC / testBTC
  • XRP / testXRP
  • DOGE / testDOGE

For the API to function correctly, the service must be connected to the corresponding PostgreSQL database, which is populated using the appropriate indexing solution (e.g., BTC Indexer for BTC API Service).

Local Installation

Make sure you're using the Node version specified in the .nvmrc file. We recommend using nvm to manage your local Node installations. Additionally, ensure that yarn is installed and enabled.

Install the dependencies

$ yarn install

Configuration

Copy .env.example to .env and fill the required configuration.

Running the app

To start app run

# development
$ yarn run start

# watch mode
$ yarn run start:dev

Testing with postgresql dump

Download the database instances from the following links and move them to /e2e_tests/db/:

or simply run

yarn test download

Currently, all databases are from testnets.

Option 1: Running Tests Against a Database Instance

To run all tests across all sources or check code coverage, use the following commands:

yarn test run
yarn test coverage

Option 2: Spinning Up a Database from a Dump and Persisting It

Depending on your source, create a database instance using the following command:

yarn test make_db btc

Once the database is up and running, you can start a local server and manually send requests. For this setup, set the following environment variables to your .env file:

# .env file
DB_DATABASE=db
DB_USERNAME=user
DB_PASSWORD=pass
DB_HOST=127.0.0.1
DB_PORT=8080

Additionally, set the appropriate values for VERIFIER_TYPE and TESTNET:

VERIFIER_TYPE=btc
TESTNET=true

When you're finished, remember to stop the database server with:

yarn test delete_db

About

No description, website, or topics provided.

Resources

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors 6

Languages