Command peer not found while initializing the ledger with assets. - Hyperledger Fabric 2.5

220 views Asked by At

I'm following this documentation:

https://hyperledger-fabric.readthedocs.io/en/release-2.5/getting_started.html

Run the following command of section "Interacting with the network"

peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile "${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" -C mychannel -n basic --peerAddresses localhost:7051 --tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" --peerAddresses localhost:9051 --tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" -c '{"function":"InitLedger","Args":[]}'

I received this error:

Command 'peer' not found, did you mean:

command 'seer' from deb seer (1.1.4-zbuildz) command 'peek' from deb peek (1.5.1-1) command 'pear' from deb php-pear (1:1.10.9+submodules+notgz-1ubantu0.20.04.3) command 'pee' from deb moreutils (0.63-1) command 'peet' from deb pipexec (2.5.5-2) command 'beer' from deb gerstensaft (0.3-4.2)

Try sudo apt install <deb name>

I have set all the binaries in bin folder of golang and in the main folder using following command but it didn't work for me.

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

I'm new to Hyper ledger fabric. Looking for guidance. Thanks in advance.

1

There are 1 answers

2
ibraym On

It seems that you run the command export PATH=${PWD}/../bin:$PATH from the wrong directory. You should run it inside the test-network directory.

If you have installed the binaries and samples using the ./install-fabric.sh docker samples binary command, then you should have the test-network and bin folders inside the fabric-samples folder.