I followed Writing Your First Application and I face to an issue:
$./runfabcar.sh
ENV_DAL:
DISCOVERY_AS_LOCALHOST=true
run fabcar...
[fabsdk/core] 2020/07/16 03:56:03 UTC - cryptosuite.GetDefault -> INFO No default cryptosuite found, using default SW implementation
[{"Key":"CAR0","Record":{"make":"Toyota","model":"Prius","colour":"blue","owner":"Tomoko"}},{"Key":"CAR1","Record":{"make":"Ford","model":"Mustang","colour":"red","owner":"Brad"}},{"Key":"CAR2","Record":{"make":"Hyundai","model":"Tucson","colour":"green","owner":"Jin Soo"}},{"Key":"CAR3","Record":{"make":"Volkswagen","model":"Passat","colour":"yellow","owner":"Max"}},{"Key":"CAR4","Record":{"make":"Tesla","model":"S","colour":"black","owner":"Adriana"}},{"Key":"CAR5","Record":{"make":"Peugeot","model":"205","colour":"purple","owner":"Michel"}},{"Key":"CAR6","Record":{"make":"Chery","model":"S22L","colour":"white","owner":"Aarav"}},{"Key":"CAR7","Record":{"make":"Fiat","model":"Punto","colour":"violet","owner":"Pari"}},{"Key":"CAR8","Record":{"make":"Tata","model":"Nano","colour":"indigo","owner":"Valeria"}},{"Key":"CAR9","Record":{"make":"Holden","model":"Barina","colour":"brown","owner":"Shotaro"}}]
Failed to submit transaction: Failed to submit: CreateAndSendTransaction failed: SendTransaction failed: orderers is nil
Here is result of command startFabric.sh
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
46e0ea1d9f95 dev-peer0.org1.example.com-…6 "chaincode -peer.add…" 21 hours ago Up 21 hours dev-peer0.org1.example.com-…6
7afc6c392399 dev-peer0.org2.example.com-…0 "chaincode -peer.add…" 21 hours ago Up 21 hours dev-peer0.org2.example.com-…6
869161c47b22 hyperledger/fabric-peer:latest "peer node start" 21 hours ago Up 21 hours 0.0.0.0:7051->7051/tcp peer0.org1.example.com
e2b676d4e1e2 hyperledger/fabric-peer:latest "peer node start" 21 hours ago Up 21 hours 7051/tcp, 0.0.0.0:9051->9051/tcp peer0.org2.example.com
5050762f0bf9 hyperledger/fabric-orderer:latest "orderer" 21 hours ago Up 21 hours 0.0.0.0:7050->7050/tcp orderer.example.com
339d881b7df2 couchdb:3.1 "tini -- /docker-ent…" 21 hours ago Up 21 hours 4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp couchdb0
eb2bcc75aaa3 couchdb:3.1 "tini -- /docker-ent…" 21 hours ago Up 21 hours 4369/tcp, 9100/tcp, 0.0.0.0:7984->5984/tcp couchdb1
6d920be81d67 hyperledger/fabric-ca:latest "sh -c 'fabric-ca-se…" 21 hours ago Up 21 hours 7054/tcp, 0.0.0.0:8054->8054/tcp ca_org2
4005a51e70b4 hyperledger/fabric-ca:latest "sh -c 'fabric-ca-se…" 21 hours ago Up 21 hours 0.0.0.0:7054->7054/tcp ca_org1
0ff244f6a45e hyperledger/fabric-ca:latest "sh -c 'fabric-ca-se…" 21 hours ago Up 21 hours 7054/tcp, 0.0.0.0:9054->9054/tcp ca_orderer
How to resolve this issue?
- It worked, the solution is add channel into connection-org1.yaml:
channels:
mychannel:
orderers:
- orderer.example.com
peers:
peer0.org1.example.com:
endorsingPeer: true
chaincodeQuery: true
ledgerQuery: true
eventSource: true
Thanks