Operation
Operations are stateful external actions that FireFly triggers via plugins. They can succeed or fail. They are grouped into Transactions in order to accomplish a single logical task.
The diagram below shows the different types of operation that are performed by each FireFly plugin type. The color coding (and numbers) map those different types of operation to the Transaction types that include those operations.
Operation status¶
When initially created an operation is in Initialized
state. Once the operation has been successfully sent to its respective plugin to be processed its
status moves to Pending
state. This indicates that the plugin is processing the operation. The operation will then move to Succeeded
or Failed
state depending on the outcome.
In the event that an operation could not be submitted to the plugin for processing, for example because the plugin's microservice was temporarily
unavailable, the operation will remain in Initialized
state. Re-submitting the same FireFly API call using the same idempotency key will cause FireFly
to re-submit the operation to its plugin.
Example¶
{
"id": "04a8b0c4-03c2-4935-85a1-87d17cddc20a",
"namespace": "ns1",
"tx": "99543134-769b-42a8-8be4-a5f8873f969d",
"type": "sharedstorage_upload_batch",
"status": "Succeeded",
"plugin": "ipfs",
"input": {
"id": "80d89712-57f3-48fe-b085-a8cba6e0667d"
},
"output": {
"payloadRef": "QmWj3tr2aTHqnRYovhS2mQAjYneRtMWJSU4M4RdAJpJwEC"
},
"created": "2022-05-16T01:23:15Z"
}
Field Descriptions¶
Field Name | Description | Type |
---|---|---|
id |
The UUID of the operation | UUID |
namespace |
The namespace of the operation | string |
tx |
The UUID of the FireFly transaction the operation is part of | UUID |
type |
The type of the operation | FFEnum :"blockchain_pin_batch" "blockchain_network_action" "blockchain_deploy" "blockchain_invoke" "sharedstorage_upload_batch" "sharedstorage_upload_blob" "sharedstorage_upload_value" "sharedstorage_download_batch" "sharedstorage_download_blob" "dataexchange_send_batch" "dataexchange_send_blob" "token_create_pool" "token_activate_pool" "token_transfer" "token_approval" |
status |
The current status of the operation | OpStatus |
plugin |
The plugin responsible for performing the operation | string |
input |
The input to this operation | JSONObject |
output |
Any output reported back from the plugin for this operation | JSONObject |
error |
Any error reported back from the plugin for this operation | string |
created |
The time the operation was created | FFTime |
updated |
The last update time of the operation | FFTime |
retry |
If this operation was initiated as a retry to a previous operation, this field points to the UUID of the operation being retried | UUID |