Platform Components/Middleware and API Layer

Graph Middleware

Accelerate blockchain development with SettleMint's Graph middleware. Reduce data query times by 95%, scale GraphQL APIs for millions of users, and deploy production-ready subgraph indexing with zero configuration.

Enterprise Blockchain Data Infrastructure

Business Impact

ROI Metrics: Organizations using SettleMint's Graph middleware achieve 95% faster blockchain data queries, 80% reduction in API development time, and scale to support millions of users with enterprise-grade GraphQL infrastructure.

Enterprise middleware transforms complex blockchain networks into business-ready data infrastructure, providing production-scale data indexing, high-performance API access, and real-time event monitoring. SettleMint's middleware solutions eliminate the complexity of building custom blockchain data layers, enabling enterprises to focus on business logic rather than infrastructure management.

Available Options

  • Graph Middleware - For EVM chains, providing subgraph-based indexing with GraphQL API
  • Smart contract portal - For EVM chains, offering REST & GraphQL APIs with webhooks
  • FabConnect - For Hyperledger Fabric, providing RESTful API
  • Attestation Indexer - Specialized indexer for attestations with GraphQL API

Key Features

  • Data indexing
  • API access
  • Event monitoring
  • Webhook support

How to add middleware

Navigate to application Navigate to the application where you want to add middleware.

Access middleware section Click middleware in the left navigation, and then click add a middleware. This opens a form.

Configure middleware

  1. Choose middleware type (graph or portal)
  2. Choose a middleware name
  3. Select the blockchain node (prefered option for portal) or load balancer (prefered option for the graph)
  4. Configure deployment settings
  5. Click confirm

First ensure you're authenticated:

settlemint login

Create a middleware:

# Get the list of available middleware types
settlemint platform create middleware --help

# Create a middleware
settlemint platform create middleware <type> <n>

# Get information about the command and all available options
settlemint platform create middleware <type> --help
import { createSettleMintClient } from '@settlemint/sdk-js';

const client = createSettleMintClient({
  accessToken: 'your_access_token',
  instance: 'https://console.settlemint.com'
});

// Create middleware
const result = await client.middleware.create({
  applicationUniqueName: "your-app-unique-name",
  name: "my-middleware",
  type: "SHARED",
  interface: "HA_GRAPH", // Valid options: "HA_GRAPH" | "SMART_CONTRACT_PORTAL"
  blockchainNodeUniqueName: "your-node-unique-name",
  region: "EUROPE",  // Required
  provider: "GKE",   // Required
  size: "SMALL"      // Valid options: "SMALL" | "MEDIUM" | "LARGE"
});
console.log('Middleware created:', result);

Get your access token from the Platform UI under User Settings → API Tokens.

Manage middleware

Navigate to your middleware and click manage middleware to:

  • View middleware details and status
  • Update configurations
  • Monitor health
  • Access endpoints
# List middlewares
settlemint platform list middlewares --application <app-name>
# Get middleware details
settlemint platform read middleware <middleware-name>
// List middlewares
await client.middleware.list("your-app-unique-name");
// Get middleware details
await client.middleware.read("middleware-unique-name");

The Graph - Production Blockchain Data Platform

Enterprise Performance

Scale: Process 100M+ blockchain events daily with sub-second query response times and 99.99% uptime SLA for mission-critical applications.

The Graph middleware delivers enterprise-grade blockchain data indexing through production-ready subgraphs. Deploy this solution when your enterprise requires:

Performance at Scale

  • Sub-second queries for complex blockchain data
  • Millions of users supported simultaneously
  • Real-time indexing with automatic failover
  • Enterprise SLA with 99.99% uptime guarantee

Business Intelligence

  • Custom analytics through flexible subgraph logic
  • Complex business queries with GraphQL optimization
  • Historical data analysis for strategic insights
  • Cross-chain aggregation for unified reporting

Developer Productivity

  • Zero-config deployment with automated infrastructure
  • Pre-built modules for common blockchain patterns
  • Type-safe APIs for reliable application development
  • Real-time debugging with comprehensive monitoring

Using the graph sdk

import { createTheGraphClient } from "@settlemint/sdk-thegraph";

const { client: graphClient, graphql } = createTheGraphClient({
  instances: JSON.parse(
    process.env.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS || "[]"
  ),
  accessToken: process.env.SETTLEMINT_ACCESS_TOKEN!,
  subgraphName: "your-subgraph",
});

For detailed API reference and advanced usage examples, check out the TheGraph SDK documentation.

Enterprise Graph Protocol Implementation

The Graph powers SettleMint's enterprise blockchain data infrastructure, providing production-scale indexing for all EVM-compatible chains including Ethereum, Hyperledger Besu, Polygon, Avalanche, and custom enterprise networks. This battle-tested protocol handles billions of blockchain events daily across global enterprises.

