> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blockops.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Ethereum

> Endpoints and example requests for Ethereum Mainnet and Sepolia.

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](https://app.blockops.network) to get your own API key.

### Ethereum Mainnet

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

<Frame caption="Create Ethereum project">
  <img src="https://mintcdn.com/blockops-3855c227/OGmnNOc7FURsTCyJ/images/ethereum-create.png?fit=max&auto=format&n=OGmnNOc7FURsTCyJ&q=85&s=eb11c611c7aa2d3d4e6f7d0b521105c8" alt="" width="2552" height="1426" data-path="images/ethereum-create.png" />
</Frame>

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

<Frame caption="view Ethereum project">
  <img src="https://mintcdn.com/blockops-3855c227/OGmnNOc7FURsTCyJ/images/ethereum-view.png?fit=max&auto=format&n=OGmnNOc7FURsTCyJ&q=85&s=c05fc02acfb1f614606316dfaa67526f" alt="" width="2552" height="1426" data-path="images/ethereum-view.png" />
</Frame>

### 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.

<Frame caption="Create Ethereum Sepolia project">
  <img src="https://mintcdn.com/blockops-3855c227/OGmnNOc7FURsTCyJ/images/ethereum-sepolia-create.png?fit=max&auto=format&n=OGmnNOc7FURsTCyJ&q=85&s=ab825f509e76d31466b235171b9b0063" alt="" width="2552" height="1426" data-path="images/ethereum-sepolia-create.png" />
</Frame>

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

<Frame caption="view Ethereum Sepolia project">
  <img src="https://mintcdn.com/blockops-3855c227/OGmnNOc7FURsTCyJ/images/ethereum-sepolia-view.png?fit=max&auto=format&n=OGmnNOc7FURsTCyJ&q=85&s=2fb4e5677fa4650ecc9fd1364f3c2fb5" alt="" width="2552" height="1426" data-path="images/ethereum-sepolia-view.png" />
</Frame>

#### Send requests

<Note>
  All requests are `POST` requests.
</Note>

<Tabs>
  <Tab title="Https">
    For Ethereum Mainnet

    ```bash theme={null}
    https://ethereum-rpc.blockops.network/?api_key=************
    ```

    For Ethereum Sepolia

    ```bash theme={null}
    https://ethereum-sepolia-rpc.blockops.network?api_key=************
    ```
  </Tab>

  <Tab title="Websocket">
    For Ethereum Mainnet

    ```bash theme={null}
    wss://ethereum-ws.blockops.network?api_key=************
    ```

    For Ethereum Sepolia

    ```bash theme={null}
    wss://ethereum-sepolia-ws.blockops.network?api_key=************
    ```
  </Tab>
</Tabs>

**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

```bash theme={null}
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

```bash theme={null}
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.

```bash theme={null}
{"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:

* Download wscat from [https://www.npmjs.com/package/wscat](https://www.npmjs.com/package/wscat)
* Install wscat by running the following command: `npm install -g wscat`

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

### Ethereum Mainnet

```bash theme={null}
wscat -c 'wss://ethereum-ws.blockops.network?api_key=*********************'
```

Or the request header.

```bash theme={null}
wscat -c 'wss://ethereum-ws.blockops.network' --header 'authorization: APIKEY xxxx'
```

### Ethereum Sepolia

```bash theme={null}
wscat -c 'wss://ethereum-sepolia-ws.blockops.network?api_key=*********************'
```

Or the request header.

```bash theme={null}
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.

```bash theme={null}
Connected (press CTRL+C to quit)
>
```

Then, you can send the following request:

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

<Note>
  For more information on the Ethereum network, please see the official [Ethereum developer documentation](https://ethereum.org/developers).
</Note>

Login or set up an account [here](https://app.blockops.network) to get started!

#### ***Quick Links***

[Website](https://ethereum.org)

[Github](https://github.com/ethereum/)
