Skip to content

Latest commit

 

History

History
115 lines (93 loc) · 3.75 KB

Onboarding.md

File metadata and controls

115 lines (93 loc) · 3.75 KB

ml api adapter Setup


Introduction

In this document we'll walk through the setup for the Mojaloop ml api adapter. It consists of three sections:


Software List

  1. Github
  2. brew
  3. Docker
  4. Postman
  5. nvm
  6. npm
  7. Zenhub
  8. central_ledger
  9. JavaScript IDE

Setup

Make sure you have access to Mojaloop on Github and clone the project.

Installing brew

macOS
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Ubuntu

To install Linuxbrew, follow these instructions

Installing Docker

To install Docker, follow these instructions: Docker for Mac, Docker for Ubuntu

Installing Postman

Please, follow these instructions: Get Postman

Alternatively on Ubuntu you may run:

wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
sudo tar -xzf postman.tar.gz -C /opt
rm postman.tar.gz
sudo ln -s /opt/Postman/Postman /usr/bin/postman
Setup Postman
  • open Postman
  • click Import and then Import File
  • navigate to the central_ledger directory and select postman.json

nvm

If you don't have cURL already installed, on Ubuntu run sudo apt install curl

Download the nvm install script via cURL:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
  • Ensure that nvm was installed correctly with nvm --version, which should return the version of nvm installed
  • Install the version (8.9.4 current LTS) of Node.js you want:
    • Install the latest LTS version with nvm install --lts
    • Use the latest LTS verison with nvm use --lts
    • Install the latest version with nvm install node
    • Use the latest version with nvm use node
    • If necessary, fallback to nvm install 8.9.4 and nvm use 0.33.6
Setup nvm

Create a .bash_profile file with touch ~/.bash_profile, then nano ~/.bash_profile and write:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

npm

By installing node during nvm installation above, you should have the corresponding npm version installed

Installing ZenHub for GitHub

Open Google Chrome browser and navigate to Zenhub Extension

Installing node pre-requisites

  • cd into the ml-api-adapter project and run subsequently the following commands:
npm install -g node-gyp
brew install libtool autoconf automake
npm install
source ~/.bash_profile
npm rebuild

  • run npm start (to run it locally) or npm run dev (to run it on your Docker host)
Run Postman
  • click on ml api adapter and then POST transfer
  • click Send
  • if you get a valid response, you should be ready to go

Errors On Setup

  • sodium v1.2.3 can't compile during npm install
  • Undefined symbols for architecture x86_64: "_CRYPTO_cleanup_all_ex_data", referenced from: _rd_kafka_transport_ssl_term in rdkafka_transport.o "_CRYPTO_num_locks", referenced from: ........ ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
    • resolved by installing openssl brew install openssl and then running: CFLAGS=-I/usr/local/opt/openssl/include LDFLAGS=-L/usr/local/opt/openssl/lib npm install --save node-rdkafka