Hyperledger Fabric 核心模块(2)configtxgen configtx.yaml配置文件
生活随笔
收集整理的這篇文章主要介紹了
Hyperledger Fabric 核心模块(2)configtxgen configtx.yaml配置文件
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1. Channel / 通道配置
要寫入創世區塊或配置交易的通道參數
Channel: &ChannelDefaults# 定義本層級的通道訪問策略,其權威路徑為 /Channel/<PolicyName>Policies:Readers:Type: ImplicitMetaRule: ANY Readers# Writes策略定義了調用Broadcast API提交交易的許可規則Writers:Type: ImplicitMetaRule: ANY Writers# Admin策略定義了修改本層級配置的許可規則Admins:Type: ImplicitMetaRule: MAJORITY Admins# Capabilities配置描通道層級的能力需求,這里直接引用# 前面Capabilities配置段中的ChannelCapabilities配置項Capabilities:<<: *ChannelCapabilities2. Orderer / 排序節點配置
定義要編碼寫入創世區塊或通道交易的排序節點參數,比如共識協議。
Orderer: &OrdererDefaults# 排序節點類型用來指定要啟用的排序節點實現,不同的實現對應不同的共識算法。# 目前可用的類型為:solo和kafkaOrdererType: soloAddresses:- orderer0.example.com:7050BatchTimeout: 2sBatchSize:MaxMessageCount: 10AbsoluteMaxBytes: 98 MBPreferredMaxBytes: 512 KBMaxChannels: 0Kafka:Brokers:- kafka0:9092- kafka1:9092- kafka2:9092- kafka3:9092Organizations:# 定義本層級的排序節點策略,其權威路徑為 /Channel/Orderer/<PolicyName>Policies:Readers:Type: ImplicitMetaRule: ANY ReadersWriters:Type: ImplicitMetaRule: ANY WritersAdmins:Type: ImplicitMetaRule: MAJORITY Admins# BlockValidation配置項指定了哪些簽名必須包含在區塊中,以便對等節點進行驗證BlockValidation:Type: ImplicitMetaRule: ANY Writers# Capabilities配置描述排序節點層級的能力需求,這里直接引用# 前面Capabilities配置段中的OrdererCapabilities配置項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 / 組織機構配置
Organizations配置段用來定義組織機構實體,以便在后續配置中引用。例如,下面的配置文件中,定義了三個機構,可以分別使用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 / 應用配置
Application配置段用來定義要寫入創世區塊或配置交易的應用參數
總結
以上是生活随笔為你收集整理的Hyperledger Fabric 核心模块(2)configtxgen configtx.yaml配置文件的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 区块链BaaS云服务(21)腾讯CCGP
- 下一篇: 区块链BaaS云服务(21)腾讯CCGP