For use with https://github.com/kphed/soshen-oss/tree/extended.
Modifications:
- Broadcast notifications when a row is inserted into the
txs
table (new network transactions) - Update WebSocket logic for compatibility with soshen's node API server application
Icarus, a reference implementation for a lightweight wallet developed by the IOHK Engineering Team. This code base can be used as a point of reference to enable developers to create their own secure light and mobile wallets for Cardano. Icarus is a fully open-source code base that will be the first step in a range of open source initiatives to provide developers with a suite of tools to integrate with Cardano.
Icarus Backend Service will allow wallet users to access blockchain data. For a detailed architecture explanation, please refer to the wiki.
- NodeJS v8.9.4. We recommend nvm to install it
- Postgres as DB engine. For development purposes we suggest using Docker but local installation could be used as well (not both, obviously)
All the environment specific configurations can be found in $PROJ_ROOT/config
folder.
They are loaded using config package.
We recommend using Docker to quickly setup the DB in dev environment:
docker run --name postgres -p 5432:5432 -e POSTGRES_PASSWORD=mysecretpassword -d postgres
And then, to create the db, you need to do:
docker exec -it postgres psql -U postgres;
create database icaruspocbackendservice;
- Clone this repo,
git@github.com:input-output-hk/icaraus-poc-backend-service.git
- Select correct NodeJs version,
nvm use
- Install dependencies,
npm install
- Start the app,
npm run dev
.
In order to run targeting staging DB from local environment, you need to:
- Create a file with the necessary environment variables set. E.g.:
export DB_USER=dbUser
export DB_HOST=dbHost
export DB=dbName
export DB_PASSWORD=password
export DB_PORT=8080
- Import the environment variables in your terminal, e.g:
source ~/path/to/file
(To verify the variables where exported:echo $DB
) - Go to the repository's path
- Execute the following command:
npm run dev
- Flow checks:
npm run flow
- Eslint checks:
npm run eslint
To run unit tests, you just need to run
npm run unit-tests
Integration tests will:
- Create a new DB
- Preload sample data
- Startup the application
- Exercise and assert several endpoints
To do so, before running them, you need to be sure a PostgreSQL db instance is accessible from localhost using the following config:
- Server: localhost
- User: postgres
- Password: mysecretpassword
- Port: 5432
Then, run export NODE_ENV=test; npm run integration-tests
Istanbul will be used to get test coverage. It will execute both unit and integration tests.
To run it, execute npm run coverage
Licensed under the Apache License, Version 2.0