Inspect DApp state REST API
This method sends an inspect-state request to the DApp backend passing the payload string in the URL. The payload string should be URL-encoded; the inspect server will decode the string to UTF-8. If the DApp frontend needs to pass a binary string to the backend then it is advised to use the base64 encoding.
The response contains a status string and the reports generated by the DApp backend. The status string can be either 'accept', 'reject', or 'exception'. In case of exception, the field exception_payload will contain the exception payload; Otherwise, this field will be null.
When running on machine mode, the whole Cartesi machine is rolled back after processing the inspect-state request. On host mode, it is advised against changing the DApp backend state when processing an inspect-state request. Notice that this method is synchronous, so it is not advised to perform resource-intensive operations.
Path Parameters
- payload string required
- 200
- default
Inspect state response.
- application/json
- Schema
- Example (from schema)
Schema
- status string
Possible values: [
Accepted
,Rejected
,Exception
,MachineHalted
,CycleLimitExceeded
,TimeLimitExceeded
]Whether inspection completed or not (and why not)
- exception_payload string
Payload in the Ethereum hex binary format. The first two characters are '0x' followed by pairs of hexadecimal numbers that correspond to one byte. For instance, '0xdeadbeef' corresponds to a payload with length 4 and bytes 222, 173, 190, 175. An empty payload is represented by the string '0x'.
reports object[]
payload stringPayload in the Ethereum hex binary format. The first two characters are '0x' followed by pairs of hexadecimal numbers that correspond to one byte. For instance, '0xdeadbeef' corresponds to a payload with length 4 and bytes 222, 173, 190, 175. An empty payload is represented by the string '0x'.
metadata object
Contain the blockchain Metadata for the given inspect request
active_epoch_index integerEpoch that was inspected
current_input_index integerCurrent input index when the state was inspected
{
"status": "Accepted",
"exception_payload": "string",
"reports": [
{
"payload": "string"
}
],
"metadata": {
"active_epoch_index": 0,
"current_input_index": 0
}
}
Error response.
- text/plain
- Schema
Schema
- string
Detailed error message.