我仍然是Hyperledger的新手。
尝试创建和加入频道时遇到问题。
我输入Docker Quickstart Terminal peer channel create -o orderer.medrecnet.com:7050 -c medrecnetChannel -f ./channel-artifacts/channel.tx --tls –cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/medrecnet.com/orderers/orderer.medrecnet.com/msp/tlscacerts/tlsca.medrecnet.com-cert.pem
那之后我得到了错误
2019-02-19 11:25:49.715 UTC [main] InitCmd-> ERRO 001无法运行对等 因为无法初始化加密,文件夹 “ /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/hospital.medrecnet.com/users/Admin@hospital.medrecnet.com/msp” 不存在
我已遵循https://hyperledger-fabric.readthedocs.io/en/latest/build_network.html?highlight=script.sh
的步骤这是我的docker-compose-cli.yaml:
version: '2'
volumes:
orderer.medrecnet.com:
peer0.hospital.medrecnet.com:
peer1.doctor.medrecnet.com:
networks:
byfn:
services:
orderer.medrecnet.com:
extends:
file: base/docker-compose-base.yaml
service: orderer.medrecnet.com
container_name: orderer.medrecnet.com
networks:
- byfn
peer0.hospital.medrecnet.com:
container_name: peer0.hospital.medrecnet.com
extends:
file: base/docker-compose-base.yaml
service: peer0.hospital.medrecnet.com
networks:
- byfn
peer1.doctor.medrecnet.com:
container_name: peer1.doctor.medrecnet.com
extends:
file: base/docker-compose-base.yaml
service: peer1.doctor.medrecnet.com
networks:
- byfn
cli:
container_name: cli
image: hyperledger/fabric-tools:$IMAGE_TAG
tty: true
stdin_open: true
environment:
- GOPATH=/opt/gopath
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
#- FABRIC_LOGGING_SPEC=DEBUG
- FABRIC_LOGGING_SPEC=INFO
- CORE_PEER_ID=cli
- CORE_PEER_ADDRESS=peer0.hospital.medrecnet.com:7051
- CORE_PEER_LOCALMSPID=HospitalMSP
- CORE_PEER_TLS_ENABLED=true
- CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/hospital.medrecnet.com/peers/peer0.hospital.medrecnet.com/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/hospital.medrecnet.com/peers/peer0.hospital.medrecnet.com/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/hospital.medrecnet.com/peers/peer0.hospital.medrecnet.com/tls/ca.crt
- CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/hospital.medrecnet.com/users/Admin@hospital.medrecnet.com/msp
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
command: /bin/bash
volumes:
- /var/run/:/host/var/run/
- ./../chaincode/:/opt/gopath/src/github.com/chaincode
- ./crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
- ./scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/
- ./channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts
depends_on:
- orderer.medrecnet.com
- peer0.hospital.medrecnet.com
- peer1.doctor.medrecnet.com
networks:
- byfn
这是我的docker-compose-base.yaml:
version: '2'
services:
orderer.medrecnet.com:
container_name: orderer.medrecnet.com
image: hyperledger/fabric-orderer:$IMAGE_TAG
environment:
- FABRIC_LOGGING_SPEC=INFO
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENERAL_GENESISMETHOD=file
- ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block
- ORDERER_GENERAL_LOCALMSPID=OrdererMSP
- ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
# enabled TLS
- ORDERER_GENERAL_TLS_ENABLED=true
- ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
- ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
- ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
- ORDERER_KAFKA_TOPIC_REPLICATIONFACTOR=1
- ORDERER_KAFKA_VERBOSE=true
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: orderer
volumes:
- ../channel-artifacts/genesis.block:/var/hyperledger/orderer/orderer.genesis.block
- ../crypto-config/ordererOrganizations/medrecnet.com/orderers/orderer.medrecnet.com/msp:/var/hyperledger/orderer/msp
- ../crypto-config/ordererOrganizations/medrecnet.com/orderers/orderer.medrecnet.com/tls/:/var/hyperledger/orderer/tls
- orderer.medrecnet.com:/var/hyperledger/production/orderer
ports:
- 7050:7050
peer0.hospital.medrecnet.com:
container_name: peer0.hospital.medrecnet.com
extends:
file: peer-base.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer0.hospital.medrecnet.com
- CORE_PEER_ADDRESS=peer0.hospital.medrecnet.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.hospital.medrecnet.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.hospital.medrecnet.com:7051
- CORE_PEER_LOCALMSPID=HospitalMSP
- CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/hospital.medrecnet.com/users/Admin@hospital.medrecnet.com/msp
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/hospital.medrecnet.com/peers/peer0.hospital.medrecnet.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/hospital.medrecnet.com/peers/peer0.hospital.medrecnet.com/tls:/etc/hyperledger/fabric/tls
- peer0.hospital.medrecnet.com:/var/hyperledger/production
ports:
- 7051:7051
- 7053:7053
peer1.doctor.medrecnet.com:
container_name: peer1.doctor.medrecnet.com
extends:
file: peer-base.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer1.doctor.medrecnet.com
- CORE_PEER_ADDRESS=peer1.doctor.medrecnet.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.doctor.medrecnet.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.doctor.medrecnet.com:7051
- CORE_PEER_LOCALMSPID=doctorMSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/doctor.medrecnet.com/peers/peer1.doctor.medrecnet.com/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/doctor.medrecnet.com/peers/peer1.doctor.medrecnet.com/tls:/etc/hyperledger/fabric/tls
- peer1.doctor.medrecnet.com:/var/hyperledger/production
ports:
- 9051:7051
- 9053:7053