Hyperledger fabric 多个对等节点,但只有一个开发节点

Hyperledger fabric 多个对等节点,但只有一个开发节点,hyperledger-fabric,hyperledger-composer,Hyperledger Fabric,Hyperledger Composer,我有一个Fabric Composer网络,在一个组织中有3个对等点 问题是,当我执行docker stats时,我只看到一个“链码容器”dev-peer0.org1,据我所知,每个对等节点都应该有dev-peer() 这是我的连接配置文件 { "name": "hlfv1", "x-type": "hlfv1", "x-commitTimeout": 300, "version": "1.0.0", "client": { "organ

我有一个Fabric Composer网络,在一个组织中有3个对等点

问题是,当我执行
docker stats
时,我只看到一个“链码容器”dev-peer0.org1,据我所知,每个对等节点都应该有dev-peer()

这是我的连接配置文件

{
    "name": "hlfv1",
    "x-type": "hlfv1",
    "x-commitTimeout": 300,
    "version": "1.0.0",
    "client": {
        "organization": "Org1",
        "connection": {
            "timeout": {
                "peer": {
                    "endorser": "300",
                    "eventHub": "300",
                    "eventReg": "300"
                },
                "orderer": "300"
            }
        }
    },
    "channels": {
        "composerchannel": {
            "orderers": [
                "orderer.example.com"
            ],
            "peers": {
                "peer0.org1.example.com": {
                    "endorsingPeer": true,
                    "chaincodeQuery": true,
                    "eventSource": true
                },
                "peer1.org1.example.com": {
                    "endorsingPeer": true,
                    "chaincodeQuery": true,
                    "eventSource": true
                },
                "peer2.org1.example.com": {
                    "endorsingPeer": true,
                    "chaincodeQuery": true,
                    "eventSource": true
                }
            }
        }
    },
    "organizations": {
        "Org1": {
            "mspid": "Org1MSP",
            "peers": [
                "peer0.org1.example.com",
                "peer1.org1.example.com",
                "peer2.org1.example.com"
            ],
            "certificateAuthorities": [
                "ca.org1.example.com"
            ]
        }
    },
    "orderers": {
        "orderer.example.com": {
            "url": "grpc://localhost:7050"
        }
    },
    "peers": {
        "peer0.org1.example.com": {
            "url": "grpc://localhost:7051"
        },
        "peer1.org1.example.com": {
            "url": "grpc://localhost:8051"
        },
        "peer2.org1.example.com": {
            "url": "grpc://localhost:9051"
        }
    },
    "certificateAuthorities": {
        "ca.org1.example.com": {
            "url": "http://localhost:7054",
            "caName": "ca.org1.example.com"
        }
    }
}

有人知道怎么回事吗?

当对等安装链码并实例化链码时,会自动生成开发对等容器

这意味着只有网络中的peer0.org1安装了链码


你可以阅读Byfn项目的说明,明白了吗。问题是我没有更改
startFabric.sh
脚本,所以我有3个对等节点在运行,但它们没有加入通道

下面是
startFabric.sh
的外观:

...

# Create the channel and join for peer 0
docker exec peer0.org1.example.com peer channel create -o orderer.example.com:7050 -c composerchannel -f /etc/hyperledger/configtx/composer-channel.tx
docker exec -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com/msp" peer0.org1.example.com peer channel join -b composerchannel.block

# Create the channel and join for peer 1
docker exec -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com/msp" peer1.org1.example.com peer channel fetch config -o orderer.example.com:7050 -c composerchannel
docker exec -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com/msp" peer1.org1.example.com peer channel join -b composerchannel_config.block

# Create the channel and join for peer 2
docker exec -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com/msp" peer2.org1.example.com peer channel fetch config -o orderer.example.com:7050 -c composerchannel
docker exec -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com/msp" peer2.org1.example.com peer channel join -b composerchannel_config.block

if [ "${FABRIC_DEV_MODE}" == "true" ]; then
    echo "Fabric Network started in chaincode development mode"
fi

仅当在通道上实例化链码时,才会创建容器。仅安装链码不会创建容器

关于这个过程的更多细节可以在下面提到的官方文件中找到。(搜索文本“dev peer”)

本文档解释了如何为byfn示例创建每个链码容器

例如:[对于dev-peer0.org2.example.com-mycc-1.0]

-  The chaincode is then "instantiated" on ``mychannel``. Instantiation
   adds the chaincode to the channel, starts the container for the target peer,
   and initializes the key value pairs associated with the chaincode.  The initial
   values for this example are ["a","100" "b","200"]. **This "instantiation" results
   in a container by the name of ``dev-peer0.org2.example.com-mycc-1.0`` starting.**