Como posso configurar a malha hyperledger com vários hosts usando o Docker?
Eu trabalho no Hyperledger Fabric v1.0 e gostaria de fazer oObtendo a instalação trabalhar em vários hosts. Por enquanto, 2 seria ótimo.
Aqui está o que eu quero fazer:
Host1: inicie um pedido e 2 paresHost2: iniciar 1 pontoHost2: Um cliente cria um canal (usando o channel_test.sh atualizado com o IP dos bons hosts) e une todos os três paresHost1: Chame de deploy.js do exemplo fornecido para implantar o chaincodeEstou com um problema no terceiro passo. Acho que a criação do canal funciona, mas no registro de meus pares eu tenho os mesmos avisos nos 3 pares:
Remote endpoint claims to be a different peer, expected [host1 IP:8051] but got [172.17.0.4:7051]
Failed obtaining connection for 172.31.9.126:8051, PKIid:[49 55 50 ...] reason: Authentication failure
Parece que eles não conseguem se comunicar.Alguma idéia de onde está o problema?
Ainda tentei minha etapa 4, mas não posso implantá-la, a menos que remova o host2: peer1 do config.json. E mesmo assim, só posso consultar a partir do host1: ponto0, não do host1: ponto2.
Aqui estão os comandos que eu uso para configurar minha rede:
Host1: Ordenador
docker run --rm -it --name orderer -p 8050:7050
-e ORDERER_GENERAL_LEDGERTYPE=ram
-e ORDERER_GENERAL_BATCHTIMEOUT=10s
-e ORDERER_GENERAL_BATCHSIZE_MAXMESSAGECOUNT=10
-e ORDERER_GENERAL_MAXWINDOWSIZE=1000
-e ORDERER_GENERAL_ORDERERTYPE=solo
-e ORDERER_GENERAL_LOGLEVEL=debug
-e ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
-e ORDERER_GENERAL_LISTENPORT=7050
-e ORDERER_RAMLEDGER_HISTORY_SIZE=100
sfhackfest22017/fabric-orderer:x86_64-0.7.0-snapshot-c7b3fe0 orderer
Host1: Peer0
docker run --rm -it --name peer0 -p 8051:7051 -p 8053:7053
-v /var/run/:/host/var/run/ -v $BASE_DIR/tmp/peer0:/etc/hyperledger/fabric/msp/sampleconfig
-e CORE_PEER_ADDRESSAUTODETECT=true
-e CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
-e CORE_LOGGING_LEVEL=DEBUG
-e CORE_PEER_NETWORKID=peer0
-e CORE_NEXT=true
-e CORE_PEER_ENDORSER_ENABLED=true
-e CORE_PEER_ID=peer0
-e CORE_PEER_PROFILE_ENABLED=true
-e CORE_PEER_COMMITTER_LEDGER_ORDERER=$ORDERER_IP:7050
-e CORE_PEER_GOSSIP_ORGLEADER=true
-e CORE_PEER_GOSSIP_IGNORESECURITY=true
sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0 peer node start --peer-defaultchain=false
Host1: Peer2
docker run --rm -it --name peer2 -p 8055:7051 -p 8057:7053
-v /var/run/:/host/var/run/ -v $BASE_DIR/tmp/peer0:/etc/hyperledger/fabric/msp/sampleconfig
-e CORE_PEER_ID=peer2
[Other parameters are the same as Peer0]
sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0 peer node start --peer-defaultchain=false
Host2: Par1
docker run --rm -it --name peer1 -p 8051:7051
-v /var/run/:/host/var/run/ -v $BASE_DIR/tmp/peer0:/etc/hyperledger/fabric/msp/sampleconfig
-e CORE_PEER_ID=peer1
[Other parameters are the same as Peer0]
sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0 peer node start --peer-defaultchain=false
Host2: Cli
docker run --rm -it --name cli
-v /var/run/:/host/var/run/ -v $BASE_DIR/tmp/peer3:/etc/hyperledger/fabric/msp/sampleconfig -v $BASE_DIR/src/github.com/example_cc/example_cc.go:/opt/gopath/src/github.com/hyperledger/fabric/examples/example_cc.go -v $BASE_DIR/channel_test.sh:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel_test.sh
--workdir /opt/gopath/src/github.com/hyperledger/fabric/peer
-e GOPATH=/opt/gopath
-e CORE_PEER_ADDRESSAUTODETECT=true
-e CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
-e CORE_LOGGING_LEVEL=DEBUG
-e CORE_NEXT=true
-e CORE_PEER_ID=cli
-e CORE_PEER_ENDORSER_ENABLED=true
-e CORE_PEER_COMMITTER_LEDGER_ORDERER=$ORDERER_IP:8050
-e CORE_PEER_ADDRESS=$PEER0_IP:8051
sfhackfest22017/fabric-peer:x86_64-0.7.0-snapshot-c7b3fe0 ./channel_test.sh
Se precisar de mais informações, não hesite em perguntar.
Nota: Eu não estou muito familiarizado com o docker, qualquer melhoria / conselho sobre como usá-lo é bem-vindo :)