Is there a way to see 'raw' blockchain data using Hyperledger Composer?

424 Views Asked by At

Composer seems to add quite a bit of abstraction on top of Fabric - is there any way to see the underlying cryptography?

For example
- Is there a way to see transaction hashes?
- Is there a way to examine past blocks?

Thanks!

1

There are 1 best solutions below

1
On

From my experience, Composer does not give you a "block" view of your transactions. To see transaction hashes and information you can do this by using a query. Make a query.qry file in the root of your project directory. Then add this:

query getAllHistorianRecords {
  description: "getTradeRelatedHistorianRecords"
  statement: 
    SELECT org.hyperledger.composer.system.HistorianRecord
      WHERE (transactionTimestamp > '0000-01-01T00:00:00.000Z')
} 

This will let you see data such as:

{
    "$class": "org.hyperledger.composer.system.HistorianRecord",
    "transactionId": "b7b202906deba4d4bca1581ae6033562699361d67d31c2af45cd60b0225d5624",
    "transactionType": "org.hyperledger.composer.system.AddParticipant",
    "transactionInvoked": "resource:org.hyperledger.composer.system.AddParticipant#b7b202906deba4d4bca1581ae6033562699361d67d31c2af45cd60b0225d5624",
    "eventsEmitted": [],
    "transactionTimestamp": "2017-10-03T16:24:14.864Z"
  }
}...