上一篇整理了core.yaml,这篇文章梳理一下configtx.yaml配置文件的内容,都是大概地标注了一下,方便自己日后更改项目配置。如果整理的有错误,欢迎评论和私信!
在生成组织结构与身份证书、密钥之后,接下来使用 configtxgen 工具创建配置网络的文件:创世区块、应用通道配置交易、锚节点更新配置交易。应用通道配置交易在应用通道创建时广播给 orderer;锚节点更新配置交易指定应用通道上每个组织的锚节点。上述信息的配置被定义在 configtx.yaml 文件中。
configtx.yaml文件分为几大section:Organizations, Capabilities, Application, Orderer, CHANNEL, Profile。
下面是部分注释
##################################################################
# Section: Organizations
##################################################################
Organizations:
- &OrdererOrg //orderer组织配置
Name: OrdererOrg
ID: OrdererMSP
MSPDir: ../organizations/ordererOrganizations/flight.com/msp //msp配置路径
Policies: //定义策略
Readers:
Type: Signature
Rule: "OR('OrdererMSP.member')"
Writers:
Type: Signature
Rule: "OR('OrdererMSP.member')"
Admins:
Type: Signature
Rule: "OR('OrdererMSP.admin')"
OrdererEndpoints:
- orderer.flight.com:7050
//下面是具体的各个组织配置
- &Applicant
Name: ApplicantMSP
ID: ApplicantMSP
MSPDir: ../organizations/peerOrganizations/applicant.flight.com/msp
Policies:
Readers:
Type: Signature
Rule: "OR('ApplicantMSP.admin', 'ApplicantMSP.peer', 'ApplicantMSP.client')"
Writers: