Ethereum
Ethereum Gateway 提供标准 EVM JSON-RPC 入口,适合查询链上状态、读取合约和提交已签名交易。Gas Token 为 ETH。
支持的网络
| 网络 | Chain ID | JSON-RPC Host |
|---|---|---|
| Mainnet | 1 | ether-jsonrpc |
| Sepolia | 11155111 | ether-sepolia-jsonrpc |
从控制台复制完整 Access Point,不要只根据 Host 自行拼接域名。
免 Endpoint 调用
Accelerator 缓存命中时,无需配置 Endpoint 即可调用 eth_blockNumber、eth_getBlockByNumber([hexHeight, false]) 和 debug_traceBlockByNumber([hexHeight, {"tracer":"callTracer"}])。明确参数和缓存未命中行为见免 Endpoint 调用。
配置完整方法访问
- 为目标网络创建 Gateway。
- 通过 Provider 自动同步或手工添加同网络的 EVM Endpoint。
- 将 Endpoint 加入默认 JSON-RPC route,并确认 health check 正常。
- 使用
eth_chainId验证没有连错网络。
curl '<ethereum_access_point>' \
-H 'Authorization: Bearer <app_api_key>' \
-H 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'Mainnet 应返回 0x1,Sepolia 应返回 0xaa36a7。
eth_chainId 不属于 Accelerator 方法,因此该验证需要可用 Endpoint。
当前边界
- 支持单条 EVM JSON-RPC over HTTP;不支持 batch、WebSocket 和公开 gRPC。
- 不提供 Ethereum Beacon API 或通用 REST 入口。
- Archive、trace、debug 等方法取决于 Endpoint 的节点类型与套餐,Gateway 不补齐上游能力。
- 发送交易前应在客户端签名;写请求的重试边界见路由与可靠性。
Last updated on