跳转到内容

Beacon Chain API

import { Aside } from ‘@astrojs/starlight/components’;

Ethereum Beacon Chain API 通过标准 REST 端点提供共识层访问能力。与 EVM JSON-RPC 不同,Beacon API 使用 RESTful HTTP 请求(GET/POST),并返回 JSON 响应。

协议URL
HTTPS(公开)https://eth-beacon.blockreq.com/v1/rpc/public
HTTPS(私有)https://eth-beacon.blockreq.com/v1/rpc/{API_KEY}

Beacon API 端点路径会追加在基础 URL 后:

https://eth-beacon.blockreq.com/v1/rpc/public/{beacon_path}

例如,获取节点版本:

https://eth-beacon.blockreq.com/v1/rpc/public/eth/v1/node/version
Terminal window
curl https://eth-beacon.blockreq.com/v1/rpc/public/eth/v1/node/version
{
"data": {
"version": "Prysm/v5.x.x ..."
}
}
Terminal window
curl https://eth-beacon.blockreq.com/v1/rpc/public/eth/v1/beacon/headers
Terminal window
curl https://eth-beacon.blockreq.com/v1/rpc/public/eth/v1/beacon/states/head/finality_checkpoints
const BASE_URL = "https://eth-beacon.blockreq.com/v1/rpc/public";
// 查询节点同步状态
const res = await fetch(`${BASE_URL}/eth/v1/node/syncing`);
const data = await res.json();
console.log("Syncing:", data.data);
// 查询创世信息
const genesis = await fetch(`${BASE_URL}/eth/v1/beacon/genesis`);
const genesisData = await genesis.json();
console.log("Genesis time:", genesisData.data.genesis_time);
方法端点说明
GET/eth/v1/node/version节点软件版本
GET/eth/v1/node/syncing同步状态
GET/eth/v1/node/health节点健康检查
GET/eth/v1/node/identity节点网络身份
GET/eth/v1/node/peers已连接 peers
GET/eth/v1/node/peer_countpeer 数量
方法端点说明
GET/eth/v1/beacon/genesis创世信息
GET/eth/v1/beacon/headers区块头列表
GET/eth/v1/beacon/headers/{block_id}指定区块头
GET/eth/v2/beacon/blocks/{block_id}按 slot/root 查询区块
GET/eth/v1/beacon/blocks/{block_id}/root区块根
GET/eth/v1/beacon/blocks/{block_id}/attestations区块证明
GET/eth/v1/beacon/blob_sidecars/{block_id}Blob sidecars(EIP-4844)
GET/eth/v1/beacon/deposit_snapshot存款快照
方法端点说明
GET/eth/v1/beacon/states/{state_id}/root状态根
GET/eth/v1/beacon/states/{state_id}/fork分叉信息
GET/eth/v1/beacon/states/{state_id}/finality_checkpointsFinality 检查点
GET/eth/v1/beacon/states/{state_id}/validators全部验证者
GET/eth/v1/beacon/states/{state_id}/validators/{validator_id}单个验证者
GET/eth/v1/beacon/states/{state_id}/validator_balances验证者余额
GET/eth/v1/beacon/states/{state_id}/committeesEpoch 委员会
GET/eth/v1/beacon/states/{state_id}/sync_committees同步委员会
GET/eth/v1/beacon/states/{state_id}/randaoRANDAO 值
方法端点说明
GET/eth/v1/config/spec链规范参数
GET/eth/v1/config/fork_schedule分叉计划
GET/eth/v1/config/deposit_contract存款合约地址
方法端点说明
GET/eth/v1/validator/duties/attester/{epoch}Attester 职责
GET/eth/v1/validator/duties/proposer/{epoch}Proposer 职责
POST/eth/v1/validator/duties/sync/{epoch}同步委员会职责
GET/eth/v1/validator/attestation_data证明数据
GET/eth/v1/validator/aggregate_attestation聚合证明
GET/eth/v1/validator/sync_committee_contribution同步委员会贡献
GET/eth/v3/validator/blocks/{slot}生产区块
方法端点说明
GET/eth/v1/beacon/pool/attestations证明池
GET/eth/v1/beacon/pool/attester_slashingsAttester slashings
GET/eth/v1/beacon/pool/proposer_slashingsProposer slashings
GET/eth/v1/beacon/pool/voluntary_exits自愿退出
GET/eth/v1/beacon/pool/sync_committees同步委员会消息
GET/eth/v1/beacon/pool/bls_to_execution_changesBLS 到执行层变更
方法端点说明
GET/eth/v2/debug/beacon/states/{state_id}完整 Beacon 状态
GET/eth/v2/debug/beacon/headsFork choice heads
GET/eth/v1/debug/fork_choice完整 fork choice 信息
方法端点说明
GET/eth/v1/eventsServer-Sent Events 流
EVM JSON-RPCBeacon API
协议JSON-RPC 2.0REST(HTTP GET/POST)
请求格式{"jsonrpc":"2.0","method":"...","params":[...]}URL 路径 + query 参数
响应格式{"result": ...}{"data": ...}
WebSocket❌(使用 SSE)
调试方式交互式 playgroundcurl / fetch 示例