HyperLedger Fabric 1.4.4 raft共识集群搭建

前言

因为HyperLedger Fabric后面的版本会将kafka共识抛弃,所以特此记录搭建raft共识集群流程。
相比较于kafka共识集群raft共识集群的搭建流程更为简化。
本文只记录了和搭建kafka共识集群中步骤不一样的部分,所以可能需要先看一下我的另一篇博客。
HyperLedger Fabric 1.4.4搭建基于多orderer节点的kafka共识集群

流程

修改configtx.yaml文件

因为我这里是3个orderer节点作为排序,并且只有一个Org,所以修改configtx.yaml文件,将SampleMultiNodeEtcdRaft的内容修改为如下:

    SampleMultiNodeEtcdRaft:
        <<: *ChannelDefaults
        Capabilities:
            <<: *ChannelCapabilities
        Orderer:
            <<: *OrdererDefaults
            OrdererType: etcdraft
            EtcdRaft:
                Consenters:
                - Host: orderer.example.com
                  Port: 7050
                  ClientTLSCert: crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.crt
                  ServerTLSCert: crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.crt
                - Host: orderer2.example.com
                  Port: 7050
                  ClientTLSCert: crypto-config/ordererOrganizations/example.com/orderers/orderer2.example.com/tls/server.crt
                  ServerTLSCert: crypto-config/ordererOrganizations/example.com/orderers/orderer2.example.com/tls/server.crt
                - Host: orderer3.example.com
                  Port: 7050
                  ClientTLSCert: crypto-config/ordererOrganizations/example.com/orderers/orderer3.example.com/tls/server.crt
                  ServerTLSCert: crypto-config/ordererOrganizations/example.com/orderers/orderer3.example.com/tls/server.crt
            Addresses:
                - orderer.example.com:7050
                - orderer2.example.com:7050
                - orderer3.example.com:7050

            Organizations:
            - *OrdererOrg
            Capabilities:
                <<: *OrdererCapabilities
        Application:
            <<: *ApplicationDefaults
            Organizations:
            - <<: *OrdererOrg
        Consortiums:
            SampleConsortium:
                Organizations:
                - *Org1

生成创世区块

因为排序方式的改变,所以生成创世区块的命令修改为如下:
configtxgen -profile SampleMultiNodeEtcdRaft -channelID $SYS_CHANNEL -outputBlock ./channel-artifacts/genesis.block

启动容器

启动容器的时候将yaml文件中的kafkazookeeper相关的内容都去掉即可。

你可能感兴趣的:(区块链)