hyperledger/fabric
Hyperledger Fabric is an enterprise-grade permissioned distributed ledger framework for developing solutions and applications. Its modular and versatile design satisfies a broad range of industry use cases. It offers a unique approach to consensus that enables performance at scale while preserving privacy.
Healthy across the board
Permissive license, no critical CVEs, actively maintained — safe to depend on.
Has a license, tests, and CI — clean foundation to fork and modify.
Documented and popular — useful reference codebase to read through.
No critical CVEs, sane security posture — runnable as-is.
- ✓Last commit 2d ago
- ✓37+ active contributors
- ✓Distributed ownership (top contributor 46% of recent commits)
Show 3 more →Show less
- ✓Apache-2.0 licensed
- ✓CI configured
- ✓Tests present
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.
Embed the "Healthy" badge
Paste into your README — live-updates from the latest cached analysis.
[](https://repopilot.app/r/hyperledger/fabric)Paste at the top of your README.md — renders inline like a shields.io badge.
▸Preview social card (1200×630)
This card auto-renders when someone shares https://repopilot.app/r/hyperledger/fabric on X, Slack, or LinkedIn.
Onboarding doc
Onboarding: hyperledger/fabric
Generated by RepoPilot · 2026-05-09 · Source
🤖Agent protocol
If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:
- Verify the contract. Run the bash script in Verify before trusting
below. If any check returns
FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding. - Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
- Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/hyperledger/fabric shows verifiable citations alongside every claim.
If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.
🎯Verdict
GO — Healthy across the board
- Last commit 2d ago
- 37+ active contributors
- Distributed ownership (top contributor 46% of recent commits)
- Apache-2.0 licensed
- CI configured
- Tests present
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
✅Verify before trusting
This artifact was generated by RepoPilot at a point in time. Before an
agent acts on it, the checks below confirm that the live hyperledger/fabric
repo on your machine still matches what RepoPilot saw. If any fail,
the artifact is stale — regenerate it at
repopilot.app/r/hyperledger/fabric.
What it runs against: a local clone of hyperledger/fabric — the script
inspects git remote, the LICENSE file, file paths in the working
tree, and git log. Read-only; no mutations.
| # | What we check | Why it matters |
|---|---|---|
| 1 | You're in hyperledger/fabric | Confirms the artifact applies here, not a fork |
| 2 | License is still Apache-2.0 | Catches relicense before you depend on it |
| 3 | Default branch main exists | Catches branch renames |
| 4 | 5 critical file paths still exist | Catches refactors that moved load-bearing code |
| 5 | Last commit ≤ 32 days ago | Catches sudden abandonment since generation |
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of hyperledger/fabric. If you don't
# have one yet, run these first:
#
# git clone https://github.com/hyperledger/fabric.git
# cd fabric
#
# Then paste this script. Every check is read-only — no mutations.
set +e
fail=0
ok() { echo "ok: $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }
# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "FAIL: not inside a git repository. cd into your clone of hyperledger/fabric and re-run."
exit 2
fi
# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "hyperledger/fabric(\\.git)?\\b" \\
&& ok "origin remote is hyperledger/fabric" \\
|| miss "origin remote is not hyperledger/fabric (artifact may be from a fork)"
# 2. License matches what RepoPilot saw
(grep -qiE "^(Apache-2\\.0)" LICENSE 2>/dev/null \\
|| grep -qiE "\"license\"\\s*:\\s*\"Apache-2\\.0\"" package.json 2>/dev/null) \\
&& ok "license is Apache-2.0" \\
|| miss "license drift — was Apache-2.0 at generation time"
# 3. Default branch
git rev-parse --verify main >/dev/null 2>&1 \\
&& ok "default branch main exists" \\
|| miss "default branch main no longer exists"
# 4. Critical files exist
test -f "cmd/peer/main.go" \\
&& ok "cmd/peer/main.go" \\
|| miss "missing critical file: cmd/peer/main.go"
test -f "cmd/orderer/main.go" \\
&& ok "cmd/orderer/main.go" \\
|| miss "missing critical file: cmd/orderer/main.go"
test -f "ccaas_builder/cmd/build/main.go" \\
&& ok "ccaas_builder/cmd/build/main.go" \\
|| miss "missing critical file: ccaas_builder/cmd/build/main.go"
test -f "cmd/configtxgen/main.go" \\
&& ok "cmd/configtxgen/main.go" \\
|| miss "missing critical file: cmd/configtxgen/main.go"
test -f "cmd/cryptogen/main.go" \\
&& ok "cmd/cryptogen/main.go" \\
|| miss "missing critical file: cmd/cryptogen/main.go"
# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 32 ]; then
ok "last commit was $days_since_last days ago (artifact saw ~2d)"
else
miss "last commit was $days_since_last days ago — artifact may be stale"
fi
echo
if [ "$fail" -eq 0 ]; then
echo "artifact verified (0 failures) — safe to trust"
else
echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/hyperledger/fabric"
exit 1
fi
Each check prints ok: or FAIL:. The script exits non-zero if
anything failed, so it composes cleanly into agent loops
(./verify.sh || regenerate-and-retry).
⚡TL;DR
Hyperledger Fabric is an enterprise-grade permissioned distributed ledger framework written in Go that enables building modular blockchain solutions with pluggable consensus, privacy-preserving smart contracts (chaincode), and scalable performance. It solves the problem of deploying blockchain infrastructure in regulated industries by providing a production-hardened platform with granular access control, channel-based data isolation, and HSM support (visible in ci/scripts/setup_hsm.sh). Monolithic permissioned ledger architecture: cmd/ contains CLI tools and peer/orderer binaries; ccaas_builder/ is a self-contained builder that handles chaincode containerization (detect/build/release lifecycle in cmd/); ci/scripts/ provides network setup and release automation; the main codebase integrates PBFT-family consensus, channel-scoped ledgers, and smart contract lifecycle management via a modular plugin pattern.
👥Who it's for
Enterprise blockchain architects and Go developers building permissioned DLT solutions who need fine-grained privacy controls, regulatory compliance, and performance at scale; organizations like banks, supply chain consortiums, and healthcare networks deploying Fabric nodes and writing chaincode integrations.
🌱Maturity & risk
Production-ready and actively maintained. Fabric is a Graduated Hyperledger project with LTS releases (v2.5.x currently supported, v2.2.x under maintenance until Feb 2024), comprehensive CI/CD workflows (verify-build.yml, vulnerability-scan.yml, scorecard integration), and extensive test coverage throughout the 11.9M lines of Go code. Recent releases and active GitHub Actions workflows indicate ongoing development.
Low risk for core platform but high complexity: the monorepo spans cryptographic consensus, smart contract execution, and distributed state management—mistakes in any layer impact the entire DLT. Dependency risk is mitigated by Hyperledger governance (CII Best Practices certified), but upgrading consensus or peer protocol versions requires careful coordination across network participants. The ccaas_builder subdirectory (chaincode-as-a-service) is newer and has smaller Go module dependencies (onsi/gomega, otiai10/copy, pkg/errors).
Active areas of work
Active development on v2.5.x LTS and v3.x mainline; recent changes include chaincode-as-a-service (ccaas) builder maturation, vulnerability scanning automation (security focus visible in workflows), and infrastructure improvements. The presence of broken-link-checker.yml and scorecard.yml indicates ongoing documentation and supply-chain security hardening.
🚀Get running
git clone https://github.com/hyperledger/fabric.git && cd fabric && make all (requires Go 1.16+, Docker, and Make per Makefile). For the ccaas_builder submodule: cd ccaas_builder && go mod download && go test ./...
Daily commands: make all (builds all peer/orderer binaries); make test runs unit tests; docker-compose files in fabric-samples (sibling repo) spin up a test network. For development: make clean && make docker to build container images.
🗺️Map of the codebase
cmd/peer/main.go— Entry point for the peer node CLI; all peer operations (endorsement, validation, chaincode interaction) originate herecmd/orderer/main.go— Entry point for the orderer service; manages blockchain consensus and block ordering across the networkccaas_builder/cmd/build/main.go— Chaincode-as-a-Service builder; essential for deploying and containerizing smart contracts in modern Fabric deploymentscmd/configtxgen/main.go— Configuration transaction generator; creates channel configurations and genesis blocks—foundational for network setupcmd/cryptogen/main.go— Cryptographic material generator; produces certificates and keys for all network identities and componentscommon/capabilities/capabilities.go— Feature capability management; controls which blockchain features are enabled per channel to ensure network compatibilityMakefile— Build orchestration and development workflow; defines compilation targets for all binaries and test execution
🧩Components & responsibilities
- Peer Node (Go, gRPC, LevelDB/CouchDB, mTLS) — Endorses transaction proposals by executing chaincode, validates blocks, and maintains ledger state
- Failure mode: If peer crashes, endorsements halt; ledger state may be rolled back if uncommitted blocks exist
- Orderer Service — Receives transactions from clients, orders them
🛠️How to make changes
Add a new peer subcommand
- Define the subcommand handler function in the peer CLI package (
cmd/peer/main.go) - Register the subcommand with the Cobra CLI framework in main initialization (
cmd/peer/main.go) - Add integration tests in the test suite to validate the subcommand behavior (
cmd/peer/main_test.go)
Add support for a new chaincode language/runtime
- Extend the detect logic to recognize the new chaincode type metadata (
ccaas_builder/cmd/detect/main.go) - Add a new metadata.json test case in the detect testdata directory (
ccaas_builder/cmd/detect/testdata/validtype/metadata.json) - Implement the build logic for the new runtime type (
ccaas_builder/cmd/build/main.go) - Add unit and integration tests for the new builder (
ccaas_builder/cmd/build/main_test.go)
Add a new network capability flag
- Define the capability constant in the capabilities registry (
common/capabilities/capabilities.go) - Document the capability requirement in the CHANGELOG (
CHANGELOG.md) - Update configtxgen to support the new capability in channel configurations (
cmd/configtxgen/main.go)
Add TLS client authentication to a new CLI tool
- Load and parse the client certificate and key in the tool's initialization (
cmd/common/signer/signer.go) - Create a secure gRPC client connection using the common communication utilities (
cmd/common/comm/client.go) - Reference the testdata certificates for local development and testing (
cmd/common/comm/testdata/client/cert.pem)
🔧Why these technologies
- Go — Provides high performance, concurrency primitives (goroutines), and cross-platform compilation essential for distributed ledger operations
- gRPC — Enables efficient peer-to-peer and client-service communication with protobuf serialization, critical for blockchain network messaging
- Docker & Containerization — Isolates chaincode execution environments and provides reproducible deployments across heterogeneous infrastructure
- TLS/mTLS — Provides cryptographic authentication and encryption for all network communications, mandatory for enterprise permissioned blockchain
- LevelDB/CouchDB — Enables flexible state management with support for both key-value and document-based query patterns
⚖️Trade-offs already made
-
Permissioned (vs. permissionless) blockchain
- Why: Aligns with enterprise requirements for known identities, regulatory compliance, and performance predictability
- Consequence: Eliminates proof-of-work consensus overhead but requires PKI infrastructure and identity management
-
Pluggable consensus (vs. fixed protocol)
- Why: Allows organizations to choose consensus mechanisms matching their fault tolerance and throughput requirements
- Consequence: Adds implementation complexity; ordering service is a critical component requiring careful security review
-
Separate endorsement from ordering
- Why: Enables validation of chaincode execution before ordering, improving transaction throughput and reducing invalid blocks
- Consequence: Requires careful MVCC handling and state validation logic; chaincode execution becomes non-deterministic without isolation
-
Chaincode-as-a-Service (CaaS) deployment model
- Why: Decouples chaincode lifecycle from peer node, allowing independent updates and heterogeneous language support
- Consequence: Network management complexity increases; requires external container orchestration (Kubernetes) for production
🚫Non-goals (don't propose these)
- Does not provide a built-in UI or wallet—these are external client responsibilities
- Does not implement proof-of-work or stake-based consensus—consensus is pluggable and orderer-managed
- Does not support anonymous transactions—all participants must be enrolled in the PKI
- Does not guarantee Byzantine fault tolerance in chaincode execution—depends on endorsement policy design
- Does not provide automatic sharding or unlimited horizontal scaling—scaling is managed at the ordering service and channel level
🪤Traps & gotchas
ccaas_builder/ is a separate Go module (go.mod at ccaas_builder/go.mod, not root) so go mod tidy in root won't affect it—must cd ccaas_builder && go mod tidy. Chaincode container builds require Docker daemon running. The testdata/ directories (ccaas_builder/cmd/detect/testdata/validtype/) contain fixture metadata.json files that must match specific schema for tests to pass. Network deployments require coordinated updates across all peers/orderers (version skew can break consensus). Setup_hsm.sh is optional but chaincode signing uses keys from HSM or local PKCS11 modules if configured.
🏗️Architecture
💡Concepts to learn
- Permissioned Consensus (BFT/Kafka/Raft) — Fabric's pluggable consensus allows ordering nodes to agree on transaction order in a crash-tolerant manner; choosing the right backend (PBFT for safety, Raft for simplicity) directly impacts network fault tolerance and finality guarantees.
- Channel-Scoped Ledgers — Channels in Fabric isolate smart contract execution and ledger data between consortiums members; you must understand channels to implement private data handling and multi-tenant networks.
- Chaincode Lifecycle (LSCC, Endorsement Policy) — Fabric separates chaincode install/approve/commit phases and enforces endorsement policies (e.g., 'peer1 AND peer2 must sign'); misunderstanding this lifecycle causes deployment failures and unexpected transaction rejections.
- MVCC (Multi-Version Concurrency Control) for State DB — Fabric uses MVCC to detect read-write conflicts during transaction simulation; a transaction fails validation if a key it read was modified by another committed transaction, preventing race conditions in deterministic chaincode.
- Deterministic Chaincode Execution — Smart contracts must produce identical output across all endorsing peers given the same input and state; non-determinism (randomness, timestamps, network calls) breaks consensus and requires chaincode design discipline.
- Endorsement and Validation — Transactions are endorsed by specified peers before being ordered; validators later re-execute and verify endorsements—understanding this split-execution model is critical for debugging transaction rejections and designing secure policies.
- Chaincode-as-a-Service (CaaS) Buildpack — The ccaas_builder/ submodule implements the detect/build/release lifecycle for running chaincode outside the Fabric peer process; essential for running chaincode in external container registries or CI/CD pipelines instead of peer-managed containers.
🔗Related repos
hyperledger/fabric-samples— Official runnable example networks and chaincode samples that demonstrate Fabric peer/orderer deployment and smart contract patterns.hyperledger/fabric-chaincode-go— Go SDK for writing chaincode (smart contracts); provides the shim interfaces that chaincode must import to interact with ledger state.hyperledger/fabric-ca— Certificate Authority companion service for managing identities and issuing X.509 certs used by Fabric peers/clients for authentication.hyperledger/fabric-sdk-go— Client SDK for Go applications to submit transactions and query chaincode; bridges enterprise apps to Fabric networks.couchdb/couchdb— Optional state database backend (alternative to LevelDB) for storing and querying ledger data with rich indexing and JSON-QL.
🪄PR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add integration tests for ccaas_builder release command with real Docker scenarios
The ccaas_builder/cmd/release/main_test.go exists but likely has limited coverage for actual container image building and release workflows. Given that ccaas_builder is responsible for building and releasing chaincode-as-a-service images, comprehensive integration tests simulating real Docker operations (image tagging, registry pushes, manifest creation) would improve reliability and catch regressions in the release pipeline.
- [ ] Examine ccaas_builder/cmd/release/main.go to identify untested code paths
- [ ] Review existing ccaas_builder/cmd/release/main_test.go to identify coverage gaps
- [ ] Create integration test suite that mocks or uses a local Docker daemon to test image building, tagging, and pushing workflows
- [ ] Add test cases for error scenarios (registry auth failures, image push failures, malformed metadata)
- [ ] Update CI workflow (.github/workflows/verify-build.yml) to run these tests in a container environment
Add comprehensive unit tests for cmd/common/comm/client.go TLS and mTLS scenarios
The cmd/common/comm/ package contains client.go with TLS configuration logic and testdata for certificates/keys, but client_test.go likely has incomplete coverage of mTLS connection establishment, certificate validation failures, and edge cases. This is critical for an enterprise permissioned ledger framework where secure peer-to-peer communication is essential.
- [ ] Audit cmd/common/comm/client_test.go against cmd/common/comm/client.go for untested functions and error paths
- [ ] Add test cases for certificate validation failures, expired certs, and mismatched cert/key pairs using testdata in cmd/common/comm/testdata/
- [ ] Add tests for mTLS connection establishment with client authentication
- [ ] Add tests for hostname verification and SNI configurations
- [ ] Add tests for graceful handling of invalid certificate configurations
Add GitHub Actions workflow to validate and test signer functionality across different key formats
The cmd/common/signer/ module handles cryptographic signing operations with testdata containing private keys in different formats (the '8150cb2d..._sk' file and 'broken_private_key'). Currently, there's no dedicated GitHub Actions workflow validating signer functionality. A new workflow would ensure signing operations work correctly and fail safely with malformed keys, preventing regressions in this security-critical component.
- [ ] Review cmd/common/signer/signer.go and signer_test.go to identify test scenarios
- [ ] Create a new GitHub Actions workflow file (.github/workflows/signer-tests.yml) that runs signer unit tests in isolation
- [ ] Add matrix testing for different Go versions to ensure compatibility
- [ ] Add tests validating behavior with cmd/common/signer/testdata/signer/broken_private_key to ensure error handling
- [ ] Integrate this workflow into the main CI pipeline by adding it to verify-build.yml or as a required check in branch protection rules
🌿Good first issues
- Add integration tests for ccaas_builder/cmd/release/main.go to verify release phase with mocked container registries (currently only main.go exists without corresponding _test.go or integration test suite).
- Document the metadata.json schema for chaincode-as-a-service in a prose specification under docs/ or CONTRIBUTING.md, as only testdata examples exist at ccaas_builder/cmd/detect/testdata/ (new contributors struggle with required fields).
- Add shell linting (shellcheck) to verify-build.yml workflow to catch issues in ci/scripts/ (e.g., setup_hsm.sh, create_binary_package.sh); currently only Go and Docker artifacts are scanned.
⭐Top contributors
Click to expand
Top contributors
- @pfi79 — 46 commits
- @dependabot[bot] — 6 commits
- @sridhar-panigrahi — 5 commits
- @bestbeforetoday — 3 commits
- @remo-lab — 3 commits
📝Recent commits
Click to expand
Recent commits
6a67397— Recover from panic in HandleTransaction to prevent peer crash (#5472) (Jaskirat-s7)da3c2a8— Bump SmartBFT library to v1.0.1 (#5470) (tock-ibm)8e8b3a5— fix broken-link-checker workflow bugs (#5468) (mishalshanavas)800f043— Bump go.opentelemetry.io/otel in the go_modules group across 1 directory (#5461) (dependabot[bot])391bddc— fix test TestConcurrentCreateLedgerFromSnapshot (#5465) (pfi79)b960acc— bump go.etcd.io/etcd to v3.6.10 (#5462) (pfi79)4dea1df— fix test in registrar remove channel. I have stabilized the execution of some tests (#5466) (pfi79)27deb6d— fix integration raft tests and using Eventually (#5454) (pfi79)2190a1c— Fixed an error in building the plan for the endorsement. Periodically, the `endorse retry - org3 fail & 1 org2 peer fail (pfi79)de72085— chore: fix function name in GetQueryType comment (#5452) (stringsbuilder)
🔒Security observations
Hyperledger Fabric demonstrates good security practices with established security reporting procedures, CI/CD security workflows, and CII Best Practices certification. However, the codebase has notable technical debt: Go 1.16 is significantly outdated and unsupported, and the pkg/errors dependency is unmaintained. Test credentials in version control require vigilant handling. The project would benefit from updating the Go version, modernizing dependencies, and implementing automated SBOM/dependency scanning. Overall security posture is reasonable for an enterprise blockchain framework, but immediate attention to the Go version update is recommended.
- Medium · Outdated Go Version in go.mod —
ccaas_builder/go.mod. The ccaas_builder module specifies 'go 1.16' which was released in February 2021 and is now significantly outdated. Go 1.16 no longer receives security updates, leaving the project vulnerable to known security issues in the Go runtime and standard library. Fix: Update to a currently supported Go version (1.21 or later). This will ensure access to security patches and bug fixes. Update the go directive to at least 'go 1.21' and test thoroughly. - Medium · Transitive Dependency Risk via pkg/errors —
ccaas_builder/go.mod. The dependency 'github.com/pkg/errors v0.9.1' is outdated and no longer actively maintained. While the package itself is relatively simple, using unmaintained dependencies increases risk of unpatched vulnerabilities and compatibility issues. Fix: Consider replacing 'github.com/pkg/errors' with the standard library 'errors' package (available in Go 1.13+) or 'fmt.Errorf()' for error wrapping. If direct compatibility is needed, investigate alternative actively-maintained error handling libraries. - Low · Test Data Credentials in Repository —
cmd/common/signer/testdata/signer/, cmd/common/comm/testdata/. The repository contains test data with certificate and key files (e.g., cmd/common/signer/testdata/signer/, cmd/common/comm/testdata/). While these are clearly marked as test data and appear to be self-signed certificates for testing, storing cryptographic material in version control requires careful handling. Fix: Ensure these test credentials are not used in any production context. Document that these are test-only artifacts. Consider adding a prominent README in test data directories. Implement pre-commit hooks to prevent accidental inclusion of real credentials. - Low · Potential Code Injection via External Input in CLI —
cmd/common/cli.go. The file 'cmd/common/cli.go' processes command-line arguments without explicit documentation of input validation. CLI tools processing user input without proper sanitization could be vulnerable to code injection or path traversal attacks. Fix: Review CLI argument handling to ensure: (1) File paths are validated and canonicalized, (2) No shell command execution from user input, (3) Input length limits are enforced, (4) Special characters are properly handled. Add comprehensive input validation tests. - Low · Missing SBOM and Dependency Tracking —
ccaas_builder/go.sum, root go.mod files (not shown). While the project has go.sum files for dependency tracking, there is no visible Software Bill of Materials (SBOM) generation or third-party dependency scanning configuration mentioned in the provided structure. Fix: Implement SBOM generation as part of the build process. Integrate automated dependency scanning tools (e.g., 'go list -json all', GitHub Dependabot, or Snyk) into CI/CD pipelines to detect vulnerable dependencies before release.
LLM-derived; treat as a starting point, not a security audit.
👉Where to read next
- Open issues — current backlog
- Recent PRs — what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.