In this document we'll walk through the setup for the Mojaloop ml api adapter. It consists of three sections:
- Github
- brew
- Docker
- Postman
- nvm
- npm
- Zenhub
- central_ledger
- JavaScript IDE
Make sure you have access to Mojaloop on Github and clone the project.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
To install Linuxbrew, follow these instructions
To install Docker, follow these instructions: Docker for Mac, Docker for Ubuntu
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
- open Postman
- click Import and then Import File
- navigate to the central_ledger directory and select postman.json
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
andnvm use 0.33.6
- Install the latest LTS version with
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
By installing node during nvm installation above, you should have the corresponding npm version installed
Open Google Chrome browser and navigate to Zenhub Extension
- 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) ornpm run dev
(to run it on your Docker host)
- click on ml api adapter and then POST transfer
- click Send
- if you get a valid response, you should be ready to go
- sodium v1.2.3 can't compile during npm install
- resolved by installing v2.0.3
npm install [email protected]
- resolved by installing v2.0.3
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
- resolved by installing openssl