Mojaloop Deployment

The document is intended for an audience with a stable technical knowledge that would like to setup an environment for development, testing and contributing to the Mojaloop project.

Deployment and Setup

1. Pre-requisites

Take particular care when choosing the software versions, as a miss-match may cause issues or incompatibilities.

A list of the pre-requisite tool set required for the deployment of Mojaloop:

2. Deployment Recommendations

This provides environment resource recommendations with a view of the infrastructure architecture.

Resources Requirements:

3. Kubernetes

If you are installing Kubernetes yourself, then we recommend using one of the following Kubernetes flavours ensuring you install the desired matching version as specified in section 1. Pre-requisites:

  • k3sarrow-up-right - Flexible lightweight Kubernetes distribution that can be used for almost anything, spanning from local to Production grade environments.

  • Minikubearrow-up-right - Simple platform agnostic single-node Kubernetes distribution that is useful for local or development environments.

  • Microk8sarrow-up-right - Simple platform Kubernetes distribution that is useful for local or development environments.

  • Docker Desktoparrow-up-right - Simple platform Kubernetes distribution that is useful for local or development environments (ensure you install applicable version that includes your target Kubernetes version by examining the Docker Desktop release-notesarrow-up-right).

We do not specify a specific distribution of Kubernetes to be used, but rather any distribution of Kubernetes running on a Cloud Native Computing Foundation (CNCF)arrow-up-right certified distribution or managed solution (e.g. Azure, AWS, GCP) should be selected when testing new Mojaloop Releases.

If you are new to Kubernetes it is strongly recommended to familiarize yourself with Kubernetes. Kubernetes Conceptsarrow-up-right is a good place to start and will provide an overview.

Insure kubectl is installed. A complete set of installation instruction are available herearrow-up-right.

3.1. Kubernetes Ingress Controller

Install your preferred Ingress Controller for load-balancing and external access.

Refer to the following documentation to install the Nginx-Ingress Controller used for this guide: https://kubernetes.github.io/ingress-nginx/deploy/#using-helmarrow-up-right.

List of alternative Ingress Controllers: https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/arrow-up-right.

Insure you install a supported Ingress Controller version that matches your target Kubernetes version.

DEPLOYMENT TROUBLESHOOTING - Updated March 2023

3.2. Kubernetes Admin Interfaces (Optional)

  1. Kubernetes Dashboards

    The official Kubernetes Web UI Admin interface.

    Visit the following link for installation instructions (not needed if MicroK8s is installed): Web UI (Dashboard) Installation Instructionsarrow-up-right.

    IMPORTANT: Ensure (not needed if MicroK8s is installed) you configure RBAC roles and create an associated service account, refer to the following example on how to create a sample user for testing purposes only: Creating sample userarrow-up-right.

    If you have installed MicroK8s, enable the MicroK8s dashboard:

    Refer to the following link for more information: Add-on: dashboardarrow-up-right.

    Remember to prefix all kubectl commands with MicroK8s if you opted not to create an alias.

  2. k8sLens

    A local desktop GUI based kubectl alternative which is easy to install and setup.

    Visit the following link for more information: https://k8slens.dev/arrow-up-right.

4. Helm

Please review Mojaloop Helm Chartarrow-up-right to understand the relationships between the deployed Mojaloop helm charts.

Refer to the official documentation on how to install the latest version of Helm: https://helm.sh/docs/intro/install/arrow-up-right.

Refer to the following document if are using Helm v2: Deployment with (Deprecated) Helm v2arrow-up-right.

Refer to the Helm v2 to v3 Migration Guidearrow-up-right if you wish to migrate an existing Helm v2 deployment to v3.

4.1. Helm configuration

  1. Add mojaloop repo to your Helm config:

    If the repo already exists, substitute 'add' with 'apply' in the above command.

  2. Update helm repositories:

5. Mojaloop

5.1. Prerequisite Backend Helm Deployment

Mojaloop has several external backend dependencies.

We recommend deploying these dependencies in a separate named deployment.

This example backend chart is provided purely as an example and should only be used for PoC, development and testing purposes.

Further reading can be found herearrow-up-right.

  1. Deploy backend

