Skip to content
GitHub

Overview

This guide provides an approach for you to deploy and integrate Rafiki on Google Cloud Platform (GCP) using Terraform, Kubernetes, Helm charts, and Argo CD. The reference architecture used in this guide is the Interledger Test Network. For this example we’ll assume you are a digital wallet provider that wants to deploy your wallet application and Rafiki in your Kubernetes cluster.

Before beginning the integration, ensure you have the following:

  • A GCP account with billing enabled
  • The gcloud CLI installed and authenticated
  • Hashicorp Terraform installed
  • A Kubernetes cluster deployed via GKE
  • Helm installed
  • kubectl installed and configured
  • The argocd CLI
  • Domain name for your wallet (required for SSL/TLS certificates)

The deployment follows the Interledger Test Network reference architecture, which includes:

  • GKE Cluster: Managed Kubernetes cluster on GCP
  • Rafiki Services: Core Interledger functionality (Admin API, Auth Service, Backend)
  • PostgreSQL: Database for Rafiki and wallet data
  • Redis: Caching and session management
  • NGINX Ingress: Load balancing and SSL termination
  • Argo CD: GitOps continuous deployment
  • Digital Wallet: Your wallet application integrated with Rafiki
  • GateHub Integration: Payment backend and ledger services

The following diagram illustrates the architecture based on the Interledger Test Network wallet application with GateHub integration:

graph TD
    %% External Services
    Redis[Redis]
    PostgreSQL1[PostgreSQL]
    FreecurrencyAPI[FreecurrencyAPI]
    GateHub[GateHub]
    OpenPayments[Open Payments]
    
    %% Core Rafiki System
    Rafiki[Rafiki]
    AdminAPI[Admin API]
    AuthAPI[Auth API]
    
    %% Wallet Backend Components
    subgraph WalletBackend[Wallet Backend]
        RatesService[Rates Service]
        WebhookService[Webhook Service]
        RafikiIntegration[Rafiki Integration]
        GateHubService[GateHub Service]
        InternalLedger[Internal Ledger System]
        IDPLedgering[IDP & Ledgering]
        NodeJS[Node.js]
        ExpressJS[Express.js]
    end
    
    %% Frontend
    subgraph WalletFrontend[Wallet Frontend]
        NextJS[Next.js]
        React[React]
    end
    
    %% Client
    subgraph ClientDevices[Client]
        Desktop[Desktop]
        Mobile[Mobile]
    end
    
    %% Database for Open Payments
    PostgreSQL2[PostgreSQL]
    
    %% Connections
    Redis --> Rafiki
    PostgreSQL1 --> Rafiki
    
    Rafiki --> AdminAPI
    Rafiki --> AuthAPI
    
    AdminAPI --> WalletBackend
    AuthAPI --> WalletBackend
    
    FreecurrencyAPI --> WalletBackend
    GateHub --> WalletBackend
    
    WalletBackend --> PostgreSQL2
    WalletBackend --> WalletFrontend
    
    OpenPayments --> PostgreSQL2
    OpenPayments --> WalletBackend
    
    WalletFrontend --> ClientDevices
    
    %% Styling
    classDef redisStyle fill:#DC382D,stroke:#333,stroke-width:2px,color:#fff
    classDef postgresStyle fill:#336791,stroke:#333,stroke-width:2px,color:#fff
    classDef rafikiStyle fill:#4ECDC4,stroke:#333,stroke-width:2px,color:#fff
    classDef openPaymentsStyle fill:#00A86B,stroke:#333,stroke-width:2px,color:#fff
    classDef apiStyle fill:#FF69B4,stroke:#333,stroke-width:2px,color:#fff
    classDef walletBackendStyle fill:#E6F3FF,stroke:#333,stroke-width:2px
    classDef frontendStyle fill:#E8F5E8,stroke:#333,stroke-width:2px
    classDef clientStyle fill:#E6E6FA,stroke:#333,stroke-width:2px
    classDef nodeStyle fill:#68A063,stroke:#333,stroke-width:2px,color:#fff
    classDef gatehubStyle fill:#1E3A8A,stroke:#333,stroke-width:2px,color:#fff
    
    class Redis redisStyle
    class PostgreSQL1,PostgreSQL2 postgresStyle
    class Rafiki rafikiStyle
    class OpenPayments openPaymentsStyle
    class AdminAPI,AuthAPI apiStyle
    class WalletBackend walletBackendStyle
    class WalletFrontend frontendStyle
    class ClientDevices clientStyle
    class NodeJS nodeStyle
    class GateHub,GateHubService gatehubStyle
  • Redis: Provides caching and session management for the Rafiki system
  • FreecurrencyAPI: External service providing real-time currency exchange rates
  • GateHub: Payment backend service providing ledger and payment processing capabilities
  • PostgreSQL (Rafiki): Primary database storing Interledger accounts, wallet addresses, and core transaction data
  • PostgreSQL (Open Payments): Dedicated database for Open Payments protocol data and wallet-specific information
  • Rafiki: Core Interledger payment engine handling protocol implementation and payment processing
  • Admin API: GraphQL interface for administrative functions and account management
  • Auth API: Authentication and authorization service implementing Open Payments standards
  • Wallet Backend: Main Node.js/Express application orchestrating wallet functionality
  • Rates Service: Handles currency exchange rate management and calculations
  • Webhook Service: Manages incoming webhook notifications from external services
  • Rafiki Integration: Interface layer for communication with Rafiki services
  • GateHub Service: Integration component for GateHub payment backend
  • Internal Ledger System: Manages internal transaction ledgering and accounting
  • IDP & Ledgering: Identity provider integration and additional ledger management
  • Wallet Frontend: Next.js/React application providing the user interface
  • NGINX Ingress: Routes external traffic to appropriate services based on hostname and path
  • cert-manager: Automatically provisions and manages SSL/TLS certificates
  • Argo CD: GitOps continuous deployment system managing application deployments
  • Monitoring: Prometheus metrics collection and Grafana dashboards for system observability
  1. Configuration variables: Review all variables that need customization for your environment
  2. Secrets management: Set up secure secret generation, storage, and rotation strategies
  3. Infrastructure setup: Deploy GCP infrastructure using Terraform
  4. Rafiki services deployment: Install and configure all services using Helm and Argo CD
  5. Troubleshooting: Verify end-to-end payment flows and resolve common issues