Skip to Content
Oct 18, 2019 at 08:45 AM

Accessing Hyperledger Fabric Blockchain Instance from Chaincode in GOLANG


I am trying to program a smart contract in GO language. It is going to calculate the total consumption value by taking consumption values from individual blocks. The information stored in a block is in the form of a json, e.g.

There are multiple blocks containing such consumption data.

1. How do I access the consumption data of individual blocks from the blockchain ?

2. Is it possible to use the proof of history API or is there another way ?

3. How to calculate and show the total consumption value(since in GO there is only invoke funtion)?

4. Do I store the consumption values in an array and sum it up ?

5. What actually is a "block" in the way we use it? e.g


1-1.jpg (14.9 kB)
1-2.jpg (44.4 kB)