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).
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 installCopy .env.example to .env and fill the required configuration.
To start app run
# development
$ yarn run start
# watch mode
$ yarn run start:devDownload the database instances from the following links and move them to /e2e_tests/db/:
- BTC Testnet Database as
db_btc_testnet - BTC2 Testnet Database as
db_btc2_testnet - DOGE Testnet Database as
db_doge_testnet - XRP Testnet Database as
db_xrp_testnet - XRP2 Testnet Database as
db_xrp2_testnet
or simply run
yarn test downloadCurrently, all databases are from testnets.
To run all tests across all sources or check code coverage, use the following commands:
yarn test run
yarn test coverageDepending on your source, create a database instance using the following command:
yarn test make_db btcOnce 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=8080Additionally, set the appropriate values for VERIFIER_TYPE and TESTNET:
VERIFIER_TYPE=btc
TESTNET=trueWhen you're finished, remember to stop the database server with:
yarn test delete_db