# 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](https://beta-app.blockops.network/?callback=api-service) 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.

<figure><img src="https://1708223268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdj2MsRM0vL9rfte6D4jZ%2Fuploads%2Fgit-blob-020f586c5c2cf403f06aadadbcb4d22f43e0d9e6%2Fethereum-create.png?alt=media" alt=""><figcaption><p>Create Ethereum project</p></figcaption></figure>

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

<figure><img src="https://1708223268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdj2MsRM0vL9rfte6D4jZ%2Fuploads%2Fgit-blob-7f56df18766000532221360b82fc187d57aaceb9%2Fethereum-view.png?alt=media" alt=""><figcaption><p>view Ethereum project</p></figcaption></figure>

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

<figure><img src="https://1708223268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdj2MsRM0vL9rfte6D4jZ%2Fuploads%2Fgit-blob-3dd3b0bd1813452a3dad1115590146674ba9e34e%2Fethereum-sepolia-create.png?alt=media" alt=""><figcaption><p>Create Ethereum Sepolia project</p></figcaption></figure>

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

<figure><img src="https://1708223268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdj2MsRM0vL9rfte6D4jZ%2Fuploads%2Fgit-blob-346108ab83f6bee6f51da2a43826240f602b92a1%2Fethereum-sepolia-view.png?alt=media" alt=""><figcaption><p>view Ethereum Sepolia project</p></figcaption></figure>

#### Send requests

{% hint style="info" %}
All requests are `POST` requests.
{% endhint %}

{% tabs %}
{% tab title="Https" %}
For Ethereum Mainnet

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

For Ethereum Sepolia

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

{% endtab %}

{% tab title="Websocket" %}
For Ethereum Mainnet

```bash
wss://ethereum-ws.blockops.network?api_key=************
```

For Base Sepolia

```bash
wss://ethereum-sepolia-ws.blockops.network?api_key=************
```

{% endtab %}
{% endtabs %}

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

{% code overflow="wrap" %}

```bash
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
```

{% endcode %}

### Ethereum Sepolia

{% code overflow="wrap" %}

```bash
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
```

{% endcode %}

Here is the response you will receive back.

{% code overflow="wrap" %}

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

{% endcode %}

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

{% code overflow="wrap" %}

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

{% endcode %}

Or the request header.

{% code overflow="wrap" %}

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

{% endcode %}

### Ethereum Sepolia

{% code overflow="wrap" %}

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

{% endcode %}

Or the request header.

{% code overflow="wrap" %}

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

{% endcode %}

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

```bash
Connected (press CTRL+C to quit)
>
```

Then, you can send the following request:

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

{% hint style="info" %}
For more information on the Polkadot network, please see the official [Ethereum developer documentation](https://ethereum.org/developers).
{% endhint %}

Login or set up an account [here](https://beta-app.blockops.network/?callback=api-service) to get started!

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

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

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