Skip to main content
Version: 0.8

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
Responses

Inspect state response.


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 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'.

  • metadata object

    Contain the blockchain Metadata for the given inspect request

  • active_epoch_index integer

    Epoch that was inspected

  • current_input_index integer

    Current input index when the state was inspected

© 2023 Cartesi Foundation Ltd. All rights reserved.

The Cartesi Project is commissioned by the Cartesi Foundation.

We use cookies to ensure that we give you the best experience on our website. By using the website, you agree to the use of cookies.