Cannot run peer because cannot init crypto
Asked Answered
O

7

3

I want to run the facbar-samples on windows10,reference the http://hyperledger-fabric.readthedocs.io/en/latest/write_first_app.html but get the error:

$ ./startFabric.sh
orderer.example.com is up-to-date
couchdb is up-to-date
peer0.org1.example.com is up-to-date
cli is up-to-date
2017-07-05 08:17:06.550 UTC [main] main -> ERRO 001 Cannot run peer because 
cannot init crypto, missing /etc/hyperledger/fabric/C:/Program 
Files/Git/etc/hyperledger/msp/users/[email protected]/msp folder

some that I have installed:

$ npm -v
5.0.4
$ node -v
v6.11.0
$ curl -V
curl 7.54.0 (x86_64-w64-mingw32) libcurl/7.54.0 OpenSSL/1.0.2l zlib/1.2.11 
libssh2/1.8.0 nghttp2/1.23.1 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 
pop3s rtmp rtsp scp sftp smtp smtps telnet tftp
Features: IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL libz TLS-SRP HTTP2 
HTTPS-proxy Metalink

$ docker --version
Docker version 17.06.0-ce, build 02c1d87

$ docker-compose --version
docker-compose version 1.14.0, build c7bdf9e3

$ git --version
git version 2.13.1.windows.2

Please help ,Thanks.

Overhead answered 5/7, 2017 at 8:43 Comment(1)
I had faced similar problem before, and realized that it would be better if I use vagrant to quickly build up a VM to experiment. That way I wouldn't have to worry about windows specific issues.Hillel
F
8

This is a problem with mingw64 which is messing with the filepaths. The solution is to set the following environment variable before running startFabric.sh :

export MSYS_NO_PATHCONV=1

A fix was just submitted to fabric to do that for you so if you pull the latest version from the master branch it should work. Otherwise, just set that variable and that should solve your problem.

Arnaud

Flickinger answered 21/7, 2017 at 17:26 Comment(2)
I put it into the shell and It is more useful ,Thanks.Spherics
I have "export MSYS_NO_PATHCONV=1" added in the shell but I am still getting this error. Kindly suggest.Sruti
C
1

The problem is incorrect path to certificates (look for windows path string between /fabric and /etc) /etc/hyperledger/fabric/C:/ProgramFiles/Git/etc/hyperledger/msp/users/[email protected]/msp

You can try next :

  • add path to certificate as environment variable to docker compose file at peer section
  • start network using docker-compose -f "path_to_file"
  • manually run instructions in startFabric.sh at peer and cli.
  • then you can successfully run node query.js for testing network work
Cussed answered 7/7, 2017 at 15:15 Comment(0)
T
1

The double // in the path will fix this. Update in all the places where docker exec command used for e.g. MSPCONFIGPATH=//etc/hyperledger....

Also certificates have to be generated before you could get your network running

Threadfin answered 14/7, 2017 at 0:28 Comment(1)
The double // is useful . But I don't generated certificates and is work normal。Maybe it has done。Spherics
I
1

Do this ./byfn.sh -m down first and then run ./byfn.sh generate then ./byfn.sh -m up

Irrational answered 13/5, 2018 at 4:52 Comment(0)
H
1

This may happen possibly when the network.sh is set to down. So, try bringing it up with the -ca flags and check. Worked for me.

Hispanic answered 7/10, 2021 at 1:45 Comment(1)
This also worked for me. Seems that it needs the certificate authorities for init crypto.Ileac
P
0

Before you run the fabcar-samples, I think that you have to execute some steps from the "Building Your First Network" chapter. It seems that you haven't got the required certificates to start the network. Also, you should generate the genesis block, the channel configuration transaction and the anchor peers.

You can do it by executing the ./byfn.sh -m generate command. For more information: http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html#generate-network-artifacts

Pino answered 6/7, 2017 at 6:38 Comment(1)
It isn't necessary to run anything from the "Building Your First Network" tutorial before running the fabcar sample.Linsang
S
0

I faced the same using Fabric 2.2's Test-Network. To resolve,

  1. Start docker again
  2. Set FABRIC_CFG_PATH, CORE_PEER_TLS_ENABLED, CORE_PEER_LOCALMSPID, CORE_PEER_TLS_ROOTCERT_FILE, CORE_PEER_ADDRESS and CORE_PEER_MSPCONFIGPATH again
  3. Run your queries from the test-network sub-directory.
Smoot answered 31/1, 2021 at 4:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.