Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
httran13 opened this issue Jul 30, 2018 · 2 comments
Open

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

httran13 opened this issue Jul 30, 2018 · 2 comments

Comments

@httran13
Copy link

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
Copy link
Contributor

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
Copy link
Author

httran13 commented Jul 30, 2018

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:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
ports:
- "7054:7054"
command: sh -c 'fabric-ca-server start -n ca0 ${V11_IDENTITIES_ALLOWREMOVE} ${V11_AFFILIATIONS_ALLOWREMOVE} --registry.maxenrollments -1 --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/*_sk -b admin:adminpw'

volumes:
  - ./crypto/${FAB_CONFIG_GEN_VERS}/crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config:ro
container_name: capeerOrg1
networks:
  - projbc

marbles:
container_name: marbles
image: htran1/marbles:latest
command: gulp marbles_local
ports:
- 80:3001
networks:
- projbc

depends_on:
- peer1.org1.example.com
- peer0.org1.example.com
- ca0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@httran13 @dshuffma-ibm and others