Skip to content

Latest commit

 

History

History
 
 

blockchain_info

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Blockchain Info

Example allows to get infomation about joined channels and channel's ledger.

Required environment variables

  • MSP_ID - MSP identifier
  • CONFIG_PATH - path to configuration file of SDK (eg. config.yaml)
  • CERT_PATH - path to certificate file of identity (eg. signcerts/cert.pem)
  • KEY_PATH - path to private key of identity (eg. keystore/your_pk)

Usage

Run with environment variables described above:

go run main.go

Example output:

Fetching info about channel: channel1
Block length: 1, last block: hSUcm1BXeBFUDkYoktP2snFh2sdMtrO7Wn4e381Dq4Y=, prev block: 
Fetching info about channel: channel2
Block length: 2, last block: NJdmpdTjGZG3NDfJKWD1qUsNWs2DI/eQnCRBRrioVKo=, prev block: 6vm07LCMvpIjJ9OZ54WJZfZNKZ21w2KbSkEVExjvfN4=
Fetching info about channel: channel3
Block length: 1, last block: eX8As3kxjTbep4QMCGuzj/wrZQQhNlMNTS+zGOBd+lk=, prev block: