Skip to content

Commit

Permalink
chore(website): update node running guides (#14298)
Browse files Browse the repository at this point in the history
  • Loading branch information
d1onys1us committed Jul 27, 2023
1 parent cee172b commit 5c14edb
Show file tree
Hide file tree
Showing 8 changed files with 399 additions and 375 deletions.
14 changes: 11 additions & 3 deletions packages/website/components/Home/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,20 @@ export function Hero() {
Decentralized, Ethereum-equivalent ZK-Rollup.
</p>
<div className="mt-10 flex md:justify-left">
<div className="inline-flex rounded-md shadow mr-4">
<a
href="/docs/guides/deploy-a-contract"
className="inline-flex items-center rounded-md border border-transparent bg-[#e81899] px-5 py-2.5 text-base font-semibold text-white dark:text-neutral-100 hover:bg-[#d1168a] hover:no-underline hover:text-white"
>
Deploy a contract
</a>
</div>
<div className="inline-flex rounded-md shadow">
<a
href="/docs"
className="inline-flex items-center rounded-md border border-transparent bg-[#e81899] px-5 py-3 text-base font-semibold text-white dark:text-neutral-100 hover:bg-[#d1168a] hover:no-underline hover:text-white"
href="/docs/guides/run-a-node"
className="inline-flex items-center rounded-md border-2 border-[#e81899] bg-transparent px-5 py-2.5 text-base font-semibold text-[#e81899] hover:border-[#d1168a] hover:text-[#d1168a] hover:no-underline"
>
Get started →
Run a node
</a>
</div>
</div>
Expand Down
11 changes: 6 additions & 5 deletions packages/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"dependencies": {
"@vercel/analytics": "^1.0.1",
"next": "^13.4.10",
"next": "^13.4.12",
"next-themes": "^0.2.1",
"nextra": "^2.10.0",
"nextra-theme-docs": "^2.10.0",
Expand All @@ -19,12 +19,13 @@
},
"devDependencies": {
"@heroicons/react": "^2.0.18",
"@types/node": "^20.4.2",
"@types/react": "^18.2.15",
"@types/node": "^20.4.5",
"@types/react": "^18.2.17",
"autoprefixer": "^10.4.14",
"postcss": "^8.4.26",
"daisyui": "^3.5.0",
"postcss": "^8.4.27",
"tailwindcss": "^3.3.3",
"typescript": "^5.1.6",
"viem": "^1.3.0"
"viem": "^1.4.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This guide will help you get a Sepolia archive node up and running.

- [Docker](https://docs.docker.com/engine/install/) is installed and **running**.
- [Git](https://github.com/git-guides/install-git/) is installed.
- As of `2023-06-21T16:59:11+00:00` a full archive node sync takes **207.3 GB** with geth + lighthouse. Consult the hardware requirements of the execution + consensus clients you are using.
- As of `2023-06-21` a full archive node sync takes **326 GB** with geth + lighthouse. Consult the hardware requirements of the execution + consensus clients you are using.

## Steps

Expand All @@ -33,9 +33,19 @@ Next, open the `.env` file in your preferred text editor and set:
ARCHIVE_NODE=true
```

### Expose RPC ports

You need to expose the node's RPC ports so that the Taiko L2 node can make calls to it. eth-docker offers a few options that you can read about [here](https://eth-docker.net/Usage/Advanced#sharing-rpc-and-rest-ports).

An easy option is to append `el-shared.yml` to the list of files set with the `COMPOSE_FILE` variable in the `.env` file. Keep in mind this is **not encrypted**, so you should not expose it to the internet.

### Complete the eth-docker quickstart

Complete the eth-docker quickstart: https://eth-docker.net/Usage/QuickStart/.
Complete the [eth-docker quickstart](https://eth-docker.net/Usage/QuickStart/). You will need to run the config command:

```sh
./ethd config
```

### Check your connection

Expand All @@ -51,6 +61,12 @@ This is important especially if you `ssh` into machine or open ports to the inte

- https://eth-docker.net/Usage/LinuxSecurity
- https://www.coincashew.com/coins/overview-eth/guide-or-how-to-setup-a-validator-on-eth2-mainnet/part-i-installation/guide-or-security-best-practices-for-a-eth2-validator-beaconchain-node
- https://tailscale.com/kb/1077/secure-server-ubuntu-18-04/ (but also see: https://danthesalmon.com/ufw-docker-tailscale/, `tailscale0` may not behave as you think)
- https://tailscale.com/kb/1077/secure-server-ubuntu-18-04
- https://danthesalmon.com/ufw-docker-tailscale
- https://github.com/chaifeng/ufw-docker

</Steps>

## Videos

- [Run a Sepolia L1 archive node (YouTube)](https://www.youtube.com/watch?v=7Lg_cY7iP2o)
180 changes: 41 additions & 139 deletions packages/website/pages/docs/guides/run-a-node/run-a-taiko-node.mdx
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import { Callout, Steps, Tab, Tabs } from "nextra-theme-docs";
import NodeTroubleshooting from "../../reference/node-troubleshooting.mdx";
import Image from "next/image";

# Run a Taiko node

This guide will walk you through the process of operating a Taiko node via [simple-taiko-node](https://github.com/taikoxyz/simple-taiko-node). You will be able to:

- Run a Taiko node easily from the command line on Windows, Mac, and Linux.
- View a [Grafana](https://grafana.com/) dashboard which displays the node's status.
This guide will help you start up a Taiko L2/L3 RPC node using [simple-taiko-node](https://github.com/taikoxyz/simple-taiko-node).

## Prerequisites

- [Docker](https://docs.docker.com/engine/install/) is installed and **running**.
- [Git](https://github.com/git-guides/install-git/) is installed.
- Consult the [Geth minimum hardware requirements](https://github.com/ethereum/go-ethereum#hardware-requirements), but ignore the storage requirement as Taiko nodes will require less storage. Around 50GB should be more than enough initially, but over time it could become insufficient as the chain grows. As of `2023-06-21T16:59:11+00:00` a Taiko node sync takes **17.3 GB**.
- Meet the [Geth minimum hardware requirements](https://github.com/ethereum/go-ethereum#hardware-requirements) except for the storage requirement because Taiko nodes will require less storage. As of `2023-07-27` an L2 sync takes **55 GB** and an L3 sync takes **4 GB**.

## Steps

Expand All @@ -31,31 +28,23 @@ cd simple-taiko-node
<Tab>

```sh
git config --global core.autocrlf false
git clone https://github.com/taikoxyz/simple-taiko-node.git
cd simple-taiko-node
git config core.autocrlf false
```

</Tab>
</Tabs>

### Configure your node (required)

To run a Grimsvotn L2 node:
### Copy the sample .env files

```sh
cp .env.sample .env
cp .env.sample .env && cp .env.sample.l3 .env.l3
```

To run a Eldfell L3 node:

```sh
cp .env.sample.l3 .env.l3
```
### Set the required values in the .env file

We will refer to `.env.l3` as `.env` for the purpose of this guide.

Next, open the `.env` file in your preferred text editor:
**First**, open the `.env` or `.env.l3` file in your preferred text editor:

<Tabs items={["Mac/Linux", "Windows"]} defaultIndex="0">
<Tab>
Expand All @@ -74,13 +63,13 @@ notepad .env
</Tab>
</Tabs>

Then, configure your base layer endpoint. This would be a Sepolia L1 RPC to run a Grimsvotn L2 node, and a Grimsvotn L2 RPC to run an Eldfell L3 node.
**Next**, you will retrieve the base layer endpoints.

<Callout>
You can get a base layer endpoint from a few places, but it **must point to an archive node** to access the state trie beyond the last 128 blocks.
You can get a base layer endpoint from a few places, but it **must point to an archive node** to access the state trie beyond the last 128 blocks.

**Recommended**:
Run your own Sepolia archive node, see: [Run a Sepolia node](/docs/guides/run-a-sepolia-node). This is recommended because you will eventually be rate-limited by public RPC providers. If you are running an Elfell L3 node, you will need to have a fully synced Grimsvotn L2 node.
Run your own Sepolia archive node, see: [Run a Sepolia node](/docs/guides/run-a-sepolia-node). This is recommended because you will eventually be rate-limited by public RPC providers. If you are running an Eldfell L3 node, you will need to have a fully synced Grimsvotn L2 node.

**Alternative**:
[Alchemy](https://www.alchemy.com/) and [Infura](https://www.infura.io/) are two popular RPC providers. Make sure you select the RPC as Sepolia testnet, and not Ethereum mainnet.
Expand All @@ -90,8 +79,8 @@ Run your own Sepolia archive node, see: [Run a Sepolia node](/docs/guides/run-a-
<Tabs items={["Local", "Alchemy", "Infura"]} defaultIndex="0">
<Tab>
If you are running a local Sepolia node, you cannot reference the L1 endpoints as `http://127.0.0.1:8545` and `ws://127.0.0.1:8546` because that is local to inside the simple-taiko-node Docker image. Depending on your firewall setup, you can do a few things. You can try:
- Using `host.docker.internal` (see: https://stackoverflow.com/questions/24319662)
- Using the local ip address of your machine (use something like `ip addr show` to get the ip address)
- Using `host.docker.internal` (see: [stack overflow](https://stackoverflow.com/questions/24319662))
- Using the private ip address of your machine (use something like `ip addr show` to get this ip address)
</Tab>
<Tab>
First, sign in to [Alchemy's dashboard](https://www.alchemy.com/).
Expand Down Expand Up @@ -144,148 +133,61 @@ This is your `L1_ENDPOINT_WS` on your `.env`.
</Tab>
</Tabs>

Finally, set the following environment variables:

- L1_ENDPOINT_HTTP
- L1_ENDPOINT_WS
**Finally**, set the base layer endpoints.

### Enable your node as a proposer (optional)
For a Grimsvotn L2 node this would be:

See [enable a proposer](/docs/guides/enable-a-proposer) for more information.
- `L1_ENDPOINT_HTTP`
- `L1_ENDPOINT_WS`

### Enable your node as a prover (optional)
For an Eldfell L3 node this would be:

See [enable a prover](/docs/guides/enable-a-prover) for more information.
- `L2_ENDPOINT_HTTP`
- `L2_ENDPOINT_WS`

### Start a node

<Callout type="info">
Keep in mind that for a Grimsvotn L2 node you will use `docker compose` for
all commands, and for an Eldfell L3 node you will use `docker compose -f
./docker-compose.l3.yml --env-file .env.l3` for all commands.
</Callout>

Make sure Docker is running and then run the following command to start the node. If you want to run it in the background, please add the `-d` flag (`docker compose up -d`).
Make sure Docker is running and then run the following command to start the node.

For a Grimsvotn L2 node:

```sh
docker compose up
```

For a Eldfell L3 node:

```sh
docker compose -f ./docker-compose.l3.yml --env-file .env.l3 up
```

To run the node in the background (detached mode), use the `-d` flag:

```sh
docker compose up -d
```

### Stop a node

This command shuts down the node, but will keep all volumes, so next time you restart the node, it won't need to synchronize from the genesis again.
For an Eldfell L3 node:

```sh
docker compose down
docker compose -f ./docker-compose.l3.yml --env-file .env.l3 up -d
```

### Remove a node
### Verify node is running

These commands will completely remove the node by removing all volumes used by each container:
A node dashboard will be running on `localhost` on the `GRAFANA_PORT` you set in your `.env` or `.env.l3` file. For a Grimsvotn L2 node that would default to: [http://localhost:3000/d/L2ExecutionEngine/l2-execution-engine-overview](http://localhost:3000/d/L2ExecutionEngine/l2-execution-engine-overview).

```sh
docker compose down -v
rm -f .env
```

### Update a node

Update the `simple-taiko-node` Docker images:

```sh
docker compose pull
```

### View the node's logs

To view the Docker logs, the following commands can be ran:

#### View all L2 logs

```sh
docker compose logs -f
```

#### View the L2 proposer image's logs

```sh
docker compose logs -f taiko_client_proposer
```
You can verify that your node is syncing by checking the **chain head** on the dashboard and seeing that it is increasing. Once the chain head matches what's on the block explorer, you are fully synced.

#### View the L2 prover image's logs

```sh
docker compose logs -f taiko_client_prover_relayer
```

#### View the L2 execution engine logs

```sh
docker compose logs -f l2_execution_engine
```

#### View all L3 logs

```sh
docker compose -f docker-compose.l3.yml logs -f
```

#### View the L3 proposer image's logs

```sh
docker compose -f docker-compose.l3.yml logs -f l3_taiko_client_proposer
```

#### View the L3 prover image's logs

```sh
docker compose -f docker-compose.l3.yml logs -f l3_taiko_client_prover_relayer
```

#### View the L3 execution engine logs

```sh
docker compose -f docker-compose.l3.yml logs -f l3_execution_engine
```

#### View the live data streams of your running containers

This shows the CPU/MEM USAGE % and consumption of your machine's resources (add prefix "`docker stats -a`" to display all containers)

```sh
docker stats
```
<br />

### View the node's status dashboard
<Image
src="/images/guides/node-dashboard.png"
alt="taiko node dashboard"
width={2539}
height={1106}
/>

A [Grafana](https://grafana.com/) dashboard with a [Prometheus](https://prometheus.io/) datasource is also included to display the L2 execution engine's real time status.
### Operate the node

You can visit it at [http://localhost:3000/d/L2ExecutionEngine/l2-execution-engine-overview](http://localhost:3000/d/L2ExecutionEngine/l2-execution-engine-overview).
You can find all node operations (eg. stop node, update node, remove node, view logs) in the [Node runner manual](/docs/manuals/node-runner-manual).

<br />
</Steps>

<img
width="2556"
alt="image"
src="https://user-images.githubusercontent.com/104078303/207779788-65d28e44-828e-491a-86a1-d8d9fc2ba81b.png"
/>
## Videos

</Steps>
- [Run a Taiko L2 node (YouTube)](https://www.youtube.com/watch?v=l_tVvDcuK5o)
- [Run a Taiko L3 node (YouTube)](https://www.youtube.com/watch?v=FCerB2PhLZI)

## Troubleshooting

<NodeTroubleshooting />
- View the [Node troubleshooting reference](/docs/reference/node-troubleshooting) for help on any common error codes / issues.
- View the logs of the node (see all log commands in the [Node runner manual](/docs/manuals/node-runner-manual)).
2 changes: 1 addition & 1 deletion packages/website/pages/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Here's the best guides to get started with trying Taiko:

Taiko is an open-source, community-driven project that welcomes and values every and any contribution. That's including both technical and non-technical contributions.

Take a look at the [contributing page](https://github.com/taikoxyz/taiko-mono/contribute) to get started as a contributor!
Take a look at the [contributing manual](/docs/manuals/contributing-manual) to get started as a contributor!

## Join the community

Expand Down
6 changes: 6 additions & 0 deletions packages/website/pages/docs/manuals/node-runner-manual.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,9 @@ docker compose logs -f zkevm_chain_prover_rpcd
```sh
docker compose -f ./docker-compose.l3.yml --env-file .env.l3 logs -f l3_zkevm_chain_prover_rpcd
```

## View system resource usage stats

```sh
docker stats
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5c14edb

Please sign in to comment.