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

Document how to run the Linea stack. #624

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion docs/developers/guides/community/irys-dynamic-nfts.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Create a dynamic NFT
image: /img/socialCards/build-a-dynamic-nft.jpg
image: /img/socialCards/create-a-dynamic-nft.jpg
description: Create NFTs that evolve based on user actions.
---

Expand Down
2 changes: 1 addition & 1 deletion docs/developers/guides/community/irys-nfts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Create an NFT
image: /img/socialCards/build-a-nft.jpg
image: /img/socialCards/create-an-nft.jpg
description: Build permanent NFTs using Irys and Linea.
---

Expand Down
34 changes: 34 additions & 0 deletions docs/developers/guides/run-linea/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
description: How to run a Linea network.
image: /img/socialCards/how-to-run-a-linea-network.jpg
---

import DocCardList from "@theme/DocCardList";

# Run Linea

You can run the entire Linea stack or a Linea node. Choosing between running the entire Linea stack
and a Linea node depends on your specific needs and the environment you're working in.

## When to run the Linea stack

:::info
Currently, the Linea stack is available for local deployments only.
:::

Run the Linea stack locally if you want to develop or test applications on Linea without connecting
to Sepolia or Ethereum Mainnet.

The Linea stack incorporates the base layer (L1) and the Linea stack itself.
By running the entire Linea stack locally, developers benefit from a controlled environment that provides
direct access to the blockchain's capabilities.

## When to run a Linea node

Run a Linea node if you want a local view of the Linea blockchain state.
A node enables users to call Linea JSON RPC API methods and submit transactions to the
bgravenorst marked this conversation as resolved.
Show resolved Hide resolved
mempool independently, without depending on external RPC providers.

Select the appropriate card for more information on running Linea using your preferred setup:

<DocCardList />
30 changes: 30 additions & 0 deletions docs/developers/guides/run-linea/run-the-stack/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
description: Run the Linea stack.
image: /img/socialCards/run-the-linea-stack.jpg
---

import DocCardList from "@theme/DocCardList";

# Run the Linea stack

:::info

The Linea stack is currently available only for local testing. This includes a local version of the
base layer (Hyperledger Besu) and the Linea stack itself.

:::

Run the the entire Linea stack to get working versions of:

- **Sequencer**: Responsible for ordering, building, and executing blocks.
bgravenorst marked this conversation as resolved.
Show resolved Hide resolved
- **State manager**: Manages the L2 network and account states.
- **Coordinator**: Coordinates the steps to create zk proofs and ensures their persistence on the
L1 Ethereum network. It specifically handles batch conflation, blob creation, and aggregation.
- **Traces API**: Provides trace counts and generates conflated trace files for zk proof creation.
- **Provers**: Generates three types of zk-SNARK proofs: execution, compression, and aggregation.

Refer to the [Linea architecture documentation](../../../../architecture/index.mdx) for more information
about the Linea stack components.


<DocCardList />
115 changes: 115 additions & 0 deletions docs/developers/guides/run-linea/run-the-stack/local.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
---
description: Run the Linea stack locally.
image: /img/socialCards/run-the-linea-stack-locally.jpg
---

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

# Run locally

## Prerequisites

The following installed:
bgravenorst marked this conversation as resolved.
Show resolved Hide resolved