Production-Ready Infrastructure

  • Multi-chain support for enterprise blockchain architectures
  • Permissioned networks with enterprise security controls
  • High-availability deployment with automatic failover
  • Horizontal scaling to handle peak business loads

Business Value: 90% reduction in infrastructure management overhead

Developer-First Platform

  • Pre-built subgraph modules for instant deployment
  • Custom indexing logic for unique business requirements
  • Type-safe GraphQL APIs for reliable integrations
  • Real-time data synchronization for responsive applications

Business Value: 80% faster time-to-market for blockchain applications

Advanced Analytics Platform

  • Complex business queries with optimized performance
  • Historical data analysis for strategic decision making
  • Real-time dashboards for operational monitoring
  • Cross-contract aggregations for comprehensive insights

Business Value: 95% improvement in data-driven decision making

Subgraph Architecture

SettleMint provides enterprise-ready subgraph modules that eliminate months of development time:

Pre-Built Enterprise Modules

  • OpenZeppelin Library integration for standard contracts
  • SettleMint Extensions for specialized use cases
  • Custom business logic for unique requirements
  • Performance optimizations for production workloads

Business Benefits

  • 3-month faster deployment vs custom development
  • Battle-tested reliability from thousands of deployments
  • Automatic updates with backward compatibility
  • Enterprise support for mission-critical applications

Before you start, make sure you are running an EVM-compatible network (Ethereum, Polygon, Hyperledger Besu, Avalanche, etc.)

When the middleware is deployed, follow these steps to start using it:

Define and deploy a subgraph

Navigate to the smart contract set which you want to index, go the details and open the IDE. Here you will define the subgraph to set the indexing specifications, and deploy it so it can be loaded into the middleware. There are instructions included in the IDE to help you.

Subgraph raw configuration

Inside the root you will find a file called subgraph.config.json that contains the raw configuration of the subgraph. The important section is the datasources section.

  • Name - here we defined the smart contracts with their name (the name of the artifact created in the 'deployments' folder when running the deploy task)
  • Address & Startblock - You will notice the startblock and address to be 0. You must fill these in when your contract has been deployed. The block number and the address can be found in the deployment folder, under ignition.
  • Module - In the modules array all the indexing modules to activate for this smart contract.

About the indexing modules

We provide two libraries of indexing modules: one by the OpenZeppelin team for all the common smart contracts in their smart contract library, and one by the SettleMint team to extend the capabilities of the OpenZeppelin one, and to provide indexing of the specific SettleMint smart contract sets.

The OpenZeppelin set contains the following indexing modules:

  • accesscontrol
  • erc1155
  • erc1967upgrade
  • erc20
  • erc721
  • governor
  • ownable
  • pausable
  • timelock
  • voting

The SettleMint set contains the following indexing modules:

  • erc721ipfs: to extend the ERC-721 from OpenZeppelin to index IPFS metadata of your ERC-721 tokens
  • crowdsale/vestingvault/vestingwallet: to index and expose all the data for the crowdsale contract set
  • forwarder: for the ERC-20 Meta transactions forwarder data
  • statemachinemetadata: to index IPFS metadata for state machines

These are available in the subgraph folder in your IDE. You can create your own modules for any other data you want to index, or for custom smart contracts not part of the default sets. And you can modify the existing ones if you want to index things a bit different.

Write your own indexing module

You can also write your own custom indexing module for smart contracts that are not part of the default sets.

Follow these steps to create a custom indexing module:

  • Primitives to generate a GraphQL schema: subgraph/datasource/x.gql.json - In order to allow composability, the schema are not defined in the GraphQL format but rather in a dedicated JSON format which is can be assembled and compiled to GraphQL.
  • Template to generate a subgraph manifest: subgraph/datasource/x.yaml - This file lists all the events that the datasources should listen to, and links that to the corresponding indexing logic.
  • Indexing logic: subgraph/datasources/x.ts and (optionally) subgraph/fetch/x.ts - This is the core logic that processes the events to index the onchain activity.

To learn more, check it out on Github.

For detailed step-by-step guides on setting up custom Graph Middleware, refer to:

Start your subgraph

The following tasks need to be run in this sequence:

  • bunx settlemint scs subgraph codegen - Generates the AssemblyScript types for your contracts ABI.
  • bunx settlemint scs subgraph build - Compiles the WASM files based on the outputs generated by bunx settlemint scs subgraph codegen.
  • bunx settlemint scs subgraph deploy - Deploys the WASM files to IPFS and updates the middleware to start or update the indexing.

The indexing of your smart contracts has now started. This can take a while, but once done you can query the middleware for your data in seconds using the GraphQL API. You can find the endpoint in the Connect-tab.