5.2. Mojaloop Helm Deployment

  1. Install Mojaloop:

    1.1. Installing latest version:

    Or if you require a customized configuration:

    Further reading can be found herearrow-up-right.

    Note: Download and customize the values.yamlarrow-up-right. Also ensure that you are using the value.yaml (i.e. https://github.com/mojaloop/helm/blob/v<SPECIFIC_VERSION>/mojaloop/values.yaml) from the correct version which can be found via Helm Releasesarrow-up-right. You can confirm the installed version by using the following command: helm --namespace demo list. Under the CHART column, you should see something similar to 'mojaloop-{version}' with {version} being the deployed version.

    Note: The --create-namespace flag is only necessary if the demo namespace does not exist. You can alternatively create it using the following command: kubectl create namespace demo.

    1.2. Version specific installation:

    1.3. List of Mojaloop releases:

5.3. Verifying Ingress Rules

  1. Update your /etc/hosts for local deployment:

    Note: This is only applicable for local deployments, and is not needed if custom DNS or ingress rules are configured in a customized values.yamlarrow-up-right.

    Windows the file can be updated in notepad - need to open with Administrative privileges. File location C:\Windows\System32\drivers\etc\hosts.

    Include the following lines (or alternatively combine them) to the host config.

    The below required config is applicable to Helm release >= versions 6.2.2 for Mojaloop API Services;

  2. Test system health in your browser after installation. This will only work if you have an active helm chart deployment running.

    Note: The examples below are only applicable to a local deployment. The entries should match the DNS values or ingress rules as configured in the values.yamlarrow-up-right or otherwise matching any custom ingress rules configured.

    ml-api-adapter health test: http://ml-api-adapter.local/healtharrow-up-right

    central-ledger health test: http://central-ledger.local/healtharrow-up-right

5.4. Testing Mojaloop

The Mojaloop Testing Toolkitarrow-up-right (TTK) is used for testing deployments, and has been integrated into Helm utilizing its CLI to easily test any Mojaloop deployment.

  1. Validating Mojaloop using Helm

    Or with logs printed to console

    This will automatically execute the following test casesarrow-up-right using the Mojaloop Testing Toolkitarrow-up-right (TTK) CLI:

    Use the following command to view the provisioning Collection logs:

    Use the following command to view the Golden Path Collection logs:

    Example of the finally summary being displayed from the Golden Path test collection log output:

  2. Accessing the Mojaloop Testing Toolkit UI

    Open the following link in a browser: http://testing-toolkit.localarrow-up-right.

    One is able to manually load and execute the Testing Toolkit Collections using the UI which allows one to visually inspect the requests, responses and assertions in more detail. This is a great way to learn more about Mojaloop.

    Refer to the Mojaloop Testing Toolkit Documentationarrow-up-right for more information and guides.

5.5. Testing Mojaloop with Postman

Postmanarrow-up-right can be used as an alternative to the Mojaloop Testing Toolkitarrow-up-right. Refer to the Automated Testing Guidearrow-up-right for more information.

The available Mojaloop Postman Collectionsarrow-up-right are similar to the Mojaloop Testing Toolkit's Test Casesarrow-up-right's as follows:

Pre-requisites:

6. Overlay Services/3PPI

As of R.C. v13.1.0arrow-up-right of Mojaloop, Third Party API is supported and will be published with the official release of Mojaloop v13.1.0. which allows Third Party Payment Initiators (3PPIs) the ability to request an account link from a DFSP and initiate payments on behalf of users.

Learn more about 3PPI:

6.1 Configuring a deployment for Third Party API support

Third Party API support is off by default on the Mojaloop deployment. You can enable it by editing your values.yaml file with the following settings:

In addition, the Third Party API has a number of dependencies that must be deployed manually for the thirdparty services to run. mojaloop/helm/thirdpartyarrow-up-right contains details of these dependencies, and also provides example k8s config files that install these dependencies for you.

Once the helm upgrade has completed, you can verify that the third party services are up and running:

You can also add the following entries to your /etc/hosts file to make it easy to talk to the thirdparty services

6.2 Validating and Testing the Third Party API

Once you have deployed the Third Party services, you need to deploy some simulators that are capable of simulating the Third Party scenarios.

6.2.1 Deploying the Simulators

Once again, you can do this by modifying your values.yaml file, this time under the mojaloop-simulator entry:

The above entry will create 3 new sets of mojaloop simulators:

  1. pisp - a PISP

  2. dfspa - a DFSP that supports the Third Party API

  3. dfspb - a normal DFSP simulator that doesn't support the Third Party API, but can receive payments

6.2.2 Provisioning the Environment

Once the above simulators have been deployed and are up and running, it's time to configure the Mojaloop Hub and simulators so we can test the Third Party API.

Use the Third Party Provisioning Collectionarrow-up-right from the mojaloop/testing-toolkit-test cases to provision the Third Party environment and the simulators you set up in the last step.

6.2.3 Run the Third Party API Test Collection

Once the provisioning steps are completed, you can run the Third Party Test Collectionarrow-up-right to test that the Third Party services are deployed and configured correctly.

Last updated

Was this helpful?