Настройка подмножества заказчиков для канала приложения RAFT - PullRequest
0 голосов
/ 07 апреля 2020

Я пытаюсь создать канал приложения, используя first-network из fabric-samples.

  1. Я создаю развертывание для запуска 4 упорядочивающих узлов, работающих в кластере RAFT. Ниже приведен раздел профиля, используемый для создания блока Orderer Genesis в файле configtx.yaml.

    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: 8050
                  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: 9050
                  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
                - Host: orderer4.example.com
                  Port: 10050
                  ClientTLSCert: crypto-config/ordererOrganizations/example.com/orderers/orderer4.example.com/tls/server.crt
                  ServerTLSCert: crypto-config/ordererOrganizations/example.com/orderers/orderer4.example.com/tls/server.crt
            Addresses:
                - orderer.example.com:7050
                - orderer2.example.com:8050
                - orderer3.example.com:9050
                - orderer4.example.com:10050
            Organizations:
            - *OrdererOrg
            Capabilities:
                <<: *OrdererCapabilities
        Application:
            <<: *ApplicationDefaults
            Organizations:
            - <<: *OrdererOrg
        Consortiums:
            SampleConsortium:
                Organizations:
                - *Org1
                - *Org2
    
  2. Теперь я хочу создать канал приложения, который будет иметь только 3 упорядочивающих узла ( из приведенного 4): orderer, orderer2, orderer3. Поэтому я установил секцию профиля для канала приложения следующим образом (в файле configtx.yaml):

    TwoOrgsChannel:
        Consortium: SampleConsortium
        <<: *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: 8050
                  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: 9050
                  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:8050
                - orderer3.example.com:9050
            Organizations:
                - *OrdererOrg
            Capabilities:
                <<: *OrdererCapabilities
        Application:
            <<: *ApplicationDefaults
            Organizations:
                - *Org1
                - *Org2
            Capabilities:
                <<: *ApplicationCapabilities
    
  3. Я использую сценарий byfn.sh по умолчанию для подключения к сети.

Но, тем не менее, когда я пытаюсь извлечь блок конфигурации канала приложения из контейнера cli с использованием среды orderer4, я могу это успешно выполнить и расшифровать его до JSON file, я вижу, что все 4 заказчика входят в раздел consenters канала приложения, а также адрес каждого заказчика присутствует в разделе address orderer *1030*.

Итак, почему канал приложения не запускается только с первых 3-х заказчиков, несмотря на то, что в качестве согласующих выступают только те?

1 Ответ

1 голос
/ 07 апреля 2020

Команда создания канала должна содержать аргумент -channelCreateTxBaseProfile, а значением аргумента будет имя профиля происхождения заказчика (здесь SampleMultiNodeEtcdRaft).

Кроме того, удостоверение, пытающееся выполнить команду peer channel create, должно удовлетворять следующему списку ACL: /Channel/Orderer/ConsensusType (который по умолчанию настроен на следующую политику: /Channel/Application/Admins).

...