Тестовая сеть Hyperledger fabric-ошибка сети: x509: сертификат, подписанный неизвестным органом

#hyperledger-fabric #blockchain #hyperledger

Вопрос:

Я пытаюсь следовать написанию вашего первого руководства по применению, но я всегда получаю некоторые ошибки, которые я не знаю, как решить. При создании сети с ./network.sh до CreateChannel -c mychannel -ca, я получаю ошибку: Error: Post "https://localhost:7051/participation/v1/channels": dial tcp [::1]:7051: connectex: No connection could be made because the target machine actively refused it.

Я думаю, это потому, что мои изображения docker в данный момент не запущены, и я не могу запустить их вручную, потому что они сразу же прекращают работать. Поэтому я начал работать в сети с./network.sh вверх, и когда сеть включена, я попытался создать канал с CA с./network.sh до CreateChannel -c mychannel -ca, но я получаю следующую ошибку.

 $ ./network.sh createChannel -c mychannel -ca
    Creating channel 'mychannel'.
    If network is not up, starting nodes with CLI timeout of '5' tries and CLI delay of '3' seconds and using database 'leveldb
    Generating channel genesis block 'mychannel.block'
    /c/Users/marij/fabric-samples/bin/configtxgen
      configtxgen -profile TwoOrgsApplicationGenesis -outputBlock ./channel-artifacts/mychannel.block -channelID mychannel
    2021-07-04 20:48:01.621 CEST [common.tools.configtxgen] main -> INFO 001 Loading configuration
    2021-07-04 20:48:01.642 CEST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 002 orderer type: etcdraft
    2021-07-04 20:48:01.642 CEST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 003 Orderer.EtcdRaft.Options unset, setting to tick_interval:"500ms" election_tick:10 heartbeat_tick:1 max_inflight_blocks:5 snapshot_interval_size:16777216
    2021-07-04 20:48:01.642 CEST [common.tools.configtxgen.localconfig] Load -> INFO 004 Loaded configuration: C:Usersmarijfabric-samplestest-networkconfigtxconfigtx.yaml
    2021-07-04 20:48:01.661 CEST [common.tools.configtxgen] doOutputBlock -> INFO 005 Generating genesis block
    2021-07-04 20:48:01.661 CEST [common.tools.configtxgen] doOutputBlock -> INFO 006 Creating application channel genesis block
    2021-07-04 20:48:01.664 CEST [common.tools.configtxgen] doOutputBlock -> INFO 007 Writing genesis block
      res=0
    Creating channel mychannel
    Using organization 1
      osnadmin channel join --channelID mychannel --config-block ./channel-artifacts/mychannel.block -o localhost:7051 --ca-file /c/Users/marij/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --client-cert /c/Users/marij/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.crt --client-key /c/Users/marij/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.key
      res=1
      osnadmin channel join --channelID mychannel --config-block ./channel-artifacts/mychannel.block -o localhost:7051 --ca-file /c/Users/marij/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --client-cert /c/Users/marij/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.crt --client-key /c/Users/marij/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.key
      res=1
      osnadmin channel join --channelID mychannel --config-block ./channel-artifacts/mychannel.block -o localhost:7051 --ca-file /c/Users/marij/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --client-cert /c/Users/marij/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.crt --client-key /c/Users/marij/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.key
      res=1
      osnadmin channel join --channelID mychannel --config-block ./channel-artifacts/mychannel.block -o localhost:7051 --ca-file /c/Users/marij/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --client-cert /c/Users/marij/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.crt --client-key /c/Users/marij/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.key
      res=1
    Error: Post "https://localhost:7051/participation/v1/channels": x509: certificate signed by unknown authority
 

Может ли кто-нибудь помочь мне, потому что я впадаю в отчаяние.

Докер:

 CONTAINER ID   IMAGE                               COMMAND                  CREATED          STATUS                   PORTS                                                                                  NAMES
7f0e3eede2ff   hyperledger/fabric-tools:latest     "/bin/bash"              46 seconds ago   Up 45 seconds                                                                                                   cli
75f54baf5b97   hyperledger/fabric-orderer:latest   "orderer"                48 seconds ago   Up 47 seconds            0.0.0.0:7050->7050/tcp, :::7050->7050/tcp, 0.0.0.0:7053->7053/tcp, :::7053->7053/tcp   orderer.example.com
7c27e21bcd91   hyperledger/fabric-peer:latest      "peer node start"        48 seconds ago   Up 47 seconds            7051/tcp, 0.0.0.0:9051->9051/tcp, :::9051->9051/tcp                                    peer0.org2.example.com
dc39c53222d3   hyperledger/fabric-peer:latest      "peer node start"        48 seconds ago   Up 45 seconds            0.0.0.0:7051->7051/tcp, :::7051->7051/tcp                                              peer0.org1.example.com
c3ac36198cb8   graphprotocol/graph-node:latest     "/bin/sh -c start"       7 days ago       Exited (1) 7 days ago                                                                                           relaxed_mahavira
97ac82818ee5   postgres:12                         "docker-entrypoint.s…"   2 weeks ago      Up 44 minutes            0.0.0.0:5432->5432/tcp, :::5432->5432/tcp                                              postgres
db02ee15750d   4885c2bc6c0e                        "docker-entrypoint.s…"   6 weeks ago      Exited (0) 5 weeks ago                                                                                          nest-api
57c878b18e20   docker/getting-started              "/docker-entrypoint.…"   6 weeks ago      Exited (0) 6 weeks ago                                                                                          confi

     
 

Комментарии:

1. вы пытались удалить созданные папки, остановить контейнеры ( docker ps -aq | xargs docker kill ), удалить контейнеры ( docker ps -aq | xargs docker rm ) и запустить все заново?

2. Большое спасибо! Сеть успешно запустилась после того, как я это сделал!