- [Node.js v18](https://nodejs.org/en/download/package-manager)
bgravenorst marked this conversation as resolved.
Show resolved Hide resolved
- [Docker v24](https://docs.docker.com/get-docker/)
- [Docker Compose v2.19 or later](https://docs.docker.com/compose/install/)
- [Make v3.81 or later](https://www.npmjs.com/package/make)
- [Pnpm >=v9.0.6](https://pnpm.io/installation)
bgravenorst marked this conversation as resolved.
Show resolved Hide resolved

:::important
These instructions runs the Linea stack using Docker containers. Ensure you set your Docker resources to
bgravenorst marked this conversation as resolved.
Show resolved Hide resolved
use at a minimum 10 CPU cores, 8GB of memory and 1GB swap space.
bgravenorst marked this conversation as resolved.
Show resolved Hide resolved
:::

## Run the Linea stack

### 1. Clone the repository

Clone the Linea repository:

```bash
git clone https://github.com/Consensys/linea-monorepo.git
```

### 2. Install the dependencies

Change to the root of the directory and install the project dependencies:

```bash
cd linea-monorepo
```

```bash
pnpm i
bgravenorst marked this conversation as resolved.
Show resolved Hide resolved
```

### 3. Start the Linea stack

Start the network stack, this will also compile and deploy the required rollup contracts:
bgravenorst marked this conversation as resolved.
Show resolved Hide resolved

```bash
make fresh-start-all
```

You now have a local developer instance of the entire Linea network which includes components such as
bgravenorst marked this conversation as resolved.
Show resolved Hide resolved
the sequencer, prover, coordinator, and a local L1 settlement layer. You can view the components in
bgravenorst marked this conversation as resolved.
Show resolved Hide resolved
Docker Desktop.

<div class="center-container">
<div class="img-large">
<img
src="/img/docs/build-on-linea/linea-stack.png"
alt="Docker Desktop view of the Linea stack."
/>
</div>
</div>

## View network details

Access the RPC endpoints from the following local URLs:

:::info
You can [connect your MetaMask wallet](https://support.metamask.io/networks-and-sidechains/managing-networks/how-to-add-a-custom-network-rpc/#adding-a-network-manually)
to the required chain and [import the deployment account](https://support.metamask.io/managing-my-wallet/accounts-and-addresses/how-to-import-an-account/#importing-using-a-private-key)
to access the test tokens.
:::
bgravenorst marked this conversation as resolved.
Show resolved Hide resolved

<Tabs className="my-tabs">
bgravenorst marked this conversation as resolved.
Show resolved Hide resolved
<TabItem value="Linea" label="Linea (L2)" default>
- Endpoints:
- HTTPS: `http:\\localhost:8545`
- WebSockets: `ws:\\localhost:8546`
- Chain ID: `1337`
- [Message service address](../../../../architecture/stack/canonical-msg-service/message-service.mdx): `0xe537D669CA013d86EBeF1D64e40fC74CADC91987`
- Deployment account private key: `0x1dd171cec7e2995408b5513004e8207fe88d6820aeff0d82463b3e41df251aae`
</TabItem>
<TabItem value="Base layer" label="Base layer (L1)">
- Endpoints:
- HTTPS: `http:\\localhost:8445`
- WebSockets: `ws:\\localhost:8446`
- Chain ID: `31648428`
- Linea rollup contract address: `0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9`
- Deployment account private key: `0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80`
</TabItem>
</Tabs>

## Stop the Linea stack

You can stop and start the the Docker containers in Docker Desktop. However, constant stopping and
starting can lead to network or state issues.

Once stopped, you can clean your environment using the following commands:
bgravenorst marked this conversation as resolved.
Show resolved Hide resolved

:::note
This will permanently remove all docker images, containers and docker volumes and any data saved it them.
bgravenorst marked this conversation as resolved.
Show resolved Hide resolved
:::

```bash
make clean-environment
```
```bash
docker system prune --volumes
```

2 changes: 2 additions & 0 deletions docs/developers/reference/api/eth-sendrawtransaction.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
description: Simulate transaction submission to help prevent failed transactions.
image: >-
/img/socialCards/simulate-transaction-submission-to-help-prevent-failed-transactions.jpg
---

import Tabs from '@theme/Tabs';
Expand Down
2 changes: 1 addition & 1 deletion docs/developers/tooling/data-indexers/covalent.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,4 @@ Increment can be used for:
- [Increment](https://www.covalenthq.com/platform/increment/#/?utm_source=linea&utm_medium=partner-docs) - login via the Covalent Platform
- [Docs](https://www.covalenthq.com/docs/increment/?utm_source=linea&utm_medium=partner-docs) -
learn how to use Increment to build dynamic, custom charts
- [Data models demo](https://www.covalenthq.com/docs/increment/data-models/model-intro/?utm_source=linea&utm_medium=partner-docs) - build analytics in three clicks
- [Data models demo](https://www.covalenthq.com/docs/increment/data-models/model-intro/?utm_source=linea&utm_medium=partner-docs) - build analytics in three clicks
1 change: 1 addition & 0 deletions docs/developers/tooling/data-indexers/dipdup.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: DipDup
image: /img/socialCards/dipdup.jpg
---

[DipDup](https://dipdup.io/) is a Python framework for building smart contract indexers.
Expand Down
2 changes: 1 addition & 1 deletion docs/developers/tooling/node-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ image: /img/socialCards/node-providers.jpg

## Run your own node

- [Set it up yourself](../guides/run-a-node)
- [Set it up yourself](../guides/run-linea/run-a-node/index.mdx)
- [One-click deploy with EasyNode](https://app.easy-node.xyz/)
- [One-click deploy with Mintair](https://mintair.xyz/)
- [One-click deploy with RapidNode](https://rapidnode.xyz/dashboard)
Expand Down
5 changes: 4 additions & 1 deletion docs/developers/tooling/oracles/tellor.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
title: Tellor
description: A versatile oracle protocol that can provide data of any type permissionlessly with crypto-economic liveness and security.
description: >-
A versatile oracle protocol that can provide data of any type permissionlessly
with crypto-economic liveness and security.
image: /img/socialCards/tellor.jpg
---

# Tellor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Irys quickstart
image: /img/socialCards/quickstart.jpg
image: /img/socialCards/irys-quickstart.jpg
description: Creating permanent data using Irys SDK.
---

Expand Down
7 changes: 4 additions & 3 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ const config = {
// ],
// },
{
to: "/developers/guides/run-a-node",
to: "/developers/guides/run-linea",
position: "left",
label: "Run a node",
label: "Run Linea",
},
{
to: "/developers/linea-version",
Expand Down Expand Up @@ -381,11 +381,12 @@ const config = {
from: "/build-on-linea/gas-fees",
},
{
to: "/developers/guides/run-a-node",
to: "/developers/guides/run-linea",
from: [
"/build-on-linea/run-a-node",
"/build-on-linea/run-a-node/use-binary",
"/build-on-linea/run-a-node/use-docker",
"/developers/guides/run-a-node",
],
},
{
Expand Down
31 changes: 27 additions & 4 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,18 +162,41 @@ const sidebars = {
},
"developers/guides/linea-api/index",
"developers/guides/linea-sdk/index",

{
type: "category",
label: "Run a Linea node",
label: "Run Linea",
link: {
type: "doc",
id: "developers/guides/run-a-node/index",
id: "developers/guides/run-linea/index",
},
items: [
"developers/guides/run-a-node/use-docker",
"developers/guides/run-a-node/use-binary",
{
type: "category",
label: "Run the Linea stack",
link: {
type: "doc",
id: "developers/guides/run-linea/run-the-stack/index",
},
items: [
"developers/guides/run-linea/run-the-stack/local",
],
},
{
type: "category",
label: "Run a Linea node",
link: {
type: "doc",
id: "developers/guides/run-linea/run-a-node/index",
},
items: [
"developers/guides/run-linea/run-a-node/use-docker",
"developers/guides/run-linea/run-a-node/use-binary",
],
},
],
},

"developers/guides/linea-safe",
"developers/guides/linea-inscriptions",
],
Expand Down
7 changes: 4 additions & 3 deletions src/components/HomepageCards/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@ const CardList: CardItem[] = [
icon: CardIcon2,
},
{
title: "Run a node",
link: "/developers/guides/run-a-node",
title: "Run Linea",
link: "/developers/guides/run-linea",
description: (
<>
Learn how to run a Linea node with Besu or Geth, and interact with the
Learn how to run a Linea node or the Linea stack, and interact with the
blockchain locally

</>
),
buttonName: "Learn",
Expand Down
Binary file added static/img/docs/build-on-linea/linea-stack.png
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/create-a-dynamic-nft.jpg
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/create-an-nft.jpg
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/dipdup.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/irys-quickstart.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/run-the-linea-stack.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/tellor.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading