Skip to main content

Get Epoch

Example Request

{
"jsonrpc": "2.0",
"method": "cartesi_getEpoch",
"params": {
"application": "<name-or-address>",
"epoch_index": "<hex-encoded-index>"
},
"id": 1
}

The cartesi_getEpoch method retrieves detailed information about a specific epoch by its application and index.

Parameters

NameTypeRequiredDescription
applicationstringYesThe application's name or hex encoded address
epoch_indexstringYesThe index of the epoch to be retrieved (hex encoded)

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"
}
},
"id": 1
}

Response Fields

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

Error Codes

CodeMessageDescription
-32602Invalid paramsInvalid parameter values
-32000Application not foundThe specified application does not exist
-32001Epoch not foundThe specified epoch does not exist
-32603Internal errorAn internal error occurred
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.