L0vdL0vd

erigon_forks

Returns the genesis hash and the block numbers of the chain's hard forks.

curl https://eth.l0vdinfra.com/YOUR_KEY \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","id":1,"method":"erigon_forks","params":[]}'

Пример ответа

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "genesis": "0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3",
    "heightForks": [
      1150000,
      1920000
    ],
    "timeForks": [
      1681338455,
      1710338135
    ]
  }
}

Длинные массивы и hex-строки в примере сокращены.

Параметры и свой эндпоинт

Параметры

У метода нет параметров.

Возвращает

object Fork schedule.

genesisstring
Genesis block hash.
heightForksarray
Block numbers of block-based forks.
timeForksarray
Timestamps of time-based forks (Shanghai and later).

Когда использовать

Check which hard forks the chain has activated and when, e.g. to choose the right transaction type or opcode set.

Как читать ответ

heightForks are block numbers; timeForks are Unix timestamps for forks scheduled by time.

Советы

  • Values are fixed per chain: cache them.

Связанные методы