跳转到内容

eth_subscribe

此内容尚不支持你的语言。

Protocol: WebSocket (WSS) only

Subscribe to real-time events over WebSocket (newHeads, logs, newPendingTransactions).

ParameterTypeRequiredDescription
subscriptionTypestringYesEvent type
{
"jsonrpc": "2.0",
"method": "eth_subscribe",
"params": [
"newHeads"
],
"id": 1
}
Terminal window
curl -X POST https://eth-mainnet.blockreq.com/v1/rpc/public \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_subscribe","params":["newHeads"],"id":1}'