Building with SettleMint/Hyperledger Fabric Guide

Setup fabconnect middleware

Setup fabric API layer

Summary

To enable API-based interaction with your Fabric smart contracts, the first step is to configure FabConnect middleware. This component exposes REST and WebSocket endpoints that allow you to submit transactions, query chaincode, retrieve blocks, and manage events programmatically.


Once FabConnect is added to your application, you gain full access to the underlying blockchain network through structured HTTP calls. You can register and manage identities via Fabric CA, monitor ledger state, submit transactions in sync or async mode, and configure event listeners for real-time responses.


How to setup graph middleware and api portal in SettleMint platform

Middleware acts as a bridge between your blockchain network and applications, providing essential services like data indexing, API access, and event monitoring. Before adding middleware, ensure you have an application and blockchain node in place.

How to add middleware

Add FabConnect

Firefly fabconnect api reference overview

This reference outlines the key API endpoints exposed by Hyperledger FireFly FabConnect, a REST and WebSocket gateway that enables interaction with Hyperledger Fabric networks via structured HTTP requests and event subscriptions.

fabconnect ui

Authentication & setup

FieldDescription
Auth TypeBearer Token (JWT)
HeaderAuthorization: Bearer <your_token>
Base URLhttps://fabconnect-34253.gke-europe.settlemint.com

Identity management

Manage user identities through Fabric CA:

EndpointMethodDescription
/identitiesGETList all registered identities
/identitiesPOSTRegister a new identity with the CA
/identities/{username}GETGet details of a specific identity
/identities/{username}PUTModify existing identity’s attributes
/identities/{username}/enrollPOSTEnroll the identity to receive certificates
/identities/{username}/reenrollPOSTRe-enroll the identity to renew certificates
/identities/{username}/revokePOSTRevoke the identity’s certificates

Ledger & block info

Fetch metadata and raw data from the Fabric blockchain:

EndpointMethodDescription
/chaininfoGETGet current block height and hashes for a channel
/blocks/{blockNumberOrHash}GETRetrieve block by number or hash
/blockByTxId/{txId}GETRetrieve block that contains a specific transaction

Transaction handling

Submit transactions or check transaction state:

EndpointMethodDescription
/transactionsPOSTSubmit a transaction (sync or async)
/transactions/{txId}GETFetch transaction details using transaction ID (hash)

Chaincode queries

Execute read-only chaincode function calls:

EndpointMethodDescription
/queryPOSTSend a query request to chaincode

Transaction receipts (for async mode)

Access receipts from async transaction submissions (fly-sync=false):

EndpointMethodDescription
/receiptsGETList available transaction receipts
/receipts/{receiptId}GETGet a specific receipt by ID

Event streams

Create and manage WebSocket or Webhook-based event delivery pipelines:

EndpointMethodDescription
/eventstreamsGETList all existing event streams
/eventstreamsPOSTCreate a new event stream
/eventstreams/{eventstreamId}GETRetrieve a specific event stream
/eventstreams/{eventstreamId}DELETEDelete a specific event stream

Event subscriptions

Configure event listening rules on chaincode or block events:

EndpointMethodDescription
/subscriptionsGETList all subscriptions
/subscriptionsPOSTCreate a new subscription
/subscriptions/{subscriptionId}GETGet a specific subscription by ID
/subscriptions/{subscriptionId}DELETERemove a subscription by ID

Advanced controls

FeatureDetails
Sync Mode (fly-sync)Use true for synchronous (wait for commit), false for async
Custom ChannelOverride with fly-channel parameter in query
Signer IdentityUse fly-signer to choose which identity signs the request
Schema SupportStructured mode supports input validation using JSON schema headers


Congratulations.!!

You have succesfully configured Fabconncet middleware and have API access on your chaincode.

From here we will proceed to adding off-chain database and storage options to enable us to have a holistic backend and storage layer for our application.