Thursday, February 20, 2020

Using hyperledger discover service


# This assumes the following information available
1. a user's private key, public key and its belonging org mspid
  2. a peer's tlsca cert and its endpoint
 
# Produce the conf.yaml file based on the information provided
discover --configFile conf.yaml --peerTLSCA ca.crt \
--userKey priv_sk --userCert admin.pem --MSP org0examplecom saveConfig

# Discover peers
discover --configFile conf.yaml peers --channel mychannel \
--server peer1.org0.example.com:7051

# Discover config
discover --configFile conf.yaml config --channel mychannel \
--server peer1.org0.example.com:7051

# Discover endorsers for a chaincode
discover --configFile conf.yaml endorsers --channel mychannel \
--chaincode simple --server peer1.org0.example.com:7051 
 
# Choose not to use config file, pass necessary info as command line parameters
discover peers --peerTLSCA ca.crt --userKey priv_sk --userCert admin.pem \
--MSP org0examplecom --channel mychannel --server peer1.org0.example.com:7051
 
discover config --peerTLSCA ca.crt --userKey priv_sk --userCert admin.pem \
--MSP org0examplecom --channel mychannel --server peer1.org0.example.com:7051
 
discover endorsers --peerTLSCA ca.crt --userKey priv_sk --userCert admin.pem \
--MSP org0examplecom --channel mychannel --server peer1.org0.example.com:7051 \
--chaincode simple
 

No comments:

Post a Comment