Skip to main content

List Epochs

Example Request

{
"jsonrpc": "2.0",
"method": "cartesi_listEpochs",
"params": {
"application": "<name-or-address>",
"limit": 10,
"offset": 0
},
"id": 1
}

The cartesi_listEpochs method returns a paginated list of epochs for a specific application.

Parameters

NameTypeRequiredDescription
applicationstringYesThe application's name or hex encoded address
statusstringNoFilter epochs by status
limitnumberNoMaximum number of epochs to return (default: 50, minimum: 1)
offsetnumberNoStarting point for the list (default: 0, minimum: 0)

Response

{
"jsonrpc": "2.0",
"result": {
"data": [
{
"index": "0x1",
"first_block": "0x1",
"last_block": "0x100",
"claim_hash": null,
"claim_transaction_hash": null,
"status": "OPEN",
"virtual_index": "0x1",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}
],
"pagination": {
"total_count": 1,
"limit": 50,
"offset": 0
}
},
"id": 1
}

Response Fields

Data

NameTypeDescription
indexstringThe epoch index (hex encoded)
first_blockstringThe first block number of the epoch (hex encoded)
last_blockstringThe last block number of the epoch (hex encoded)
claim_hashstringThe claim hash (null if not claimed)
claim_transaction_hashstringThe claim transaction hash (null if not claimed)
statusstringCurrent status of the epoch
virtual_indexstringThe virtual index of the epoch (hex encoded)
created_atstringTimestamp when the epoch was created
updated_atstringTimestamp when the epoch was last updated

Pagination

NameTypeDescription
total_countnumberTotal number of epochs available
limitnumberNumber of epochs returned in this response
offsetnumberStarting point of the returned epochs

Error Codes

CodeMessageDescription
-32602Invalid paramsInvalid parameter values
-32603Internal errorAn internal error occurred
-32000Application not foundThe specified application does not exist

Example

Request

{
"jsonrpc": "2.0",
"method": "cartesi_listEpochs",
"params": {
"application": "calculator",
"limit": 10,
"offset": 0
},
"id": 1
}

Response

{
"jsonrpc": "2.0",
"result": {
"data": [
{
"index": "0x1",
"status": "ACCEPTED",
"inputs_count": "0x1",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}
],
"pagination": {
"total_count": 1,
"limit": 10,
"offset": 0
}
},
"id": 1
}
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.