多个对等节点,但只有一个开发人员

时间:2019-01-31 16:01:36

标签: hyperledger-fabric hyperledger-composer

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

问题是,当我执行 SELECT DISTINCT CreationDate,DQ.OpenIssues FROM Issues I CROSS APPLY (SELECT COUNT(0) OpenIssues FROM Issues I2 WHERE I2.CreationDate <= I.CreationDate AND (I.CreationDate < I2.CompletionDate or YEAR(I2.CompletionDate) = 1900) ) DQ 时,我仅看到一个“链式代码容器” dev-peer0.org1,据我所知,每个对等节点都应有dev-peer({{3} })

Extra dev peers in hyperledger fabric

这是我的连接配置文件

docker stats

任何人都知道什么是错的?

3 个答案:

答案 0 :(得分:1)

对等安装链代码并实例化该链代码时,会自动生成dev-peer容器。

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

您可以阅读Byfn项目here

的说明

答案 1 :(得分:0)

知道了。问题是我没有更改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

答案 2 :(得分:0)

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

有关此过程的更多详细信息,请参见下面提到的官方文档。(搜索文字“ dev-peer”)。

此文档说明了如何为byfn示例创建每个chaincode容器。

https://github.com/hyperledger/fabric/blob/release-1.4/docs/source/build_network.rst

例如:[for 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.**