1

I have been going through FabCar sample from hyperledger official site below are my questions.

  1. What is the purpose of transaction ID that were generated which we get as a response after successfully making a transaction?

  2. Does that transactionID be helpful in querying particular block?

  3. Is it the right way to query CouchDB and get results? or do the blocks needs to be explored/queried, if so how?

James Z
  • 12,209
  • 10
  • 24
  • 44
Faizul Hassan
  • 120
  • 12

1 Answers1

0

You can use transaction ID to retrieve that specific processed transaction, using

channel.queryTransaction(tx_id, target, useAdmin, skipDecode) which returns a promise for a fully decoded ProcessedTransaction object.

The processed transaction will contain all the information you need about the transaction including the block number, which you can then use to fetch the appropriate block using

channel.queryBlock(blockNumber, target, useAdmin, skipDecode)

Clyde D'Cruz
  • 1,915
  • 1
  • 14
  • 36