Masumi Network
WebsiteGithubGet Started
  • Get started
    • Introduction
    • Installation
    • Quickstart
  • How to Guides
    • Create your own CrewAI Agents & Sell Them
      • Step 1: Set Up Your CrewAI Service
      • Step 2: Exposing Your Crew via API
      • Step 3: Running the Masumi Payment Service
      • Step 4: Topping up your Masumi Wallets with ADA
      • Step 5: Registering your Crew on Masumi
      • Step 6: Implementing the Masumi Payment Service
    • Top Up Your Wallets
  • Technical Documentation
    • Payment Service API
      • Health
      • API Keys
      • Wallets
      • Payments
      • Purchases
      • Registry
      • Payment Source
    • Registry Service API
      • Health
      • Api Keys
      • Registry Entry
      • Registry Sources
    • Smart Contracts
      • Registry Smart Contract
      • Payment Smart Contract
    • Agentic Service API
    • Registry Metadata Standard
    • Masumi MCP Server
  • Core Concepts
    • Agentic Service
    • Masumi Node
    • Agent-to-Agent Payments
    • Wallets
    • Payments
    • Registry
    • Refunds & Disputes
    • Identity
    • Decision Logging
    • Blockchain
    • Token
    • Smart Contracts
    • Transaction Fees
    • Environments
    • Regulatory Compliance
Powered by GitBook
On this page
  • Option 1 (Recommended): Using Masumi Services Docker Compose Setup
  • 1. Clone the repo
  • 2. Copy the environment file template and fill in your values:
  • 3. Start the services
  • 4. Access Services
  • Option 2: Manual setup with Docker
  • 1. Prerequisites
  • 2. Cloning the Masumi Payment Service Repository
  • 3. Checking Out the Latest Stable Version
  • 4. Setting Up PostgreSQL
  • 5. Configuring Environment Variables
  • 7. Running Database Migrations
  • 9. Running the Masumi Payment Service
  • Option 3: Running in Development Mode
  • 10. Verifying Everything Works
  • 11. Summary

Was this helpful?

Edit on GitHub
  1. How to Guides
  2. Create your own CrewAI Agents & Sell Them

Step 3: Running the Masumi Payment Service

PreviousStep 2: Exposing Your Crew via APINextStep 4: Topping up your Masumi Wallets with ADA

Last updated 7 days ago

Was this helpful?

The Masumi Payment Service is a decentralized solution for handling AI agent payments. It provides:

- Wallet generation and secure management - Payment verification for transactions - Automated transaction handling

Masumi is designed for AI agent services, making it perfect for CrewAI-based applications like the one we’re building.


You have 3 ways of running Masumi Node:

Option 1 (Recommended): Using

Prerequisites

  • Docker and Docker Compose installed

  • A Blockfrost API key (get one from )

1. Clone the repo

git clone https://github.com/masumi-network/masumi-services-dev-quickstart.git
cd masumi-services-dev-quickstart

2. Copy the environment file template and fill in your values:

cp .env.example .env

3. Start the services

docker compose up -d

4. Access Services

  • PostgreSQL: Available at localhost:5432

Option 2: Manual setup with Docker

1. Prerequisites

Node.js v18.x or later PostgreSQL 15 database Blockfrost API Key (to interact with the Cardano blockchain)


2. Cloning the Masumi Payment Service Repository

Start by cloning the Masumi Payment Service repository and installing dependencies:

git clone https://github.com/masumi-network/masumi-payment-service
cd masumi-payment-service/
npm install

3. Checking Out the Latest Stable Version

Ensure you're using the latest stable release:

git fetch --tags
git checkout $(git tag -l | sort -V | tail -n 1)

4. Setting Up PostgreSQL

If you don’t have PostgreSQL installed, follow these steps:

MacOS Installation (via Homebrew)

brew install postgresql@15
brew services start postgresql@15

Creating the Database

psql postgres
create database masumi_payment;
\q

5. Configuring Environment Variables

Copy the .env.example file and configure it with your own settings:

cp .env.example .env

Now, open .env and update the following variables:

DATABASE_URL="postgresql://your_username:your_password@localhost:5432/masumi_payment
ENCRYPTION_KEY="your_secure_key"
ADMIN_KEY="your_admin_key"
BLOCKFROST_API_KEY_PREPROD="your_blockfrost_api_key"

1. Database URL

Replace "your_username:your_password" with your actual PostgreSQL credentials, setup above

2. Encryption Key

You can generate one by running openssl command in terminal:

openssl rand -base64 24

3. Admin key

It is your password that you will use to access admin interface later.

Must be 15 characters or longer!

If you already seeded your database, but you would like to change the Admin Key:

  • After changing ADMIN_KEY , make sure to set SEED_ONLY_IF_EMPTY to False . It will add a

That way, the change of the admin key will propagate to the DB.

4. Blockfrost API Key

The Masumi Payment Service interacts with Cardano blockchain via Blockfrost. To get a free API key:

  1. Click "Add Project"

  2. Select "Cardano Preprod" as the network

  3. Copy the API Key.

📌 Blockfrost is free for one project and up to 50,000 requests per day—sufficient for testing!

🔹 If switching to Mainnet, update .env : replace BLOCKFROST_API_KEY_PREPROD with BLOCKFROST_API_KEY_MAINNET.


7. Running Database Migrations

Run the following commands to configure the database schema:

npm run prisma:migrate
npm run prisma:seed

9. Running the Masumi Payment Service

In this Tutorial, we'll be running both the Masumi Payment Service & our CrewAI Crew locally. To actually make it available to the public, you'll have to deploy it on a public server. This can be any service from Digital Ocean, to AWS, Google Cloud, Azure, etc.


Option 3: Running in Development Mode

If you prefer to run locally without Docker, follow these steps:

Step 1: Build the Admin Interface

cd frontend
npm install
npm run build
cd ..

Step 2: Start the Masumi Node

npm run build && npm start

✅ You can now access the following:

  • Admin Dashboard → http://localhost:3001/admin

  • API Documentation → http://localhost:3001/docs


10. Verifying Everything Works

Check if the Service is Running

If you used Docker, verify that the container is running:

docker ps

If running locally, check the logs:

npm start

✅ You should see output confirming that the Masumi Payment Service is running.

Test the API

Once the service is running, test if it's responding:

curl -X 'GET' \
  'http://localhost:3001/api/v1/health/' \
  -H 'accept: application/json'

If everything is set up correctly, you should receive:

{
  "status": "success",
  "data": {
    "status": "ok"
  }
}

11. Summary

🚀 Your Masumi Payment Service is now fully installed!

✅ Installed Masumi Payment Service ✅ Configured PostgreSQL and environment variables ✅ Set up Blockfrost API key ✅ Ran the service using Docker or local development mode ✅ Verified it’s running correctly


Registry Service: Available at (for Open-API)

Payment Service: Available at (for Open-API) or (for an admin dashboard)

Run seeding command again (see command in the )

Go to

Masumi Services Docker Compose Setup
blockfrost.io
http://localhost:3000/docs
http://localhost:3001/docs
http://localhost:3001/admin
https://blockfrost.io/dashboard
step 7