queryNetwork_startTime - Cardano

This method returns the UTC start time of the network, the moment the first block could have been produced. It is a fixed genesis constant.

Parameters

This method does not require parameters.

Request

bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "queryNetwork/startTime",
    "id": "getblock.io"
}'

example.js

javascriptconst response = await fetch(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
    {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({"jsonrpc": "2.0", "method": "queryNetwork/startTime", "id": "getblock.io"})
    }
);
console.log(await response.json());

example.py

pythonimport requests

response = requests.post(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
    headers={'Content-Type': 'application/json'},
    json={"jsonrpc": "2.0", "method": "queryNetwork/startTime", "id": "getblock.io"}
)

print(response.json())

Response

json{
    "jsonrpc": "2.0",
    "method": "queryNetwork/startTime",
    "result": "2017-09-23T21:44:51Z",
    "id": "getblock.io"
}

Response Parameters

FieldTypeDescription
resultstringNetwork start time as an ISO 8601 UTC timestamp

Use Cases

  • Slot Conversion: Convert absolute slots to wall-clock time
  • Era Math: Anchor era-length calculations to genesis
  • Display: Show the network's age on a status page
  • Validation: Confirm the node is on the expected network by its start time

Error Handling

Error CodeMessageDescription
-32602Invalid paramsA required field is missing or has the wrong type
-32000Query unavailableThe query is not available in the current ledger era
-32603Internal errorThe node failed to answer the query