Verifier server API implementation
You can run the verifier api service on 3 different sources:
- BTC / testBTC
- XRP / testXRP
- DOGE / testDOGE
For the api to work properly the service must be connected to the appropriate underlying postgresql database that is being filled with the the aproriate indexing solution (BTC indexer -> BTC api service)
Make sure you are using the node version specified in .nvmrc file. We recommend that you use nvm
to manage local node installations. Make sure to use/enable yarn
Install the dependencies
$ yarn install
# development
$ yarn run start
# watch mode
$ yarn run start:dev
# unit tests
$ yarn run test
# e2e tests
$ yarn run test:e2e
# test coverage
$ yarn run test:cov
Get DB instances from some persistent storage, or ask other devs
Move those db dumps to /e2e_tests/db/
set .env, you will need to specify the right value for VERIFIER_TYPE
and TESTNET
variables
for now all dbs are on testnets, so provide TESTNET=true
depending on your source, use the following command (btc example)
yarn test:btc
again depending on your sourrce create db instance
yarn test:make_db:btc
after that db will be available and you can
- run tests against it, to do so use
yarn test:run_tests:btc
- start up local server and make requests by hand
After you are done make sure to stop the db server with
yarn test:delete_db