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 Linea Besu run a node instructions #733

Merged
merged 18 commits into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
14 changes: 9 additions & 5 deletions docs/developers/guides/run-a-node/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ import DocCardList from "@theme/DocCardList";

There are no financial incentives for running a Linea node, but it does allow you to:

- Call the Linea JSON RPC API methods and submit transactions to the mempool without relying on an RPC provider.
- 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.
- Call the Linea JSON RPC API methods and submit transactions to the mempool without relying on an
RPC provider. Note that using [Linea-specific API methods](../../reference/api/index.mdx) such as
`linea_estimateGas` and the `finalized` tag require using Linea Besu with the necessary plugins
enabled. Configuring your node to run with these plugins is covered in our guides.
- Have a local copy of the Linea blockchain, also known as a "follower" node. This view of the
state is "trusted" until the transaction, or the block that transaction is in, has been finalized
on L1.

:::note

Running a sequencer node is currently not possible and there is no option to vote on blocks as part of the consensus
mechanism or [fork-choice](https://eth2book.info/capella/part3/forkchoice/#whats-a-fork-choice) like on Ethereum.
There is currently no option to vote on blocks as part of the consensus mechanism or [fork-choice](https://eth2book.info/capella/part3/forkchoice/#whats-a-fork-choice)
like on Ethereum.

:::

Expand Down
90 changes: 86 additions & 4 deletions docs/developers/guides/run-a-node/use-binary.mdx
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
---
title: Use a binary distribution
description: Install the Besu or Geth client to run a Linea node.
image: /img/socialCards/install-the-besu-or-geth-client-to-run-a-linea-node.jpg
image: /img/socialCards/use-a-binary-distribution.jpg
---

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

import VolumeCreation from "./volume-creation.mdx";

# Use a binary distribution

You can install the Hyperledger Besu or Geth client to run a Linea node from a binary distribution.
For Besu nodes, you have a choice between:
- Using standard Besu software to run a follower node, which keeps a local copy of the blockchain,
or;
- Using Linea Besu if you intend to use the node to interact with the blockchain, or provide it to
others to do so. Linea Besu extends Besu's functionality with plugins and is recommended for
infrastructure providers.

## Prerequisites

Expand All @@ -19,8 +24,11 @@ official documentation:

- [Hyperledger Besu](https://besu.hyperledger.org/public-networks/get-started/system-requirements)
- [Geth](https://geth.ethereum.org/docs/getting-started/hardware-requirements).
- Linea Besu: Download the latest version of `linea-besu-package` from its [releases page](https://github.com/Consensys/linea-besu-package/releases).
Find the "Assets" subheading on the latest release and download the zip file named
`linea-besu-package-<version>.tar.gz`.

## Run the Besu client
## Run a standard Besu client

### Step 1. Install Besu

Expand Down Expand Up @@ -103,6 +111,80 @@ Run the Besu client with the location of your configuration file. For example:

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

## Run Linea Besu with plugins

Linea Besu is an implementation of the Hyperledger Besu client that extends its functionality.

We recommend using Linea Besu over standard Besu if you intend to run a node and use it to interact
with the blockchain, rather than just following it.

Linea Besu enables you to use plugins adapted specifically for Linea, such as the [Linea Sequencer
plugin](https://github.com/Consensys/linea-sequencer) and [Shomei](https://github.com/Consensys/shomei).

These plugins are necessary, in different ways, to enable full functionality for the node.
Linea-specific API endpoints like `linea_estimateGas`, for example, require the `linea-sequencer`
plugin. You can pick a plugin by selecting a profile in [step 2](#step-2-select-a-profile).

This guide is for infrastructure providers and operators who intend to run a Linea node. This is
relevant to you if:
- You are responsible for operating nodes as a service for others to use
- You want to use Linea with a personal, private RPC endpoint.

### Step 1. Unzip the folder

The `linea-besu-package-<version>.tar.gz` is a zip file; move it to the directory of your choice
and unzip it.

### Step 2. Select a profile

In the unzipped directory, find `profiles`. The `.toml` configuration files in this folder define
the parameters for each possible profile you can select for your Linea Besu node.

Select one according to your preferences:
- `basic-mainnet`: Creates a basic follower node on Linea Mainnet with no plugins enabled.
- `advanced-mainnet`: Creates an advanced node on Linea Mainnet with plugins that enable support for
`linea_estimateGas` and the `finalized` block parameter tag.
- `sequencer-mainnet`: Creates a sequencer node on Linea Mainnet.
- `shomei-mainnet`: Creates a Shomei node on Linea Mainnet, enabling full state management support.
- `tracer-mainnet`: Creates a tracer node on the Linea Mainnet.

### Step 3. Adjust configuration file

In the `.toml` file you chose, set `genesis-file` to the path of your downloaded genesis file. Since
we will be running the client from within the `linea-besu-package-<version>` directory, this does
not need to be a full path:

<Tabs className="my-tabs">
<TabItem value="Mainnet" label="Mainnet">
`genesis/genesis.mainnet.json`
</TabItem>
<TabItem value="Linea Sepolia" label="Linea Sepolia">
`genesis/genesis.testnet-sepolia.json`
</TabItem>
</Tabs>

### Step 4. Start the Linea Besu client

In a terminal, navigate to the `linea-besu-package-<version>` directory, where the `bin`, `genesis`,
`profiles` etc. directories are.

Now run Linea Besu with the location of your configuration file:

<Tabs className="my-tabs">
<TabItem value="Mainnet" label="Mainnet">
```bash
bin/besu --config-file=/your-file-path/linea-besu-package-<version>/profiles/sequencer-mainnet.toml
```
</TabItem>
<TabItem value="Linea Sepolia" label="Linea Sepolia">
```bash
bin/besu --config-file=/your-file-path/linea-besu-package-<version>/profiles/sequencer-sepolia.toml
```
</TabItem>
</Tabs>

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

## Run the Geth client

### Step 1. Install Geth
Expand Down
60 changes: 54 additions & 6 deletions docs/developers/guides/run-a-node/use-docker.mdx
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
---
title: Use Docker
description: Use Docker to run a Besu or Geth client as a Linea node.
image: /img/socialCards/use-docker-to-run-a-besu-or-geth-client-as-a-linea-node.jpg
image: /img/socialCards/use-docker.jpg
---

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

# Use Docker

You can use Docker to run [Hyperledger Besu](https://besu.hyperledger.org/) or [Geth](https://geth.ethereum.org/) as
a Linea node on the mainnet or testnets.
You can use Docker to run [Hyperledger Besu](https://besu.hyperledger.org/), [Linea Besu](https://github.com/Consensys/linea-besu-package/tree/main),
or [Geth](https://geth.ethereum.org/) as a Linea node on Mainnet or Linea Sepolia.

## Prerequisites

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

## Run a Besu node
## Run a standard Besu node

:::warning Important

Expand Down Expand Up @@ -76,6 +75,55 @@ for help if you experience peering issues.

:::

## Run a Linea Besu node

### Step 1. Download the relevant `docker-compose.yaml` file

Access the [`/docker` directory](https://github.com/Consensys/linea-besu-package/tree/main/docker)
in the Linea Besu repository. There are several `.yaml` files here corresponding to Besu profiles.
Each profile enables you to run a node with different Linea Besu plugin configurations depending on
your use case.

Download the appropriate `.yaml` file for your use case:
- `basic`: Creates a basic follower node on Linea Mainnet with no plugins enabled.
- `advanced`: Creates an advanced node on Linea Mainnet with plugins that enable support for
`linea_estimateGas` and the `finalized` block parameter tag.
- `sequencer`: Creates a sequencer node on Linea Mainnet.
- `shomei`: Creates a Shomei node on Linea Mainnet, enabling full state management support.
- `tracer`: Creates a tracer node on Linea Mainnet.

### Step 2. Update IP address

In the `.yaml` file you downloaded, adjust the `--p2p-host` command with your public IP address:

```yaml
--p2p-host=103.10.10.10
```

:::tip

You can use [this page](https://www.whatismyip.com/) to find your public IP address.

:::

### Step 3. Start the Linea Besu node

In a terminal, navigate to your `.yaml` file's directory. Then start the node by running
`docker compose`:

```bash
docker compose -f ./your-file-path/docker-compose-basic-mainnet.yaml up
```

Alternatively, you can run a node without downloading a `.yaml` file with a `docker run` command.
For example:

```bash
docker run -e BESU_PROFILE=basic-mainnet consensys/linea-besu-package:latest
```

Adjust the `BESU-PROFILE` to match one of the profiles listed in step 1.
jlwllmr marked this conversation as resolved.
Show resolved Hide resolved

## Run a Geth node

### Step 1. Download configuration files
Expand Down
2 changes: 1 addition & 1 deletion docs/developers/tooling/cloud-infra/spheron.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ providers. Spheron focuses on simplicity, usability, and support to build an eff
for the next generation of applications.

View the [Spheron documentation](https://docs.spheron.network/) for information on how to deploy and manage
your decentralized applications using the platform.
your decentralized applications using the platform.
1 change: 1 addition & 0 deletions project-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,7 @@ Shamir
SHIB
SHIBA
shiki
shomei
showinfo
sida
Sidechain
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/socialCards/use-docker.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.