Skip to Content

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)
Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Oct 18, 2019 at 02:04 PM

    Hi Aroni,

    very good questions and the only answer for all five in my case is either Blockchain Connector to a HANA instance or open source CouchDB, which unfortunately is not exposed in SCP implementation of fabric.

    i would be more than happy to stand corrected on either or both claims.

    thank you, greg

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.