Fabric 账号的配置以及使用地方

Fabric 中Orderer、Peer、客户端SDK、CLI接口等所有操作都需要账号。Fabric中每个具体的动作,创建通道、部署chaincode、调用chaincode等都需要指定的账号。每个Peer向Orderer发送请求的时候也需要Peer的账号:

#Orderer启动的账号路径
#路径
/opt/fabric/src/src/github.com/hyperledger/fabric/examples/e2e_cli_examples/
crypto-config/ordererOrganizations/examples.com/orderers/orderer.examples.com/
msp

#Peer启动的账号路径
#路径
/opt/fabric/src/src/github.com/hyperledger/fabric/examples/e2e_cli_examples/
crypto-config/peerOrganizations/org1.examples.com/peers/peer0.org1.examples.com/
msp

#创建Channel的账号路径
#路径:
/opt/fabric/src/src/github.com/hyperledger/fabric/examples/e2e_cli_examples/
crypto-config/peerOrganizations/org1.examples.com/users/Admin@org1.examples.com/
msp


#我们将相同的部分隐藏后对比如下

#Orderer启动的账号路径
#全路径
ordererOrganizations/examples.com/orderers/orderer.examples.com/msp

#Peer启动的账号路径
#全路径
peerOrganizations/org1.examples.com/peers/peer0.org1.examples.com/msp

#创建Channel的账号路径
#全路径:
peerOrganizations/org1.examples.com/users/Admin@org1.examples.com/msp

通过上面账号我们可以发现:

Peer和Orderer都有属于自己的账号,创建Channel使用的是用户账号,其中Peer和创建Channel的用户账号属于某个组织,而Orderer的启动账号只属于他自己。

这里需要注意,用户账号在很多操作中都会用到,而且很多操作的错误都是用户账号的路径设置不当引起的。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值