CORE_PEER_* Environment Variables on BYFN CLI

Q

What is the default peer and how to change it on the BYFN CLI container?

✍: FYIcenter.com

A

On the BYFN CLI container, you can manage other peer nodes with the "peer" command.

When you run a "peer" command, it will connect to the default peer node define by these environment variables:

  • CORE_PEER_ADDRESS=peer0.org1.example.com:9051 - Specify the default peer address and port number.
  • CORE_PEER_LOCALMSPID=Org1MSP - Specify the MSP ID of the peer organization.
  • CORE_PEER_MSPCONFIGPATH=.../org1.example.com/users /Admin@org1.example.com/msp - Specify the MSP (Membership Service Providers) directory for the administrator user private key and public certificate.
  • CORE_PEER_TLS_ROOTCERT_FILE=.../peer0.org1.example.com/tls/ca.crt - Specify the root CA certificate of the peer organization.

1. Connect the FYBN CLI container:

$ docker exec -it cli bash
bash-4.4# 

2. Verify environment variables for the default peer:

bash-4.4# echo $CORE_PEER_ADDRESS
peer0.org1.example.com:7051

bash-4.4# echo $CORE_PEER_LOCALMSPID
Org1MSP

bash-4.4# echo $CORE_PEER_MSPCONFIGPATH
/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations\
   /org1.example.com/users/Admin@org1.example.com/msp

bash-4.4# echo $CORE_PEER_TLS_ROOTCERT_FILE
/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations\
   /org1.example.com/peers/peer0.org1.example.com/tls/ca.crt

3. Check status of the default peer:

bash-4.4# peer node status
status:STARTED

4. List channels the default peer has joined:

bash-4.4# peer channel list
[channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
Channels peers has joined:

The default peer, peer0.org1.example.com, has not joined to any channels yet.

 

Join Peer to BYFN Network Channel

BYFN Error - "unable to bootstrap orderer"

Hyperledger Fabric Sample Networks

⇑⇑ Hyperledger Tutorials

2019-04-12, 245👍, 0💬