eth_subscribe

Subscriptions are creates with a regular RPC call with eth_subscribe as method and the subscription name as first parameter. If successful it returns the subscription id.

Request

curl https://tn.henesis.io/ethereum/mainnet?clientId=<clientId> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_subscribe","params":["newHeads"],"id":1}'

Response

{
"id":1,
"jsonrpc": "2.0",
"result": "0x9cef478923ff08bf67fde6c64013158d"
}

Parameters

subscriptionName - The name of subscription.

Returns

subscriptionId - subscription id.

Reference

​https://github.com/ethereum/go-ethereum/wiki/RPC-PUB-SUB#create-subscription​