This repo is no longer maintained and further development has been moved to a private repository. In case of interest please contact us at adalite@vacuumlabs.com
Also please consider using cardano-graphql or cardano-rosetta instead.
AdaLite Backend Service is based on Project Icarus by IOHK and used by the AdaLite wallet.
All the environment specific configurations can be found in $PROJ_ROOT/config
folder.
They are loaded using config package.
git@github.com:vacuumlabs/adalite-backend-service.git
nvm use
yarn install
yarn build
yarn start
.To start cardano-rest services:
~/docker/.env
and set its variables showed in ~/docker/.example.env
~/docker/mainnet-topology.json.example
and name it mainnet-topology.json
. By editing mainnet-topology.json
, you can add custom relay nodes to your topology.COMPOSE_PROJECT_NAME=<custom_prefix_to_container_names> docker-compose up
Note that this starts adalite-backend-service as well, so you can run docker container stop <adalite-backend-service-container-id>
to stop the backend service running in docker and follow the next steps to start it in console environment.
In order to connect to cardano-rest from local environment, you need to:
~/.env
file with the necessary environment variables set. E.g.:DB_USER=cexplorer
DB_HOST=dbHost
DB=dbName
DB_PASSWORD=password
DB_PORT=5432
SUBMIT_API_URL=<link to your cardano-submit-api>
yarn start
Docker-compose can be used to run postgres, Cardano rest components and the backend service in an isolated environment and to run multiple instances on the same host. In order to start a production instance, you need to:
docker/env.example
, choose an instance name and name it docker/.env.<instance_name>
~/docker/mainnet-topology.json.example
and name it mainnet-topology.json
. By editing mainnet-topology.json
, you can add custom relay nodes to your topology../manage_containers.sh <instance_name> <action>
from within the docker
folder. Available actions are start
- rebuilds and starts the instance, stop
stops the instanceIf you are running the instance for the first time on Ubuntu, you may run into file permission problems, since the volumes will probably be owned by root. To fix this, cd into the instance persistent storage folder ($DATA_PATH
environment variable) and run sudo chown -R 999:999 .
and restart the containers.
A healthcheck script is used to guarantee that the database contains the latest data. If the database stops updating, the backend service will stop responding to requests and a message will be sent to Slack. The following environment variables need to be set:
SLACK_TOKEN=slackToken
SLACK_CHANNEL=slackChannel
yarn flow
yarn eslint
To run unit tests, you just need to run
yarn unit-tests
Integration tests will:
To do so, before running them, you need to be sure a PostgreSQL db instance is accessible from localhost
using the config saved in ~/config/test.js
, which is by default:
Then, run yarn integration-tests
To run both unit and integration tests, execute yarn coverage
Licensed under the Apache License, Version 2.0