前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >区块链:fabric 管道创建测试记录

区块链:fabric 管道创建测试记录

作者头像
heidsoft
发布2018-12-17 11:04:45
8460
发布2018-12-17 11:04:45
举报

目标创建heidsoft fabric 区块链网络

生成创世块

代码语言:javascript
复制
configtxgen -profile TwoOrgsOrdererGenesis -outputBlock ./channel-artifacts/heidsoft/genesis.block

生成Channel配置区块

代码语言:javascript
复制
configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/heidsoft/channel.tx -channelID heidsoft

configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/heidsoft/Org1MSPanchors.tx -channelID heidsoft -asOrg Org1MSP

configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/heidsoft/Org2MSPanchors.tx -channelID heidsoft -asOrg Org2MSP

创建管道

代码语言:javascript
复制
export ORDERER_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

peer channel create -o orderer.example.com:7050 -c heidsoft -f ./channel-artifacts/heidsoft/channel.tx --tls true --cafile $ORDERER_CA

将区块加入到管道peer0.org1

代码语言:javascript
复制
root@2284e29f5b2a:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer channel join -b heidsoft.block
2018-11-21 05:33:27.606 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2018-11-21 05:33:27.669 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
root@2284e29f5b2a:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer channel list
2018-11-21 05:33:39.095 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
Channels peers has joined:
mychannel
heidsoft
root@2284e29f5b2a:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer channel join --help


root@2284e29f5b2a:/opt/gopath/src/github.com/hyperledger/fabric/peer# env|grep -i CORE_PEER_LOCALMSPID
CORE_PEER_LOCALMSPID=Org1MSP
root@2284e29f5b2a:/opt/gopath/src/github.com/hyperledger/fabric/peer# env|grep -i CORE_PEER_TLS_ROOTCERT_FILE
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
root@2284e29f5b2a:/opt/gopath/src/github.com/hyperledger/fabric/peer# env|grep -i CORE_PEER_MSPCONFIGPATH
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
root@2284e29f5b2a:/opt/gopath/src/github.com/hyperledger/fabric/peer# env|grep -i CORE_PEER_ADDRESS
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
root@2284e29f5b2a:/opt/gopath/src/github.com/hyperledger/fabric/peer#

加入peer1.org1

代码语言:javascript
复制
export CORE_PEER_LOCALMSPID="Org1MSP" 
export CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt 
export CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp 
export CORE_PEER_ADDRESS=peer1.org1.example.com:7051

root@2284e29f5b2a:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer channel join -b heidsoft.block
2018-11-21 05:42:05.118 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2018-11-21 05:42:05.205 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
root@2284e29f5b2a:/opt/gopath/src/github.com/hyperledger/fabric/peer#

加入peer0.org2

代码语言:javascript
复制
export CORE_PEER_LOCALMSPID="Org2MSP" 
export CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt 
export CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp 
export CORE_PEER_ADDRESS=peer0.org2.example.com:7051

root@2284e29f5b2a:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer channel join -b heidsoft.block
2018-11-21 05:44:53.250 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2018-11-21 05:44:53.327 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
root@2284e29f5b2a:/opt/gopath/src/github.com/hyperledger/fabric/peer#

加入peer1.org2

代码语言:javascript
复制
export CORE_PEER_LOCALMSPID="Org2MSP" 
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls/ca.crt 
export CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp 
export CORE_PEER_ADDRESS=peer1.org2.example.com:7051

root@2284e29f5b2a:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer channel join -b heidsoft.block
2018-11-21 05:47:30.079 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2018-11-21 05:47:30.165 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2018-11-24,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 云数智圈 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 目标创建heidsoft fabric 区块链网络
    • 生成创世块
      • 生成Channel配置区块
        • 创建管道
          • 将区块加入到管道peer0.org1
            • 加入peer1.org1
              • 加入peer0.org2
                • 加入peer1.org2
                领券
                问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档