You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Hyperledger Fabric联盟链中各Peer节点及参与企业如何获取账本副本?

How Peer Nodes Obtain Ledger Copies in a Hyperledger Fabric Business Network

Let's start with the core mechanics, then walk through exactly what Enterprises A, B, and C need to do—no overly jargon-heavy stuff, promise.

Core Ledger Replication Logic

First off, in Hyperledger Fabric, you don't "download" a ledger copy like a zip file. Ledgers are automatically synced across all peer nodes in the same channel once a transaction is finalized. Here's the flow:

  • When a transaction gets endorsed and approved, the ordering service packages it into a block.
  • This block is broadcast to every peer in the channel.
  • Each peer validates the block's transactions, then appends it to their local ledger. So replication is built into the network's core workflow.

Step-by-Step for Enterprises A, B, C

Let's split this based on whether the enterprise is the network initiator or a late joiner:

1. Enterprise A (The Network Initiator)

Since A is setting up the network, they don't need to "obtain" a ledger—they create it from scratch:

  • They will need Hyperledger Fabric binaries (or container images) to run peers, orderers, and other core components. If using Kubernetes, they can deploy these via Helm charts or custom manifests (no need to reinvent the wheel here).
  • Use the configtxgen tool to generate the channel genesis block, then run peer channel join -b <channel-block-file> to connect their peer to the new channel. The initial ledger is created the moment their peer joins.

2. Enterprises B & C (Joining A's Existing Network)

They don't have to build an entire Kube cluster unless they want to host their own peer nodes (which is highly recommended for production—data sovereignty matters!). Here are their options:

  • Option 1: Host Your Own Peer Nodes (Production-Grade)
    1. Install Hyperledger Fabric binaries (or use pre-built containers) and set up a Kubernetes cluster (managed services like EKS/GKE work great too) to run your peer.
    2. Get the channel's genesis block (or latest config block) from Enterprise A—this is the "key" to joining the channel.
    3. Run peer channel join -b <block-file> to connect your peer to the channel. Once joined, your peer will automatically sync all historical ledger blocks from other peers in the channel—no manual download needed.
    4. Use the connection profile (a JSON config file, sometimes referred to as a "card" in older Fabric Composer tooling) shared by A. This file tells your peer how to connect to the network's ordering service, authenticate with TLS certificates, and interact with other nodes.
  • Option 2: Use a Hosted Peer (Testing Only)
    If you're just testing and don't want to manage infrastructure, you could use a peer hosted by A or a third party. But note: you won't have full control over your ledger copy here. You'll still need the connection profile to interact with the network, but the ledger lives on the hosted peer.

Quick Myth Busting

  • You don't need a full Kube cluster to join a network. For testing, you can run a single peer on your local machine. But production always requires hosting your own peers to ensure you have an immutable, independent ledger copy.
  • "Cards" are a legacy Fabric Composer concept—modern Fabric uses connection profiles (JSON files) for network configuration. The initiator will share all necessary certificates and configs so your peer can authenticate and join the channel.

内容的提问来源于stack exchange,提问作者atkayla

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 11:08:48