Skip to content

Commit d72bae7

Browse files
committed
fix bug
1 parent b1bd103 commit d72bae7

File tree

1 file changed

+80
-1
lines changed

1 file changed

+80
-1
lines changed

doc/1.1.hyperledger1.0分布式环境搭建.md

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,85 @@ Shell> configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./city2MSPan
297297
298298
```
299299
300+
生成完相对应的交易配置文件后准备对应的`Orderer``Peer`节点的配置文件启动相关的节点,`Orderer`节点的启动需要两个配置文件`core.yaml``orderer.yaml`,配置文件的参数配置说明可以参见[工程中的配置文件](doc/hyperledger1.0.6_conf/etc_orderer/core.yaml) Peer节点启动配置文件需要`core.yaml`配置文件。准备好配置文件后登录到`Orderer`节点,与`Peer`节点,分配启动节点:
301+
302+
```bash
303+
# 启动Orderer节点
304+
Shell> orderer start
305+
306+
307+
# 启动Peer节点
308+
Shell> peer node start
309+
310+
```
311+
312+
启动节点后,我们就需要通过客户端操作`Peer`节点加入到超级账本中。
313+
314+
```bash
315+
# Setup 1 在组织1(city1)中创建epointchannel通道,通道只要在一个节点上创建即可,其他的节点只要操作peer节点加入即可
316+
Shell> export CHANNEL_NAME=epointchannel
317+
Shell> export FABRIC_CFG_PATH=$PWD
318+
Shell> export CORE_PEER_MSPCONFIGPATH=${FABRIC_CFG_PATH}/crypto-config/peerOrganizations/city1.epoint.com.cn/users/Admin\@city1.epoint.com.cn/msp
319+
Shell> export CORE_PEER_ADDRESS=peer0.city1.epoint.com.cn:7051
320+
Shell> export CORE_PEER_LOCALMSPID="city1MSP"
321+
Shell> peer channel create -o orderer1.epoint.com.cn:7050 -c $CHANNEL_NAME -f $CHANNEL_NAME.tx
322+
Shell> peer channel join -b epointchannel.block # 操作peer0.city1节点加入epointchannel通道
323+
2018-04-07 15:05:31.891 CST [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
324+
2018-04-07 15:05:31.939 CST [channelCmd] executeJoin -> INFO 002 Peer joined the channel!
325+
2018-04-07 15:05:31.939 CST [main] main -> INFO 003 Exiting.....
326+
327+
328+
329+
# Setup 2 添加peer1.city1加入通道
330+
331+
Shell> export CHANNEL_NAME=epointchannel
332+
Shell> export FABRIC_CFG_PATH=$PWD
333+
Shell> export CORE_PEER_MSPCONFIGPATH=${FABRIC_CFG_PATH}/crypto-config/peerOrganizations/city1.epoint.com.cn/users/Admin\@city1.epoint.com.cn/msp
334+
Shell> export CORE_PEER_ADDRESS=peer1.city1.epoint.com.cn:7051
335+
Shell> export CORE_PEER_LOCALMSPID="city1MSP"
336+
Shell> peer channel join -b $CHANNEL_NAME.block
337+
338+
# Setup 3 添加peer0.city2加入通道
339+
340+
Shell> export CHANNEL_NAME=epointchannel
341+
Shell> export FABRIC_CFG_PATH=$PWD
342+
Shell> export CORE_PEER_MSPCONFIGPATH=${FABRIC_CFG_PATH}/crypto-config/peerOrganizations/city2.epoint.com.cn/users/Admin\@city2.epoint.com.cn/msp
343+
Shell> export CORE_PEER_ADDRESS=peer0.city2.epoint.com.cn:7051
344+
Shell> export CORE_PEER_LOCALMSPID="city2MSP"
345+
Shell> peer channel join -b $CHANNEL_NAME.block
346+
347+
# Setup 4 添加peer1.city2加入通道
348+
349+
Shell> export CHANNEL_NAME=epointchannel
350+
Shell> export FABRIC_CFG_PATH=$PWD
351+
Shell> export CORE_PEER_MSPCONFIGPATH=${FABRIC_CFG_PATH}/crypto-config/peerOrganizations/city2.epoint.com.cn/users/Admin\@city2.epoint.com.cn/msp
352+
Shell> export CORE_PEER_ADDRESS=peer1.city2.epoint.com.cn:7051
353+
Shell> export CORE_PEER_LOCALMSPID="city2MSP"
354+
Shell> peer channel join -b $CHANNEL_NAME.block
355+
356+
```
357+
358+
现在所有的节点都已经加入到组织机构中了,现在更新组织机构中的锚节点
359+
```bash
360+
# Setup1 更新组织机构city1的锚节点信息
361+
Shell> export CHANNEL_NAME=epointchannel
362+
Shell> export FABRIC_CFG_PATH=$PWD
363+
Shell> export CORE_PEER_MSPCONFIGPATH=${FABRIC_CFG_PATH}/crypto-config/peerOrganizations/city1.epoint.com.cn/users/Admin\@city1.epoint.com.cn/msp
364+
Shell> export CORE_PEER_ADDRESS=peer0.city1.epoint.com.cn:7051
365+
Shell> export CORE_PEER_LOCALMSPID="city1MSP"
366+
Shell> peer channel update -o orderer1.epoint.com.cn:7050 -c epointchannel -f city1MSPanchors.tx
367+
368+
369+
# Setup2 更新组织机构city2的锚节点信息
370+
Shell> export CHANNEL_NAME=epointchannel
371+
Shell> export FABRIC_CFG_PATH=$PWD
372+
Shell> export CORE_PEER_MSPCONFIGPATH=${FABRIC_CFG_PATH}/crypto-config/peerOrganizations/city2.epoint.com.cn/users/Admin\@city2.epoint.com.cn/msp
373+
Shell> export CORE_PEER_ADDRESS=peer0.city2.epoint.com.cn:7051
374+
Shell> export CORE_PEER_LOCALMSPID="city2MSP"
375+
Shell> peer channel update -o orderer1.epoint.com.cn:7050 -c epointchannel -f city2MSPanchors.tx
376+
377+
378+
```
300379
301380
302381
@@ -306,5 +385,5 @@ Shell> configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./city2MSPan
306385
307386
308387
309-
## 、参考资料
388+
## 、参考资料
310389

0 commit comments

Comments
 (0)