Where can I find out the possible environment variables for the Hyperledger Fabric drill command?
When configuring a peer node to run, there are a number of environment variables included in the docker-compose sample files. Is there somewhere that I can find them all documented?
eg.
environment:
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_PEER_ID=peer0.org1.example.com
- CORE_LOGGING_PEER=debug
- CORE_CHAINCODE_LOGGING_LEVEL=DEBUG
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/peer/
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
source to share
Hyperledger Fabric provides a config file called core.yaml , you can find it inside a peer container under / etc / hyperledger / fabric /
Fabric uses Viper as a configuration framework that allows environment variables to override the values ββof configuration files. Basically it is initialized like this:
// used to prefix config keys to prevent possible collisions
viper.SetEnvPrefix("core")
// enforces to check values configured via environmental variables first
viper.AutomaticEnv()
This forces viper to look for all configuration keys among the string-prefixed environment variables CORE
.
Now if, for example, we look at the peer (updated) section in the example config:
peer:
id: jdoe
networkId: dev
listenAddress: 0.0.0.0:7051
address: 0.0.0.0:7051
any of these values ββcan be overridden by exporting an appropriate environment variable, such as a peer-to-peer identifier:
export CORE_PEER_NETWORKID=mypeerID
The same also works for other sections, for example if we want to control the registration level of various components:
logging:
peer: info
cauthdsl: warning
gossip: warning
ledger: info
msp: warning
policies: warning
grpc: error
To make the msp component log debug-level messages, we need to export the following variable:
export PEER_LOGGING_MSP=debug
Please note that this will only take effect if exported before the start of the peer-to-peer network.
source to share
Hyperledger Fabric provides a sample configuration file that basically includes all the possible properties for a component peer
. Of course, you will need to convert the yaml properties to the appropriate environment variable name using the formula:
foo:
bar: baz
becomes CORE_FOO_BAR=baz
The same goes for a component orderer
that has its own example configuration file .
source to share