Scheme Adapter to Local ML Cluster

A detailed documentation for dfsps who want to test the mojaloop cluster deployment with scheme adapter and a mock backend service.

Prerequisite

  • A working mojaloop k8s cluster (Local / Cloud deployment)

  • DFSP mock backend service

  • sdk-scheme-adapter > 8.6.0

Configuration & Starting services

Mojaloop Local K8S cluster deployment

Please follow the below link to deploy your own cluster on local system. https://mojaloop.io/documentation/deployment-guide/

A Linux based operating system is recommended and at least 16GB RAM and 4 core processor is required.

After installation please complete the OSS-New-Deployment-FSP-Setup.postman_collection collection available at https://github.com/mojaloop/postman

Then make sure the oracles & endpoints are configured correctly and that the "Golden Path Collection" can be run successfully.

DFSP Mock Backend service & SDK Scheme adapter

The SDK scheme adapter version should be greater than 8.6.0 The next step starts the scheme adapter from docker-compose file automatically.

Please download the following repository https://github.com/mojaloop/sdk-mock-dfsp-backend

Edit the docker-compose.yml file and verify the following lines.

Edit the backend.env file and change the OUTBOUND_ENDPOINT value

Edit scheme-adapter.env and change the following lines Please replace the endpoint values with the appropriate hostnames provided in /etc/hosts file.

Name resolution configuration - Mac ONLY

Point the following hostnames to your local machine IP by adding the below line in /etc/hosts file

Make sure to change 192.168.5.101 to your real external IP.

Name resolution configuration - Linux ONLY

Add extra_hosts configuration to scheme-adapter2 config in the docker-compose.yml file, so that the scheme-adapter2 container can resolve dns of account-lookup-service.local, quoting-service.local and ml-api-adapter.local. For example the config could be:

The 172.17.0.1 is a default docker0 network interface on linux, however please make sure it's valid in your configuration and change it if needed.

Start

Start the backend and scheme adapter using the following command.

Testing

Configure new FSP

Download the following files:

The SCHEME_ADAPTER_ENDPOINT in the environment file should point to your local scheme-adapter deployment. For mac this is configured already to be http://host.docker.internal:4000. If you're running on Linux, please edit the environment file, so that SCHEME_ADAPTER_ENDPOINT points to your docker0 interface (usually 172.17.0.1 - see remarks in previous step).

In postman, select the environment file and run the custom collection in the postman to provision a new FSP called "safsp". The endpoints for safsp will be set to the URL of the scheme adapter which is configured in environment file.

Add the target MSISDN to payee simulator which is running inside the K8S. Run the following commands

Try to send money

Try to send funds from "safsp" (Mock DFSP) to a MSISDN which is in "payeedfsp" (Simulator in K8S) through scheme adapter. Run the following curl command to issue command to Mock DFSP service.

You should get a response with COMPLETED currentState.

Last updated

Was this helpful?