使用fabric-java-sdk实例化链码时,出现以下错误。我正在使用docker-compose.yaml文件运行同级。
INFO: fabcarss- Chain code instantiation response {
status: 500
message: "failed to execute transaction 17e4e74664013463ed52355e380f43a85f1aa5ef44e04ac375342ec4f90d9c72: error starting container: error starting container: Post http://unix.sock/containers/create?name=dev-peer1.org1.example.com-fabcarss-5: dial unix /host/var/run/docker.sock: connect: no such file or directory"
}
我的对等docker组成如下:
peer0org1:
container_name: peer0.org1.example.com
image: hyperledger/fabric-peer:1.2.0
deploy:
placement:
constraints:
- node.role == manager
- node.id == vbka1smkqlqflno3hfp69rbr7
environment:
- CORE_PEER_ID=peer0.org1.example.com
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:7052
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=artifacts_default
- CORE_LOGGING_LEVEL=DEBUG
- CORE_PEER_GOSSIP_USELEADERELECTION=true
- CORE_PEER_GOSSIP_ORGLEADER=false
- CORE_PEER_GOSSIP_SKIPHANDSHAKE=true
- CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/crypto/peer/msp
- CORE_PEER_TLS_ENABLED=false
- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/crypto/peer/tls/server.key
- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/crypto/peer/tls/server.crt
- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/crypto/peer/tls/ca.crt
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
command: peer node start
volumes:
- /var/run/:/host/var/run/
ports:
- 7051:7051
- 7053:7053
volumes:
- ./channel/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/:/etc/hyperledger/crypto/peer
depends_on:
- orderer.example.com
答案 0 :(得分:0)
您使用docker-compose(或仅使用docker)运行对等方? 您是否尝试过
- CORE_VM_ENDPOINT=unix:/{PATH-TO-YOUR-DOCKER.SOCK}