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

Chaincode install error #235

Closed
ghost opened this issue Jun 16, 2018 · 4 comments
Closed

Chaincode install error #235

ghost opened this issue Jun 16, 2018 · 4 comments

Comments

@ghost
Copy link

ghost commented Jun 16, 2018

Hi I am getting error when installing marble chaincode in my local hyperledger network.

Error : sendPeersProposal - Promise is rejected: Error: 2 UNKNOWN: Stream removed
Failed to obtain endorsement for transaction. code=2, , details=Stream removed

Please help me to resolve this issue.

Note : Docker version- 1.13.1
fabric_version 1.1.0

@dshuffma-ibm
Copy link
Contributor

I haven't seen this one before, this grpc issue might be of help: grpc/grpc-node#130

people seem to fix it by changing their grpc version. check out what version you have running by opening the file /node_modules/grpc/package.json, marbles should be using version 1.10.1

@dshuffma-ibm
Copy link
Contributor

closing, inactivity

@oumaima1234
Copy link

This problem is related to the use of grpc instead od grpcs.

You can correct it by changing grpc to grpcs in your code when you use nodejs SDK. If you do this, you will find a PEM error. To correct it you should add other arguments to "newPeer(...)" function.

you can adapt this piece of code to your code where you use the "newPeer" function and if you use the newOrderer function add the changes in the same way as newPeer.

code: to add and modify:

var fs = require('fs');
var path = require('path');

var firstnetwork_path = path.resolve('..', '..', 'first-network');
var org1tlscacert_path = path.resolve(firstnetwork_path, 'crypto-config', 'peerOrganizations', 'org1.example.com', 'tlsca', 'tlsca.org1.example.com-cert.pem');
var org1tlscacert = fs.readFileSync(org1tlscacert_path, 'utf8');

//
var fabric_client = new Fabric_Client();

// setup the fabric network
var channel = fabric_client.newChannel('mychannel');
var peer = fabric_client.newPeer('grpcs://localhost:7051', {
'ssl-target-name-override': 'peer0.org1.example.com',
pem: org1tlscacert
});
channel.addPeer(peer);

@ebaizel
Copy link

ebaizel commented Jul 4, 2019

Thanks @oumaima1234. That did the trick. I didn't end up needing ssl-target-name-override as the cert matched the dns name.

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