Hyperledger Fabric: How to access transaction ID in invoke function?

0 votes

If I call Invoke of chain code, I get transaction ID in REST response. e.g.

{
  "jsonrpc": "2.0",
  "result": {
    "status": "OK",
    "message": "e00848bc-71c3-422f-b637-cbfc9d2e2042"
  },
  "id": 4
}

How can I access this transaction ID (e00848bc-71c3-422f-b637-cbfc9d2e2042 in above example) programatically in my invoke function of chaincode?

Nov 5, 2018 in Blockchain by digger
• 26,550 points
471 views

1 answer to this question.

0 votes

You can access transaction ID in Invoke function using:

stub.GetTxID()
answered Nov 5, 2018 by Omkar
• 67,660 points

Related Questions In Blockchain

0 votes
1 answer
+1 vote
2 answers

How to return value from a chaincode in Hyperledger Fabric?

Hyperledger Fabric supports only 2 types of ...READ MORE

answered Jun 13, 2018 in Blockchain by Perry
• 17,020 points
918 views
0 votes
1 answer
0 votes
1 answer

How to control a malicious user in hyperledger fabric?

Fabric is an implementation of blockchain. Blockchain ...READ MORE

answered Jun 29, 2018 in Blockchain by Omkar
• 67,660 points
197 views
0 votes
1 answer
0 votes
1 answer

Invalid Batch or signature in Savtooth

This will solve your problem import org.apache.commons.codec.binary.Hex; Transaction txn ...READ MORE

answered Aug 1, 2018 in Blockchain by digger
• 26,550 points
81 views
+1 vote
1 answer
0 votes
1 answer

Hyperledger composer: How to allow create in transaction? Access Control

This is how you can do it: /** @returns ...READ MORE

answered Nov 8, 2018 in Blockchain by Omkar
• 67,660 points
209 views
+15 votes
5 answers