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
    ]
  }
}

示例中较长的数组和十六进制字符串已截断。

参数与您的端点

参数

此方法没有参数。

返回值

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.

相关方法