{
  "manifest_version": "1.0.0",
  "template": {
    "id": "ad5246be-ab00-405a-8a92-d6463debfc14",
    "slug": "masumi-payment-service-official",
    "name": "Masumi Payment Service Official",
    "description": "Deploy Masumi Payment Service for blockchain-based AI agent payments",
    "url": "https://railway.com/deploy/masumi-payment-service-official",
    "upstream": {
      "repo_url": "https://github.com/masumi-network/masumi-payment-service"
    }
  },
  "services": [
    {
      "name": "masumi-psql-database",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:16"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "masumi-payment-service",
      "source": {
        "repo": "https://github.com/masumi-network/masumi-payment-service"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "masumi-psql-database",
      "description": "will be propagated by Railway",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "masumi-psql-database",
      "description": "will be propagated by Railway",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "masumi-psql-database",
      "description": "default: 5432",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "masumi-psql-database",
      "description": "will be propagated by Railway",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "masumi-psql-database",
      "description": "will be propagated by Railway",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "masumi-psql-database",
      "description": "will be propagated by Railway",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "masumi-psql-database",
      "description": "should auto-create a database required for Masumi Payment Service",
      "secret": false,
      "strategy": "default",
      "default": "masumi_payment"
    },
    {
      "key": "DATABASE_URL",
      "service": "masumi-psql-database",
      "description": "will be propagated by Railway",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "masumi-psql-database",
      "description": "default: postgres",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "masumi-psql-database",
      "description": "default: 820",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "masumi-psql-database",
      "description": "will be propagated by Railway",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "masumi-psql-database",
      "description": "will be propagated by Railway",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "masumi-psql-database",
      "description": "Provide a value for RAILWAY_DEPLOYMENT_DRAINING_SECONDS.",
      "secret": false,
      "strategy": "default",
      "default": "60"
    },
    {
      "key": "PORT",
      "service": "masumi-payment-service",
      "description": "The port to run the server on (default is 3001)",
      "secret": false,
      "strategy": "default",
      "default": "3001"
    },
    {
      "key": "ADMIN_KEY",
      "service": "masumi-payment-service",
      "description": "The key of the admin user, this key will have all permissions, like doing payments, changing configurations and can also be used to create new (more limited) api_keys",
      "secret": true,
      "strategy": "default",
      "default": "very_secure_long_and_strong_admin_key"
    },
    {
      "key": "DATABASE_URL",
      "service": "masumi-payment-service",
      "description": "you will be able to retrieve this URL after you create masumi_payment database in your postgreSQL instance on Railway",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "ENCRYPTION_KEY",
      "service": "masumi-payment-service",
      "description": "This is a secret key used to encrypt the sensitive wallet secrets in the database. Please change this to a secure string of at least 32 characters.",
      "secret": true,
      "strategy": "default",
      "default": "12345678901234567890123456789012"
    },
    {
      "key": "CHECK_TX_INTERVAL",
      "service": "masumi-payment-service",
      "description": "delay in seconds for checking payment every 3 minutes",
      "secret": false,
      "strategy": "default",
      "default": "180"
    },
    {
      "key": "SEED_ONLY_IF_EMPTY",
      "service": "masumi-payment-service",
      "description": "Will skip seeding if there are entries in the db",
      "secret": false,
      "strategy": "default",
      "default": "True"
    },
    {
      "key": "BATCH_PAYMENT_INTERVAL",
      "service": "masumi-payment-service",
      "description": "delay in seconds for batching requests every 4 minutes",
      "secret": false,
      "strategy": "default",
      "default": "240"
    },
    {
      "key": "REGISTER_AGENT_INTERVAL",
      "service": "masumi-payment-service",
      "description": "delay in seconds for registering agent every 5 minutes",
      "secret": false,
      "strategy": "default",
      "default": "300"
    },
    {
      "key": "CHECK_COLLECTION_INTERVAL",
      "service": "masumi-payment-service",
      "description": "delay in seconds for checking collection every 5 minutes",
      "secret": false,
      "strategy": "default",
      "default": "300"
    },
    {
      "key": "CHECK_SET_REFUND_INTERVAL",
      "service": "masumi-payment-service",
      "description": "delay in seconds for checking set refund every 5 minutes",
      "secret": false,
      "strategy": "default",
      "default": "300"
    },
    {
      "key": "DEREGISTER_AGENT_INTERVAL",
      "service": "masumi-payment-service",
      "description": "delay in seconds for deregistering agent every 5 minutes",
      "secret": false,
      "strategy": "default",
      "default": "300"
    },
    {
      "key": "BLOCKFROST_API_KEY_PREPROD",
      "service": "masumi-payment-service",
      "description": "Your blockfrost api key. It is required to interact with the blockchain. Receive a free key at https://blockfrost.io/ for the network you are using (e.g. preprod)",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "CHECK_UNSET_REFUND_INTERVAL",
      "service": "masumi-payment-service",
      "description": "delay in seconds for checking unset refund every 5 minutes",
      "secret": false,
      "strategy": "default",
      "default": "300"
    },
    {
      "key": "CHECK_SUBMIT_RESULT_INTERVAL",
      "service": "masumi-payment-service",
      "description": "delay in seconds for checking submit result every 5 minutes",
      "secret": false,
      "strategy": "default",
      "default": "300"
    },
    {
      "key": "CHECK_COLLECT_REFUND_INTERVAL",
      "service": "masumi-payment-service",
      "description": "delay in seconds for checking collection and refund every 5 minutes",
      "secret": false,
      "strategy": "default",
      "default": "300"
    },
    {
      "key": "CHECK_AUTHORIZE_REFUND_INTERVAL",
      "service": "masumi-payment-service",
      "description": "delay in seconds for checking authorize refund every 5 minutes",
      "secret": false,
      "strategy": "default",
      "default": "300"
    },
    {
      "key": "CHECK_WALLET_TRANSACTION_HASH_INTERVAL",
      "service": "masumi-payment-service",
      "description": "delay in seconds for checking wallet transaction hash every 1 minute this also reruns potentially effected services by unlocking the wallet",
      "secret": false,
      "strategy": "default",
      "default": "60"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "masumi-payment-service-official"
      }
    },
    "cli": "railway deploy --template masumi-payment-service-official",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "ad5246be-ab00-405a-8a92-d6463debfc14",
            "serializedConfig": {
              "services": {
                "34c0d6a7-4519-48d5-a0ab-e72406e0bd54": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "masumi-psql-database",
                  "build": {},
                  "deploy": {
                    "requiredMountPath": "/var/lib/postgresql/data"
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:16"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "will be propagated by Railway",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "will be propagated by Railway",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "default: 5432",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "will be propagated by Railway",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "will be propagated by Railway",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "will be propagated by Railway",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "should auto-create a database required for Masumi Payment Service",
                      "defaultValue": "masumi_payment"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "will be propagated by Railway",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "default: postgres",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": true,
                      "description": "default: 820",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "will be propagated by Railway",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "description": "will be propagated by Railway",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{PGDATABASE}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "defaultValue": "60"
                    }
                  },
                  "networking": {},
                  "volumeMounts": {
                    "34c0d6a7-4519-48d5-a0ab-e72406e0bd54": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  },
                  "haTemplateCode": "postgres-ha",
                  "haConversionConfig": {
                    "edge": {
                      "label": "Reverse Proxy",
                      "options": [
                        2,
                        3,
                        4,
                        5
                      ],
                      "nodeLabel": "HAProxy",
                      "description": "Routes traffic to the primary",
                      "defaultValue": 3
                    },
                    "replica": {
                      "label": "Replicas",
                      "options": [
                        2,
                        3,
                        4,
                        5,
                        6,
                        7
                      ],
                      "nodeLabel": "Postgres",
                      "description": "Streaming replicas for automatic failover",
                      "defaultValue": 2
                    },
                    "internal": {
                      "label": "Coordinator Nodes",
                      "options": [
                        3,
                        5,
                        7,
                        9
                      ],
                      "nodeLabel": "etcd",
                      "defaultValue": 3
                    },
                    "description": "This will convert your Postgres database to an HA cluster with Patroni failover and etcd consensus."
                  }
                },
                "370dd66a-5500-4538-a5f4-27ec93530ae6": {
                  "icon": "https://utfs.io/f/HmmUGAhVEi3OliGhfbcoSB1TfFV07kdupeC3OQj5HAPvZD8h",
                  "name": "masumi-payment-service",
                  "deploy": {
                    "startCommand": "sh -c \"npm run prisma:migrate && npm run prisma:seed && npm run start\"",
                    "healthcheckPath": "/api/v1/health",
                    "preDeployCommand": ""
                  },
                  "source": {
                    "repo": "masumi-network/masumi-payment-service",
                    "branch": null,
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "description": "The port to run the server on (default is 3001)",
                      "defaultValue": "3001"
                    },
                    "ADMIN_KEY": {
                      "description": "The key of the admin user, this key will have all permissions, like doing payments, changing configurations and can also be used to create new (more limited) api_keys",
                      "defaultValue": "very_secure_long_and_strong_admin_key"
                    },
                    "DATABASE_URL": {
                      "description": "you will be able to retrieve this URL after you create masumi_payment database in your postgreSQL instance on Railway",
                      "defaultValue": "${{masumi-psql-database.DATABASE_URL}}"
                    },
                    "ENCRYPTION_KEY": {
                      "description": "This is a secret key used to encrypt the sensitive wallet secrets in the database. Please change this to a secure string of at least 32 characters.",
                      "defaultValue": "12345678901234567890123456789012"
                    },
                    "CHECK_TX_INTERVAL": {
                      "description": "delay in seconds for checking payment every 3 minutes",
                      "defaultValue": "180"
                    },
                    "SEED_ONLY_IF_EMPTY": {
                      "description": "Will skip seeding if there are entries in the db",
                      "defaultValue": "True"
                    },
                    "BATCH_PAYMENT_INTERVAL": {
                      "description": "delay in seconds for batching requests every 4 minutes",
                      "defaultValue": "240"
                    },
                    "REGISTER_AGENT_INTERVAL": {
                      "description": "delay in seconds for registering agent every 5 minutes",
                      "defaultValue": "300"
                    },
                    "CHECK_COLLECTION_INTERVAL": {
                      "description": "delay in seconds for checking collection every 5 minutes",
                      "defaultValue": "300"
                    },
                    "CHECK_SET_REFUND_INTERVAL": {
                      "description": "delay in seconds for checking set refund every 5 minutes",
                      "defaultValue": "300"
                    },
                    "DEREGISTER_AGENT_INTERVAL": {
                      "description": "delay in seconds for deregistering agent every 5 minutes",
                      "defaultValue": "300"
                    },
                    "BLOCKFROST_API_KEY_MAINNET": {
                      "isOptional": true,
                      "description": "Your blockfrost api key. It is required to interact with the blockchain. Receive a free key at https://blockfrost.io/ for the network you are using (e.g. mainnet)",
                      "defaultValue": ""
                    },
                    "BLOCKFROST_API_KEY_PREPROD": {
                      "description": "Your blockfrost api key. It is required to interact with the blockchain. Receive a free key at https://blockfrost.io/ for the network you are using (e.g. preprod)",
                      "defaultValue": "{{BLOCKFROST_API_KEY_PREPROD}}"
                    },
                    "CHECK_UNSET_REFUND_INTERVAL": {
                      "description": "delay in seconds for checking unset refund every 5 minutes",
                      "defaultValue": "300"
                    },
                    "CHECK_SUBMIT_RESULT_INTERVAL": {
                      "description": "delay in seconds for checking submit result every 5 minutes",
                      "defaultValue": "300"
                    },
                    "CHECK_COLLECT_REFUND_INTERVAL": {
                      "description": "delay in seconds for checking collection and refund every 5 minutes",
                      "defaultValue": "300"
                    },
                    "CHECK_AUTHORIZE_REFUND_INTERVAL": {
                      "description": "delay in seconds for checking authorize refund every 5 minutes",
                      "defaultValue": "300"
                    },
                    "SELLING_WALLET_MAINNET_MNEMONIC": {
                      "isOptional": true,
                      "description": "The mnemonic of the wallet used to interact with the smart contract. This only needs minimal funds, to cover the CARDANO Network fees. If you do not provide a mnemonic, a new one will be generated. Please ensure you export them immediately after creation and store them securely.",
                      "defaultValue": ""
                    },
                    "SELLING_WALLET_PREPROD_MNEMONIC": {
                      "isOptional": true,
                      "description": "The mnemonic of the wallet used to interact with the smart contract. This only needs minimal funds, to cover the CARDANO Network fees. If you do not provide a mnemonic, a new one will be generated. Please ensure you export them immediately after creation and store them securely.",
                      "defaultValue": ""
                    },
                    "PURCHASE_WALLET_MAINNET_MNEMONIC": {
                      "isOptional": true,
                      "description": "The mnemonic of the wallet used to purchase any agent requests. This needs to have sufficient funds to pay, or be topped up. If you do not provide a mnemonic, a new one will be generated. Please ensure you export them immediately after creation and store them securely.",
                      "defaultValue": ""
                    },
                    "PURCHASE_WALLET_PREPROD_MNEMONIC": {
                      "isOptional": true,
                      "description": "The mnemonic of the wallet used to purchase any agent requests. This needs to have sufficient funds to pay, or be topped up. If you do not provide a mnemonic, a new one will be generated. Please ensure you export them immediately after creation and store them securely.",
                      "defaultValue": ""
                    },
                    "COLLECTION_WALLET_MAINNET_ADDRESS": {
                      "isOptional": true,
                      "description": "The wallet address of the collection wallet. It will receive all payments after a successful and completed purchase (not refund). It does not need any funds, however it is strongly recommended to create it via a hardware wallet or ensure its secret is stored securely. If you do not provide an address, the SELLING_WALLET will be used.",
                      "defaultValue": ""
                    },
                    "COLLECTION_WALLET_PREPROD_ADDRESS": {
                      "isOptional": true,
                      "description": "The wallet address of the collection wallet. It will receive all payments after a successful and completed purchase (not refund). It does not need any funds, however it is strongly recommended to create it via a hardware wallet or ensure its secret is stored securely. If you do not provide an address, the SELLING_WALLET will be used.",
                      "defaultValue": ""
                    },
                    "CHECK_WALLET_TRANSACTION_HASH_INTERVAL": {
                      "description": "delay in seconds for checking wallet transaction hash every 1 minute this also reruns potentially effected services by unlocking the wallet",
                      "defaultValue": "60"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "masumi-payment-service",
      "method": "GET",
      "path": "/api/v1/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-20T16:14:49.616Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-09-18T22:55:59.959Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_b558f51af99a42b5bbf3",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": false,
        "detail": "DEPLOYING,SUCCESS"
      }
    ]
  }
}
