Threder
Threder

Reputation: 77

'peer' command not found hyperledger

I'm working on this tutorial:

http://hyperledger-fabric.readthedocs.io/en/latest/getting_started.html

At the section "Create & Join Channel" at the command :

peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -f ./channel-artifacts/channel.tx --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/cacerts/ca.example.com-cert.pem

I received this error:

No command 'peer' found, did you mean:
Command 'pee' from package 'moreutils' (universe)
Command 'beer' from package 'gerstensaft' (universe)
Command 'peel' from package 'ears' (universe)
Command 'pear' from package 'php-pear' (main)
peer: command not found

Upvotes: 1

Views: 9762

Answers (4)

CristianJTC
CristianJTC

Reputation: 11

if you are in the folder ../test-network as I am, try first these two following commands which are in the Interacting with the network section:

export PATH=${PWD}/../bin:$PATH

export FABRIC_CFG_PATH=$PWD/../config/

Then you will be able set the environmental variables which will allow you to operate the peer CLI as Org1 or Org2.

Upvotes: 1

Zeddrich Starke
Zeddrich Starke

Reputation: 11

This error means that your kernel cannot find the peer binaries. So it's important that the path to the peer binaries is included in your path. If you are in the directory where all the files for the hyperledger fabric are residing (ex. fabrics or fabric-samples) run:

export PATH=${PWD}/../bin:$PATH

Upvotes: 1

Shubham Chadokar
Shubham Chadokar

Reputation: 2763

I assumed that your network is up and running.

Please check which docker image you're using to run peer commands.
run docker ps
Check the docker images name
chaincode is build and start in chaincode docker image

docker exec -it chaincode bash

and to interact and run peer commands run cli docker image

docker exec -it cli bash

Upvotes: -1

ecn
ecn

Reputation: 482

Since you are following the guide, I suppose you are using Docker and it seems that you are not connected to the cli container, otherwise, it would have known the command "peer" (I might be mistaken).

To connect to the cli container:

docker exec -it cli bash

If this is not the problem, you can try the command from the bin folder :

/usr/local/bin

But this folder should be in the PATH environment variable, for example:

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Upvotes: 5

Related Questions