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,740 points
2,399 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
• 69,220 points

Its stub.getTxID();  Be careful here.

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,100 points
2,929 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
• 69,220 points
1,042 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,425 views
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,740 points
966 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
• 69,220 points
926 views
+15 votes
5 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP