IBM-Blockchain-Archive / marbles

WARNING: This repository is no longer maintained ⚠️ This repository will not be updated. The repository will be kept available in read-only mode.
Apache License 2.0
1.03k stars 979 forks source link

Marbles image in docker network unable to resolve CA hostname #246

Open httran13 opened 6 years ago

httran13 commented 6 years ago

I am running a marbles docker image in the same network with my fab network. Using the docker container's name as the hostname, marbles is unable to connect to the fabric ca(http protocol) but marbles is able to resolve the peers/orderers.

How I had to temporarily get marbles working, hence i know that its able to connect to peers/orderers using the dockers given hostnames, is using the marbles ui guided help, I input the fabric ca IP.

I got the fabric ca IP by using docker network inspect, only when using the IP, marbles were able to function correctly.

dshuffma-ibm commented 6 years ago

are you using the "my first network" setup from fabric-samples? this seems more of a problem with your network's setup than with marbles. I'm stating the obvious here, but you need to specify the hostname to docker: docker run --hostname=value

httran13 commented 6 years ago

im using docker-compose file and both marbles and ca is in the same network "projbc".

Below is my local connection_profile { "name": "Docker Compose Network", "x-networkId": "not-important", "x-type": "hlfv1", "description": "Connection Profile for an Hyperledger Fabric network on a local machine", "version": "1.0.0", "client": { "organization": "Org1MSP", "credentialStore": { "path": "/$HOME/proj/hfc-key-store" } }, "channels": { "projbc": { "orderers": [ "orderer.example.com", "orderer0.example.com" ], "peers": { "peer0.org1.example.com": { "endorsingPeer": true, "chaincodeQuery": true, "ledgerQuery": true, "eventSource": false } }, "chaincodes": [ "marbles:v4" ] } }, "organizations": { "Org1MSP": { "mspid": "Org1MSP", "peers": [ "peer0.org1.example.com", "peer1.org1.example.com" ], "certificateAuthorities": [ "fabric-ca" ], "x-adminCert": { "path": "./crypto/v1.1/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/admincerts/Admin@org1.example.com-cert.pem" }, "x-adminKeyStore": { "path": "./crypto/v1.1/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/" } } }, "orderers": { "orderer.example.com": { "url": "grpc://orderer.example.com:7050", "grpcOptions": { "ssl-target-name-override": "orderer.example.com", "grpc-max-send-message-length": 15 }, "tlsCACerts": { "pem": "-----BEGIN CERTIFICATE----- " } }, "orderer0.example.com": { "url": "grpc://orderer0.example.com:7150", "grpcOptions": { "ssl-target-name-override": "orderer0.example.com", "grpc-max-send-message-length": 15 }, "tlsCACerts": { "pem": "-----BEGIN CERTIFICATE----- " } } }, "peers": { "peer0.org1.example.com": { "url": "grpc://peer0.org1.example.com:7051", "eventUrl": "grpc://peer0.org1.example.com:7053", "grpcOptions": { "ssl-target-name-override": "peer0.org1.example.com", "grpc.http2.keepalive_time": 15 } }, "peer1.org1.example.com": { "url": "grpc://peer1.org1.example.com:7056", "eventUrl": "grpc://peer1.org1.example.com:7058", "grpcOptions": { "ssl-target-name-override": "peer1.org1.example.com" } } }, "certificateAuthorities": { "fabric-ca": { "url": "http://capeerOrg1:7054", "httpOptions": { "verify": true }, "registrar": [ { "enrollId": "admin", "enrollSecret": "adminpw" } ], "caName": "ca0" } } }

And here is my docker compose:

##################################################################TODO the ca will need to be modified when new certs are generated ca0: image: ${IMAGE_REPO}/fabric-ca${IMAGE_TAG_FABRIC} environment: