Hyperledger Fabric 核心模块(2)configtxgen configtx.yaml配置文件
生活随笔
收集整理的這篇文章主要介紹了
Hyperledger Fabric 核心模块(2)configtxgen configtx.yaml配置文件
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
1. Channel / 通道配置
要寫入創(chuàng)世區(qū)塊或配置交易的通道參數(shù)
Channel: &ChannelDefaults# 定義本層級的通道訪問策略,其權(quán)威路徑為 /Channel/<PolicyName>Policies:Readers:Type: ImplicitMetaRule: ANY Readers# Writes策略定義了調(diào)用Broadcast API提交交易的許可規(guī)則Writers:Type: ImplicitMetaRule: ANY Writers# Admin策略定義了修改本層級配置的許可規(guī)則Admins:Type: ImplicitMetaRule: MAJORITY Admins# Capabilities配置描通道層級的能力需求,這里直接引用# 前面Capabilities配置段中的ChannelCapabilities配置項(xiàng)Capabilities:<<: *ChannelCapabilities2. Orderer / 排序節(jié)點(diǎn)配置
定義要編碼寫入創(chuàng)世區(qū)塊或通道交易的排序節(jié)點(diǎn)參數(shù),比如共識協(xié)議。
Orderer: &OrdererDefaults# 排序節(jié)點(diǎn)類型用來指定要啟用的排序節(jié)點(diǎn)實(shí)現(xiàn),不同的實(shí)現(xiàn)對應(yīng)不同的共識算法。# 目前可用的類型為:solo和kafkaOrdererType: soloAddresses:- orderer0.example.com:7050BatchTimeout: 2sBatchSize:MaxMessageCount: 10AbsoluteMaxBytes: 98 MBPreferredMaxBytes: 512 KBMaxChannels: 0Kafka:Brokers:- kafka0:9092- kafka1:9092- kafka2:9092- kafka3:9092Organizations:# 定義本層級的排序節(jié)點(diǎn)策略,其權(quán)威路徑為 /Channel/Orderer/<PolicyName>Policies:Readers:Type: ImplicitMetaRule: ANY ReadersWriters:Type: ImplicitMetaRule: ANY WritersAdmins:Type: ImplicitMetaRule: MAJORITY Admins# BlockValidation配置項(xiàng)指定了哪些簽名必須包含在區(qū)塊中,以便對等節(jié)點(diǎn)進(jìn)行驗(yàn)證BlockValidation:Type: ImplicitMetaRule: ANY Writers# Capabilities配置描述排序節(jié)點(diǎn)層級的能力需求,這里直接引用# 前面Capabilities配置段中的OrdererCapabilities配置項(xiàng)Capabilities:<<: *OrdererCapabilities eg. Orderer: &OrdererDefaultsOrdererType: etcdraft Addresses:- orderer.example.com:7050EtcdRaft:Consenters:- Host: orderer.example.comPort: 7050ClientTLSCert: ../organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.crtServerTLSCert: ../organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.crtBatchTimeout: 2s BatchSize: MaxMessageCount: 10 AbsoluteMaxBytes: 99 MB PreferredMaxBytes: 512 KB Organizations: Policies:Readers:Type: ImplicitMetaRule: "ANY Readers"Writers:Type: ImplicitMetaRule: "ANY Writers"Admins:Type: ImplicitMetaRule: "MAJORITY Admins"# BlockValidation specifies what signatures must be included in the block# from the orderer for the peer to validate it.BlockValidation:Type: ImplicitMetaRule: "ANY Writers"3. Organizations / 組織機(jī)構(gòu)配置
Organizations配置段用來定義組織機(jī)構(gòu)實(shí)體,以便在后續(xù)配置中引用。例如,下面的配置文件中,定義了三個(gè)機(jī)構(gòu),可以分別使用ExampleCom、Org1ExampleCom和Org2ExampleCom引用其配置:
Organizations:- &ExampleComName: ExampleComID: example.comAdminPrincipal: Role.ADMINMSPDir: ./ordererOrganizations/example.com/mspPolicies:Readers:Type: SignatureRule: OR('example.com.member')Writers:Type: SignatureRule: OR('example.com.member')Admins:Type: SignatureRule: OR('example.com.admin')Endorsement:Type: SignatureRule: OR('example.com.member')- &Org1ExampleComName: Org1ExampleComID: org1.example.comMSPDir: ./peerOrganizations/org1.example.com/mspAdminPrincipal: Role.ADMINAnchorPeers:- Host: peer0.org1.example.comPort: 7051Policies:Readers:Type: SignatureRule: OR('org1.example.com.member')Writers:Type: SignatureRule: OR('org1.example.com.member')Admins:Type: SignatureRule: OR('org1.example.com.admin')Endorsement:Type: SignatureRule: OR('org1.example.com.member')- &Org2ExampleComName: Org2ExampleComID: org2.example.comMSPDir: ./peerOrganizations/org2.example.com/mspAdminPrincipal: Role.ADMINAnchorPeers:- Host: peer0.org2.example.comPort: 7051Policies:Readers:Type: SignatureRule: OR('org2.example.com.member')Writers:Type: SignatureRule: OR('org2.example.com.member')Admins:Type: SignatureRule: OR('org2.example.com.admin')Endorsement:Type: SignatureRule: OR('org2.example.com.member')4. Application / 應(yīng)用配置
Application配置段用來定義要寫入創(chuàng)世區(qū)塊或配置交易的應(yīng)用參數(shù)
總結(jié)
以上是生活随笔為你收集整理的Hyperledger Fabric 核心模块(2)configtxgen configtx.yaml配置文件的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 区块链BaaS云服务(21)腾讯CCGP
- 下一篇: 区块链BaaS云服务(21)腾讯CCGP