Skip to content

Latest commit

 

History

History
156 lines (108 loc) · 4.56 KB

Onboarding.md

File metadata and controls

156 lines (108 loc) · 4.56 KB

Onboarding

Note: Before completing this guide, make sure you have completed the general onboarding guide in the base mojaloop repository.

Contents

  1. Prerequisites
  2. Service Overview
  3. Installing and Building
  4. Running Locally
  5. Running Inside Docker
  6. Testing
  7. Common Errors/FAQs

1. Prerequisites

If you have followed the general onboarding guide, you should already have the following cli tools installed:

  • brew (macOS), [todo: windows package manager]
  • curl, wget
  • docker + docker-compose
  • node, npm and (optionally) nvm

2. Service Overview

The Account Lookup BC consists of the following packages;

account-lookup-svc HTTP service for Account Lookup BC. README

client-lib Client library types. README

domain-lib Domain library types. README

http-oracle-svc HTTP Oracle Service. README

implementation-lib Account Lookup Infrastructure Library. README

shared-mocks-lib Mock implementation used for testing. README

3. Installing and Building

Firstly, clone your fork of the account-lookup-bc onto your local machine:

git clone https://github.com/<your_username>/account-lookup-bc.git

Then cd into the directory and install the node modules:

cd account-lookup-bc

Install Node version

More information on how to install NVM: https://github.com/nvm-sh/nvm

nvm install
nvm use

Install Dependencies

npm install

Build

npm run build

4. Running Locally (dependencies inside of docker)

In this method, we will run all of the core dependencies inside of docker containers, while running the account-lookup-bc server on your local machine.

Alternatively, you can run the account-lookup-bc inside of docker-compose with the rest of the dependencies to make the setup a little easier: Running Inside Docker.

4.1 Run all back-end dependencies as part of the Docker Compose

Use platform-shared-tools docker-compose files: Follow instructions in the README.md files to run the supporting services. Make sure you have the following services up and running:

This will do the following:

  • docker pull down any dependencies defined in each docker-compose.yml file, and the services.
  • run all of the containers together
  • ensure that all dependencies have started for each services.

4.2 Set Up Environment Variables

# set the MONGO_URL* environment variable (required):
export MONGO_URL=mongodb://root:mongoDbPas42@localhost:27017/";
# set the AUDIT_KEY_FILE_PATH 
export AUDIT_KEY_FILE_PATH=./dist/auditing_cert

See the README.md file on each services for more Environment Variable Configuration options.

4.3 Run the server

npm run start:account-lookup-svc

5. Running Inside Docker

6. Testing

We use npm scripts as a common entrypoint for running the tests. Tests include unit, functional, and integration.

# unit tests:
npm run test:unit

# check test coverage
npm run test:coverage

# integration tests
npm run test:integration

6.1 Testing the account-lookup-bc API with Postman

Here you can find a complete Postman collection, in a json file, ready to be imported to Postman.

7. Common Errors/FAQs