Queries the details of a transaction on a Hyperledger Fabric channel, including its status, originator, target chaincode, call arguments, and any generated events.
API
GET /api/v1/networks/{network}/transactions/{id}Path parameters
| Parameter | Description |
|---|---|
network | The name of the Fabric channel. |
id | The transaction ID. |
Response
Top-level fields
| Name | Type | Description |
|---|---|---|
Success | Boolean | Indicates whether the request succeeded. |
Error | Error | Error details. Present in all responses; see the Error object for fields. |
Result | Transaction | The transaction details. Present when Success is true. |
Error object
| Name | Type | Description |
|---|---|---|
code | Integer | The error code. |
message | String | The error description. |
request_id | String | The request ID. |
Transaction object
| Name | Type | Description |
|---|---|---|
id | String | The transaction ID. |
state | String | The transaction status. VALID indicates a valid transaction; any other value indicates an invalid transaction. |
from | String | The transaction originator, in the format <organizationMSP>.<username>. |
to | String | The name of the target chaincode invoked by the transaction. |
input | String | The JSON-encoded chaincode call arguments. |
events | List\<Event\> | The blockchain events generated by the transaction. This field returns only Contract type events, or null if none were generated. |
data | Object | The raw transaction payload, including endorsements, read-write sets, and channel header details. |
Event object
| Name | Type | Description |
|---|---|---|
id | String | The event ID, unique within the channel. |
name | String | The event name. |
type | String | The event type. Valid values: Tx, Config, Contract, Block. This API returns only Contract type events. |
content | String | The Base64-encoded smart contract event content. Present only when type is Contract. |
Examples
Request example
curl -X GET \
"http://your.gateway.endpoint/api/v1/networks/channel3/transactions/e49d411a2ff32caa1688b5e0a07a957d2d8a4c8c124554772d07145214b3ba13" \
-H "accept: application/json" \
-H "Authorization: Bearer <Your Access Token>"Response example
{
"Success": true,
"Result": {
"id": "e49d411a2ff32caa1688b5e0a07a957d2d8a4c8c124554772d07145214b3ba13",
"state": "VALID",
"from": "e2ehmfqasthMSP.octopus_26842_12345678901234",
"to": "sacc",
"input": "[\"set\",\"provider\",\"aliyun3\"]",
"events": null,
"data": {
"data": {
"actions": [
{
"header": {
"creator": {
"id_bytes": "LS0tLS1CR...SUZJQ0FURS0tLS0tCg==",
"mspid": "e2ehmfqasthMSP"
},
"nonce": "HdQ823siiR5yzRq/sGkrD0y6jTMOVkuG"
},
"payload": {
"action": {
"endorsements": [
{
"endorser": "Cg5lMmVobW...S0tLS0tCg==",
"signature": "MEQCIHm9YG6PbIUpqa3DF6l6h5vRTQxbGVyWkiYqOAIX5pa2AiBFQNvTfzlf951oj/ki0eGbB0AV9fGwBA8TpXMhyoGdgg=="
}
],
"proposal_response_payload": {
"extension": {
"chaincode_id": {
"name": "sacc",
"path": "",
"version": "3.0"
},
"events": null,
"response": {
"message": "",
"payload": "YWxpeXVuMw==",
"status": 200
},
"results": {
"data_model": "KV",
"ns_rwset": [
{
"collection_hashed_rwset": [],
"namespace": "lscc",
"rwset": {
"metadata_writes": [],
"range_queries_info": [],
"reads": [
{
"key": "sacc",
"version": {
"block_num": "16",
"tx_num": "0"
}
}
],
"writes": []
}
},
{
"collection_hashed_rwset": [],
"namespace": "sacc",
"rwset": {
"metadata_writes": [],
"range_queries_info": [],
"reads": [],
"writes": [
{
"is_delete": false,
"key": "provider",
"value": "YWxpeXVuMw=="
}
]
}
}
]
}
},
"proposal_hash": "dEy87BXYByKTxVjk2A0XMViX402pbHQOjAq/Y6i0XG0="
}
},
"chaincode_proposal_payload": {
"TransientMap": {},
"input": {
"chaincode_spec": {
"chaincode_id": {
"name": "sacc",
"path": "",
"version": ""
},
"input": {
"args": [
"c2V0",
"cHJvdmlkZXI=",
"YWxpeXVuMw=="
],
"decorations": {},
"is_init": false
},
"timeout": 0,
"type": "GOLANG"
}
}
}
}
}
]
},
"header": {
"channel_header": {
"channel_id": "channel3",
"epoch": "0",
"extension": "EgYSBHNhY2M=",
"timestamp": "2020-02-13T08:09:31.588293471Z",
"tls_cert_hash": null,
"tx_id": "e49d411a2ff32caa1688b5e0a07a957d2d8a4c8c124554772d07145214b3ba13",
"type": 3,
"version": 0
},
"signature_header": {
"creator": {
"id_bytes": "LS0tLS1CR...0FURS0tLS0tCg==",
"mspid": "e2ehmfqasthMSP"
},
"nonce": "HdQ823siiR5yzRq/sGkrD0y6jTMOVkuG"
}
}
}
},
"Error": {
"code": 200,
"message": "Success",
"request_id": "759fb8ee-9763-4355-b742-becc81cb7bf5"
}
}Error codes
For a full list of error codes, see Error codes.