Build a Fabric Supply Chain PoC with Claude Code and ChainLaunch
Written by David Viejo
Last verified: March 2026 | Fabric 2.5+ / Go 1.21+ / ChainLaunch latest
Hyperledger Fabric's operational complexity has long been the number-one barrier to PoC development. According to the Linux Foundation's 2025 State of Decentralized Trust report, Fabric powers thousands of production deployments across supply chain, trade finance, and healthcare — yet most enterprise blockchain projects still stall at the infrastructure phase before reaching actual business logic. Before you write a single line of chaincode, you're already deep in crypto material generation, channel configuration files, anchor peer definitions, and a five-step chaincode lifecycle.
What if an AI assistant could handle all of that? Claude Code, paired with ChainLaunch, compresses what used to take two to three days into a single conversation. This post walks you through the full process: network creation, Go chaincode authoring, CCaaS deployment, and end-to-end ledger queries — all for a pharmaceutical supply chain tracker.
TL;DR: Claude Code + ChainLaunch automates every painful part of Fabric PoC setup: org creation, CA provisioning, peer/orderer deployment, channel creation, anchor peers, and Go chaincode deployment via CCaaS. A multi-day setup becomes a single conversation.
By the end of this tutorial, you'll have a fully operational Hyperledger Fabric network running a pharmaceutical supply chain tracker. Here's what that includes.
Network infrastructure:
Organization with its own Certificate Authority
Peer node joined to a shared channel
Three Raft orderers for crash fault tolerance
Anchor peers configured for cross-organization gossip
Chaincode:
A Go supply chain contract deployed via Chaincode-as-a-Service (CCaaS)
Full item lifecycle: InitLedger, CreateItem, UpdateStatus, TransferOwnership
Query functions: GetItem, GetHistory
Tracks pharmaceutical product movement from manufacturer to patient
The workflow:
You describe what you want to Claude Code in plain language
Claude Code calls ChainLaunch CLI to provision the entire network
Claude Code writes the Go chaincode, builds the binary, and deploys via CCaaS
ChainLaunch provisions a complete Fabric network — organizations, CAs, peers, orderers, and channels — from a single command. Manually bootstrapping a Fabric network requires generating crypto material with cryptogen, writing configtx.yaml, creating genesis blocks, and running a multi-step channel setup. ChainLaunch reduces all of that to one CLI call.
First, find your key provider ID (on a fresh install this is typically 1):
Replace --provider-id 1 with whatever ID the command above returned.
What happens under the hood:
Organization creation — ChainLaunch creates "PharmaOrg" and "OrdererOrg" with their MSP IDs
CA setup — Each org gets a Certificate Authority. ChainLaunch generates admin, peer, and orderer identities automatically
Crypto material — All TLS certificates and MSP material are generated and stored
Peer and orderer provisioning — 1 peer and 3 orderers start and connect to the shared network
Channel creation — The mychannel application channel is created with Raft consensus
Channel joining — The peer and all orderers join the channel
Anchor peer setup — Anchor peers are configured for gossip discovery
The --ordererCounts "OrdererOrg=3" flag uses Raft consensus. With three orderers, your network tolerates one orderer failure — enough for a PoC you might demo under real conditions.
The --mode docker flag runs nodes as Docker containers. Use --mode service if you prefer systemd-managed services that persist across restarts.
How does this compare to doing it manually? We've timed both approaches internally. Manual Fabric bootstrap (for someone who's done it before) takes about 45 minutes to an hour. First-timers can easily spend half a day. ChainLaunch finishes in about 2 minutes.
ChainLaunch provisions a complete Hyperledger Fabric network — organizations, certificate authorities, peers, orderers, and channels — from a single CLI command in approximately 2 minutes. Manual Fabric bootstrap for an experienced engineer takes 45-60 minutes; for a first-timer, half a day. The time compression comes from automating crypto material generation, configtx.yaml authoring, genesis block creation, and channel setup.
3 Config Mistakes That Break Fabric Networks in Production
The checklist our team uses before every Fabric deployment — covers peer gossip, orderer raft settings, and CA enrollment traps that cause 80% of production failures.
Claude Code generates production-ready Go chaincode from a plain-language description. Tell it: "create a supply chain tracker chaincode for Hyperledger Fabric that tracks pharmaceutical products." Here's the chaincode it produces.
One thing we've learned from building supply chain PoCs: the GetHistory function is the one that consistently impresses enterprise stakeholders most. Showing a full audit trail — who touched this asset, when, and what changed — lands better than any architecture diagram.
Create the chaincode directory and initialize a Go module:
mkdir -p supplychain-cc && cd supplychain-ccgo mod init supplychain-ccgo get github.com/hyperledger/fabric-chaincode-go/shimgo get github.com/hyperledger/fabric-contract-api-go/contractapi
All three code blocks below go into a single main.go file.
The shim.ChaincodeServer is what makes this CCaaS-compatible. Instead of the peer managing the chaincode process inside a Docker container, your chaincode runs as an independent gRPC server. The peer dials into it. This means you can restart, rebuild, and debug chaincode without ever touching the peer — a massive time saver during PoC iteration.
3 Config Mistakes That Break Fabric Networks in Production
The checklist our team uses before every Fabric deployment — covers peer gossip, orderer raft settings, and CA enrollment traps that cause 80% of production failures.
Chaincode-as-a-Service (CCaaS) is the recommended deployment model for Fabric 2.4+. It decouples chaincode execution from peer container lifecycle, so you can restart or update your chaincode without touching the peer.
First, pull the network connection profile. This YAML file contains peer endpoints, orderer addresses, TLS certificates, and admin credentials — everything the SDK needs to interact with your network.
The chainlaunch fabric install command runs the full Fabric 2.x lifecycle — package, install, approve, and commit — in one shot. The --chaincodeAddress tells the peer where to find your chaincode server (use host.docker.internal if your peer runs in Docker and the chaincode runs on the host):
ChainLaunch handles all five lifecycle steps under this single command:
Packages the chaincode with connection metadata for CCaaS
Installs the package on all peers in the specified organizations
Queries the installed package ID
Approves the chaincode definition for each organization
Commits the definition to the channel
That's the five-step lifecycle from the Fabric documentation, compressed into one command. Doing these steps manually requires running 5 separate CLI commands with carefully matched package IDs, sequence numbers, and endorsement policies. Getting any of those wrong means starting the sequence over.
Chaincode-as-a-Service (CCaaS), available since Hyperledger Fabric 2.4, decouples chaincode execution from peer container lifecycle. ChainLaunch's fabric install command compresses the five-step Fabric 2.x chaincode lifecycle — package, install, approve, commit — into a single command, eliminating the manual package-ID propagation that causes most deployment failures.
The server starts listening on port 9999. Once it's running, the peer connects and starts routing transactions to your chaincode.
During internal testing of ChainLaunch's CCaaS install flow, the biggest time savings came from automatic package ID propagation between the install, approve, and commit stages. Manually, you'd copy-paste a long hash between commands — one typo and you start over.
With the chaincode committed and the server running, you're ready to run the full supply chain lifecycle. This is where the PoC becomes a real demonstration — you can walk stakeholders through pharmaceutical product tracking from manufacture to dispensation.
# Get current item statechainlaunch fabric query \ --config conn.yaml \ --channel mychannel \ --chaincode supply-chain \ --mspID PharmaOrg \ --user admin \ --fcn GetItem \ -a "DRUG-003"# Get the complete audit trailchainlaunch fabric query \ --config conn.yaml \ --channel mychannel \ --chaincode supply-chain \ --mspID PharmaOrg \ --user admin \ --fcn GetHistory \ -a "DRUG-003"
The GetHistory output shows every state transition: who made it, when, and where the product was. That's the audit trail that enterprise stakeholders — compliance teams, auditors, regulators — actually care about. It's the feature that turns a technical demo into a business conversation.
The real productivity multiplier isn't any single tool — it's Claude Code chaining all of them together. Here's what the actual conversation looks like.
You open Claude Code and say:
"Create a Hyperledger Fabric network for a pharmaceutical supply chain PoC. I need one peer, three orderers. Then write a Go chaincode that tracks drug products through manufacturing, transit, and delivery — with full ownership transfer and history. Deploy it via CCaaS."
Claude Code then:
Calls chainlaunch testnet fabric to provision the network
Writes the Go chaincode — the full contract you saw above, including the CCaaS entry point
Pulls the network config and creates go.mod with the correct dependency versions
Runs chainlaunch fabric install to package, install, approve, and commit
Builds the binary and starts the CCaaS server with the right environment variables
Runs InitLedger and a sample query to verify everything works
Is this magic? No. Claude Code understands both the ChainLaunch CLI and Fabric's chaincode model. The key is that ChainLaunch exposes a clean, scriptable CLI — which makes it straightforward for an AI assistant to orchestrate.
The combination of a clean CLI and an AI code agent creates something neither tool delivers alone. ChainLaunch without Claude Code still requires you to know the right commands and flags. Claude Code without ChainLaunch means writing your own Fabric provisioning scripts from scratch. Together, they cover both infrastructure complexity and code generation in one workflow.
Claude Code paired with ChainLaunch's scriptable CLI creates a complete AI-assisted Hyperledger Fabric workflow: the AI handles network provisioning commands, Go chaincode generation, CCaaS deployment, and ledger initialization through a single natural-language conversation. Neither tool delivers this alone — ChainLaunch provides the clean API surface; Claude Code provides the orchestration intelligence.
Your choice of blockchain protocol should match your use case — not your team's familiarity. Both Fabric and Besu are production-grade, and ChainLaunch supports both.
Capability
Hyperledger Fabric
Hyperledger Besu
Smart contract language
Go, Node.js, Java
Solidity (EVM)
Privacy model
Channels + private data collections
Tessera private transactions
Consensus
Raft (CFT), BFT (v3.0+)
QBFT, IBFT 2.0, Clique
Org-level governance
Native (MSP, endorsement policies)
Smart contract-based permissioning
Tooling ecosystem
Fabric SDKs, limited third-party
Full Ethereum ecosystem (Hardhat, Foundry, MetaMask)
Setup complexity
High (~60 min manual)
Low (~10 min manual)
Best for
Multi-org consortiums with data privacy
EVM-compatible enterprise networks
Choose Fabric when your use case requires private data collections, fine-grained endorsement policies ("3 of 5 orgs must sign"), or permissioned networks with distinct organizational identities. Fabric's channel architecture makes data invisible to non-members at the protocol level.
Choose Besu when your team already knows Solidity, you want EVM compatibility (Hardhat, Foundry, MetaMask work out of the box), you need fast deployment cycles, or you're building a public/permissioned hybrid.
For supply chain specifically, Fabric's private data collections and org-based endorsement policies make it a stronger fit for multi-party enterprise scenarios. Walmart uses IBM's Hyperledger Fabric platform to trace food products in seconds instead of days. But if your PoC doesn't need private data, Besu's simpler contract deployment model gets you to a demo faster.
CCaaS is Fabric's external chaincode execution model, available since Fabric 2.4. Instead of the peer managing the chaincode process inside a Docker container, your chaincode runs as an independent gRPC server that the peer dials into. This makes iteration faster — you can restart the chaincode without touching the peer — and debugging easier since you can attach a standard Go debugger. See our chaincode tutorial for more on CCaaS patterns.
Yes. ChainLaunch supports dynamic org addition to an existing channel. You'd generate the new org's MSP material, create a channel config update transaction, and get signatures from existing channel members. ChainLaunch's CLI handles each step. The process follows the standard Fabric channel update flow, so existing tooling works alongside ChainLaunch.
Fabric's test-network is a shell script that bootstraps a minimal network for local development. It's not designed for persistence, multi-org management, or anything resembling production. ChainLaunch manages the full lifecycle: network creation, org management, channel operations, chaincode lifecycle, node monitoring, and key management. It persists state across restarts and exposes a REST API and Terraform provider for infrastructure-as-code. Think of test-network as a learning tool and ChainLaunch as the platform you'd actually run.
Hyperledger Fabric's test-network shell scripts are designed for local learning only — they don't persist state, can't manage multiple organizations, and have no REST API. ChainLaunch manages the full Fabric lifecycle: network creation, org management, channel operations, chaincode lifecycle, node monitoring, key management, and Terraform-based infrastructure-as-code across both Fabric and Besu.
Claude Code is a general-purpose AI coding assistant — it works with any CLI or SDK. For ChainLaunch specifically, Claude Code can provision and manage both Fabric and Besu networks. The quality of the AI-assisted workflow depends on how scriptable the underlying platform is. ChainLaunch's clean CLI design is what makes it pair well with Claude Code.
Go 1.21 or later is recommended for fabric-contract-api-go v1.2.x and fabric-chaincode-go. The CCaaS shim.ChaincodeServer API is stable as of Fabric 2.4. If you're on an older Fabric version (2.2 LTS), the chaincode API is compatible but CCaaS support is limited — upgrade to 2.4+ for the best experience.
Fabric's reputation for operational complexity is well-earned — but it doesn't have to block your PoC. ChainLaunch and Claude Code remove the biggest friction points: network bootstrap, crypto material management, and the five-step chaincode lifecycle.
What you've built here — a pharmaceutical supply chain tracker with full audit history, ownership transfers, and status tracking — is a PoC that enterprise stakeholders can actually evaluate. It's not a hello-world chaincode. It's a working demonstration of Fabric's core value: tamper-evident, multi-party, permissioned record-keeping.
Key takeaways:
CCaaS is the modern Fabric deployment model. Faster iteration, easier debugging than container-managed chaincode.
ChainLaunch's testnet fabric command handles everything from org creation to anchor peer setup. You don't need to learn configtxgen.
Claude Code works best as an orchestrator. Give it a high-level goal and let it call the right CLI commands in order.
GetHistory wins demos. A full audit trail resonates with compliance-focused enterprise buyers more than any other feature.
Ready to try it? Install ChainLaunch and run your first chainlaunch testnet fabric command. For enterprise features like RBAC, SSO, and automated backups, check out ChainLaunch Pro. If you'd rather start with Besu, read our companion post on building a Besu supply chain PoC.
David Viejo is the founder of ChainLaunch and a Hyperledger Foundation contributor. He created the Bevel Operator Fabric project and has been building blockchain infrastructure tooling since 2020.
Free resource
3 Config Mistakes That Break Fabric Networks in Production
The checklist our team uses before every Fabric deployment — covers peer gossip, orderer raft settings, and CA enrollment traps that cause 80% of production failures.