Use Rockside as Web 3 provider

Rockside provides access points to various blockchain networks through JSON RPC and Websocket.

Ethereum JSON RPC API

Rockside endpoint is fully compatible with the JSON-RPC interface.

We provide access to the following networks;

Network

URL

Mainnet

https://api.rockside.io/ethereum/mainnet/jsonrpc

Ropsten

https://api.rockside.io/ethereum/ropsten/jsonrpc

Poa Network

https://api.rockside.io/ethereum/poanetwork/jsonrpc

Example

You can test the Rockside RPC endpoint directly with curl. You just need to specify your API_KEY to get access to a network.

curl -X POST \
https://api.rockside.io/ethereum/ropsten/jsonrpc \
-H 'apikey: YOUR_API_KEY' \
-d '{"jsonrpc":"2.0","method":"net_version", "params":[],"id":1}'
{"jsonrpc":"2.0","result":"1","id":1}

Supported methods

You can refer to the official Ethereum documentation for each API method.

Method Name

Official Documentation

web3_clientVersion

​View Documentation​

web3_sha3

​View Documentation​

net_version

​View Documentation​

net_listening

​View Documentation​

net_peerCount

​View Documentation​

eth_protocolVersion

​View Documentation​

eth_syncing

​View Documentation​

eth_mining

​View Documentation​

eth_hashrate

​View Documentation​

eth_gasPrice

​View Documentation​

eth_accounts

​View Documentation​

eth_blockNumber

​View Documentation​

eth_getBalance

​View Documentation​

eth_getStorageAt

​View Documentation​

eth_getTransactionCount

​View Documentation​

eth_getBlockTransactionCountByHash

​View Documentation​

eth_getBlockTransactionCountByNumber

​View Documentation​

eth_getUncleCountByBlockHash

​View Documentation​

eth_getUncleCountByBlockNumber

​View Documentation​

eth_getCode

​View Documentation​

eth_sendTransaction

​View Documentation​

eth_sendRawTransaction

​View Documentation​

eth_call

​View Documentation​

eth_estimateGas

​View Documentation​

eth_getBlockByHash

​View Documentation​

eth_getBlockByNumber

​View Documentation​

eth_getTransactionByHash

​View Documentation​

eth_getTransactionByBlockHashAndIndex

​View Documentation​

eth_getTransactionByBlockNumberAndIndex

​View Documentation​

eth_getTransactionReceipt

​View Documentation​

eth_getUncleByBlockHashAndIndex

​View Documentation​

eth_getUncleByBlockNumberAndIndex

​View Documentation​

eth_getLogs

​View Documentation​

eth_submitWork

​View Documentation​

eth_getProof

​View Documentation​

eth_newBlockFilter

​View Documentation​

eth_newPendingTransactionFilter

​View Documentation​

eth_uninstallFilter

​View Documentation​

eth_getFilterChanges

​View Documentation​

eth_getFilterLogs

​View Documentation​

Ethereum Websocket API

Rockside's websocket endpoint provides support for Pub/Sub API as well as JSON-RPC filter support. Ethereum JSON-RPC API is also supported over a websocket connection.

We provide access to the following networks;

Network

URL

Mainnet

https://api.rockside.io/ethereum/mainnet/jsonrpc/ws?apikey=YOUR_APIKEY

Ropsten

https://api.rockside.io/ethereum/ropsten/jsonrpc/ws?apikey=YOUR_APIKEY

Poa Network

https://api.rockside.io/ethereum/poanetwork/jsonrpc/ws?apikey=YOUR_APIKEY

Example

A simple way to test a Websocket connection is to use wscat, but you can use any tool that supports websocket.

To begin, create a new WebSocket connection.

wscat -c https://api.rockside.io/ethereum/ropsten/jsonrpc/ws -H 'apikey:YOUR_APIKEY'

Then, you can start making JSON RPC calls. For example, do the following to get the current block number from the network:

{"jsonrpc":"2.0", "method": "eth_blockNumber", "id": 1, "params": [] }

Or, send the following to get detailed information on the most recently mined block:

{"jsonrpc":"2.0", "method": "eth_getBlockByNumber", "id": 1, "params": ["latest", false] }

You can also subscribe to some events.

// newHeads{"jsonrpc":"2.0", "id": 1, "method": "eth_subscribe", "params": ["newHeads"]}​// newPendingTransactions{"jsonrpc":"2.0", "id": 1, "method": "eth_subscribe", "params": ["newPendingTransactions"]}

Finally, you can unsubscribe with a call with eth_unsubscribe as method and the subscription id as first parameter.

{"jsonrpc":"2.0", "id": 1, "method": "eth_unsubscribe", "params": ["SUBSCRIPTION_ID"]}

​ ​