Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nethermind to docs for running Linea-Mainnet and Linea-Sepolia #806

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/developers/guides/run-a-node/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Linea Besu is recommended for infrastructure providers and operators who intend
node, whether for offering node services to others or for using Linea with a personal, private RPC endpoint.
:::

The vanilla Ethereum clients such as Besu, Geth, and Erigon are recommended if you only want to follow the
The vanilla Ethereum clients such as Besu, Geth, Erigon and Nethermind, are recommended if you only want to follow the
Linea chain. They allow you to have a local copy of the Linea blockchain. This view of the state is
"trusted" until the transaction, or the block that transaction is in, has been finalized on L1.

Expand All @@ -31,6 +31,7 @@ to Linea-specific features.
| [Linea Besu](./linea-besu.mdx) | Besu client with plugins that implement Linea-specific features, such as [API methods](../../reference/api/index.mdx) and [`finalized`](../finalized-block.mdx) tag. | ✅ |
| [Erigon](./erigon.mdx) | A client implementation focused on performance and saving disk space, written in Go. | ❌ |
| [Geth](./geth.mdx) | The most widely used open-source Ethereum client, written in Go. | ❌ |
| [Nethermind](./nethermind.mdx) | A high-performance, highly configurable Ethereum execution client built on .NET. | ❌ |


There are no financial incentives for running a Linea node, and there is currently no option to
Expand Down
158 changes: 158 additions & 0 deletions docs/developers/guides/run-a-node/nethermind.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
---
title: Nethermind
description: Install the Nethermind client to run a Linea node.
---

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

Nethermind is a high-performance Ethereum client written in C# that supports various networks, including Linea.

:::info important
Install and run a Nethermind client if you want to follow the Linea network by
maintaining a local copy of the blockchain. However, if you want to interact with the network and use
Linea-specific methods and features, you should [install Linea Besu](./linea-besu.mdx) instead.
:::

You can run Nethermind from a [binary distribution](#run-using-the-binary-distribution) or [using Docker](#run-using-docker).

## Run using the binary distribution

:::info
Ensure you review [Nethermind's installation Guidelines](https://docs.nethermind.io/get-started/installing-nethermind)
before installing the Nethermind client.

If you're not comfortable with installing the binary distribution, consider using [Docker](#run-using-docker) instead.
:::

### Step 1. Install Nethermind

[Download and install the Nethermind client](https://docs.nethermind.io/get-started/installing-nethermind/#standalone-downloads).

### Step 2. Start the Nethermind client

Start the node using the following command:

<Tabs groupId="networks" className="my-tabs">
<TabItem value="mainnet" label="Mainnet">

```bash
nethermind \
--datadir ./nethermind-data \
--config linea-mainnet \
--JsonRpc.Enabled=true \
--JsonRpc.Host=0.0.0.0 \
--JsonRpc.Port=8545 \
--Metrics.Enabled=true \
--Metrics.ExposePort=8008
```

</TabItem>
<TabItem value="Linea Sepolia" label="Linea Sepolia">

```bash
nethermind \
--datadir ./nethermind-data \
--config linea-sepolia \
--JsonRpc.Enabled=true \
--JsonRpc.Host=0.0.0.0 \
--JsonRpc.Port=8545 \
--Metrics.Enabled=true \
--Metrics.ExposePort=8008
```
</TabItem>
</Tabs>

The Nethermind node will attempt to find peers to begin synchronizing and to download the world state.

## Run using Docker

### Prerequisites

Download and install [Docker](https://www.docker.com/products/docker-desktop/).

### Step 1. Download Docker image

Download the Nethermind docker image:

```
docker pull nethermind/nethermind:latest
```


### Step 2. Start the Nethermind node

<Tabs groupId="networks" className="my-tabs">
<TabItem value="mainnet" label="Mainnet">

```bash
docker run -it \
-v nethermind_data:/nethermind/nethermind_db \
-p 8545:8545 \
-p 8008:8008 \
nethermind/nethermind \
--datadir /nethermind/nethermind_db \
--config linea-mainnet \
--JsonRpc.Enabled=true \
--JsonRpc.Host=0.0.0.0 \
--JsonRpc.Port=8545 \
--Metrics.Enabled=true \
--Metrics.ExposePort=8008
```

</TabItem>
<TabItem value="Linea Sepolia" label="Linea Sepolia">

```bash
docker run -it \
-v nethermind_data:/nethermind/nethermind_db \
-p 8545:8545 \
-p 8008:8008 \
nethermind/nethermind \
--datadir /nethermind/nethermind_db \
--config linea-sepolia \
--JsonRpc.Enabled=true \
--JsonRpc.Host=0.0.0.0 \
--JsonRpc.Port=8545 \
--Metrics.Enabled=true \
--Metrics.ExposePort=8008
```
</TabItem>
</Tabs>

:::note

Ensure that you correctly configure the Docker volume to persist data between container restarts.
Without proper volume setup, data will be lost when the container is stopped.
Additionally, make sure to expose the necessary ports (e.g., 8545 for JSON-RPC and 8008 for metrics)
to enable external access to these services.

:::

## Confirm the node is running

You can call the JSON-RPC API methods to confirm the node is running. For example, call
`eth_syncing` to return the synchronization status.
For example the starting, current, and highest block, or `false` if not synchronizing (or if the head of the chain has been reached).

```bash
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}'
```

You should get a result similar to:

```bash
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"startingBlock": "0x0",
"currentBlock": "0x5d228",
"highestBlock": "0x3cedec"
}
}
```