Ethereum

This section outlines how to use our API endpoint to connect to Ethereum.

Ethereum is the community-run technology powering the cryptocurrency ether (ETH) and thousands of decentralized applications.

How to Connect to Ethereum

You can connect to Ethereum using Blockops private API endpoints. Secure your data, speed up your queries, and take control of your API usage with our RPC API endpoint and personalized API keys. Sign up now to get your own API key.

Ethereum Mainnnet

To get your API key, create a project using a unique Identifier as the project name and select Ethereum from the network options.

Open the project to view your api key and rpc endpoints.

Ethereum Sepolia

To get your API key, create a project using a unique Identifier as the project name and select Ethereum Sepolia from the network options.

Open the project to view your api key and rpc endpoints.

Send requests

All requests are POST requests.

For Ethereum Mainnet

https://ethereum-rpc.blockops.network/?api_key=************

For Ethereum Sepolia

https://ethereum-sepolia-rpc.blockops.network?api_key=************

Connect via Command Line

You can connect to the network using websocket or HTTP with your API key in two ways:

  • Adding the API key as a query string ?api_key=${APIKEY}

  • Or the request header -H 'authorization: APIKEY ${APIKEY}'

Curl

For example, the following CURL command can be used to get a block number.

Ethereum Mainnet

curl -H "Content-Type: application/json" -H 'authorization: APIKEY xxxx'  -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' https://ethereum-rpc.blockops.network

Ethereum Sepolia

curl -H "Content-Type: application/json" -H 'authorization: APIKEY xxxx'  -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' https://ethereum-sepolia-rpc.blockops.network

Here is the response you will receive back.

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

Wscat

If you want to send data requests with WebSockets, you can use several libraries or wscat. You can install and use wscat as follows:

You can connect to the network with wscat using two options by adding the API key as a query string.

Ethereum Mainnet

wscat -c 'wss://ethereum-ws.blockops.network?api_key=*********************'

Or the request header.

wscat -c 'wss://ethereum-ws.blockops.network' --header 'authorization: APIKEY xxxx'

Ethereum Sepolia

wscat -c 'wss://ethereum-sepolia-ws.blockops.network?api_key=*********************'

Or the request header.

wscat -c 'wss://ethereum-sepolia-ws.blockops.network' --header 'authorization: APIKEY xxxx'

After executing the command, the terminal will display a message indicating that the connection has been enabled successfully.

Connected (press CTRL+C to quit)
>

Then, you can send the following request:

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

For more information on the Polkadot network, please see the official Ethereum developer documentation.

Login or set up an account here to get started!

Website

Github

Last updated