Skip to content

Commit

Permalink
Merge branch 'client_test' of github.com:taikoxyz/taiko-mono into cli…
Browse files Browse the repository at this point in the history
…ent_test
  • Loading branch information
cyberhorsey committed May 23, 2024
2 parents bf7482b + a480bb5 commit 9094604
Show file tree
Hide file tree
Showing 315 changed files with 362,533 additions and 638 deletions.
6 changes: 5 additions & 1 deletion packages/docs-site/astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,13 @@ export default defineConfig({
label: "Run a Holesky node",
link: "/guides/run-a-holesky-node/",
},
{ label: "Run a Taiko node", link: "/guides/run-a-taiko-node/" },
{ label: "Run a Taiko Node with Docker", link: "/guides/run-a-taiko-node-with-docker/" },
{ label: "Build a Taiko Node from Source", link: "/guides/build-a-taiko-node-from-source/" },
// { label: "Run a Mainnet Taiko Node from Source", link: "/guides/run-a-mainnet-taiko-node-from-source/" },
{ label: "Run a Testnet Taiko Node from Source", link: "/guides/run-a-testnet-taiko-node-from-source/" },
{ label: "Enable a proposer", link: "/guides/enable-a-proposer/" },
{ label: "Enable a prover", link: "/guides/enable-a-prover/" },
{ label: "Node Troubleshooting", link:"/guides/node-troubleshooting/" }
],
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
---
title: Building a Node from Source
description: Learn how to build your own node without relying on simple-taiko-node or prebuilt images
---

import { Steps, Tabs, TabItem } from '@astrojs/starlight/components';

This guide shows you how to build your own node from source code.

You might want to do this if you want to run a node on a specific architecture or if you want to inspect the source code of the node you're running.

## Node Components

----------------------------------------------------------------------

A Taiko Node consists of two components, analogous to an Ethereum node; the consensus client and execution engine.

#### Taiko Client (taiko-client)

The taiko client is responsible for decoding L2 blocks from L1 calldata (and blobspace!), then passing those payloads to our execution engine.

It has three subcommands, `driver`, `prover`, and `proposer`.

The taiko client replaces the [consensus client](https://ethereum.org/en/developers/docs/nodes-and-clients/) in an Ethereum mainnet node.

In this tutorial you will build the `taiko-client` as found in the [taiko monorepo](https://github.com/taikoxyz/taiko-mono).

#### Execution Engine (taiko-geth)

The execution engine is responsible for executing the block payloads it receives from the taiko client. It holds the latest state of the chain.

`taiko-geth` exposes the standard JSON-RPC API that Ethereum developers are familiar with, and can be used accordingly to query blockchain data and submit transactions to the network.

`taiko-geth` replaces the [execution client](https://ethereum.org/en/developers/docs/nodes-and-clients/) in an Ethereum mainnet node.

In this tutorial you will build the `taiko-geth` implementation of `go-ethereum` as found in the [`taiko-geth` repository](https://github.com/taikoxyz/taiko-geth).

## Software Dependencies

| Dependency | Version | Version Check Command |
| ------------------------------------------------------------- | -------- | --------------------- |
| [git](https://git-scm.com/) | `^2` | `git --version` |
| [go](https://go.dev/) | `^1.21` | `go version` |
| [make](https://linux.die.net/man/1/make) | `^4` | `make --version` |

## Building the Taiko Client

First you're going to build `taiko-client`.

<Steps>

1. Clone the Taiko monorepo

The [Taiko monorepo](https://github.com/taikoxyz/taiko-mono) contains the source code for the `taiko-client`.

<Tabs>
<TabItem label="Mac/Linux">
```bash
git clone https://github.com/taikoxyz/taiko-mono.git
cd taiko-mono/packages/taiko-client
```
</TabItem>
<TabItem label="Windows">
```sh
git clone https://github.com/taikoxyz/taiko-mono.git
cd taiko-mono/packages/taiko-client && git config core.autocrlf false
```
</TabItem>
</Tabs>

2. Checkout the release branch you wish to run

Release branches are created when new versions of the `taiko-client` are created.
Find the branch you wish to check out in the [releases page](https://github.com/taikoxyz/taiko-mono/releases).

Search by `taiko-client` to find all relevant releases.

```bash
git checkout <release branch>
```

:::note
Make sure to read the releases page carefully to determine the correct branch to check out.
Some may be specific to testnet or mainnet.
:::

3. Build `taiko-client`

```bash
make build
```

</Steps>

## Building the Execution Engine

Next you're going to build `taiko-geth`.
<Steps>
1. Clone taiko-geth
The [`taiko-geth` repository](https://github.com/taikoxyz/taiko-geth) contains the source code for our execution engine.
<Tabs>
<TabItem label="Mac/Linux">
```bash
git clone https://github.com/taikoxyz/taiko-geth.git
cd taiko-geth
```
</TabItem>
<TabItem label="Windows">
```sh
git clone https://github.com/taikoxyz/taiko-geth.git
cd taiko-geth && git config core.autocrlf false
```
</TabItem>
</Tabs>
2. Checkout the release branch you wish to run
Release branches are created when new versions of the `taiko-geth` are created.
Find the branch you wish to check out in the [releases page](https://github.com/taikoxyz/taiko-geth/releases).
```bash
git checkout <release branch>
```
:::note
Make sure to read the releases page carefully to determine the correct branch to check out.
Some may be specific to testnet or mainnet.
:::
3. Build `taiko-geth`
```bash
make geth
```
</Steps>
## What's Next?
Now that you've built your own node from source, you can run it for Taiko Mainnet or Testnet!
{/* * Click here to [Run a Mainnet Taiko Node from Source](/guides/run-a-mainnet-taiko-node-from-source) */}
* Click here to [Run a Testnet Taiko Node from Source](/guides/run-a-testnet-taiko-node-from-source)
* If you run into any problems, please visit the [troubleshooting page](/guides/node-troubleshooting) for help.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Steps } from '@astrojs/starlight/components';

## Prerequisites

- You are already [running a Taiko node](/guides/run-a-taiko-node).
- You are already running a Taiko node [with Docker](/guides/run-a-taiko-node-with-docker) or [from source](/guides/build-a-taiko-node-from-source).

{/*## Using `stn`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Steps } from '@astrojs/starlight/components';

## Prerequisites

- You are already [running a Taiko node](/guides/run-a-taiko-node).
- You are already running a Taiko node [with Docker](/guides/run-a-taiko-node-with-docker) or [from source](/guides/build-a-taiko-node-from-source).

## Enable a prover with simple-taiko-node

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: Node Troubleshooting
description: This page describes common bugs and potential fixes
---

This page describes common bugs and potential fixes.

### `Caught SIGILL in blst_cgo_init`

If you get this error message, chances are you're using an older CPU that blst has trouble compiling on due to instruction differences.

In this case, please set your env as follows and try again.

```bash
CGO_CFLAGS="-O -D__BLST_PORTABLE__"
CGO_CFLAGS_ALLOW="-O -D__BLST_PORTABLE__"
```

### Failed to decode tx list: beacon client not found

This may mean that you may be missing the `--l1.beacon` flag or have filled it in incorrectly.

Please use an L1 Node that has a blob server configured!
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: Run a Mainnet Taiko Node From Source
description: This guide will help you start up a Taiko node.
---
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
---
title: Run a Taiko node
title: Run a Taiko node with Docker
description: This guide will help you start up a Taiko RPC node using simple-taiko-node.
---

import { Steps, Tabs, TabItem } from "@astrojs/starlight/components";

This guide will help you start up a Taiko RPC node using simple-taiko-node.
This guide will help you start up a Taiko RPC node using [simple-taiko-node](https://github.com/taikoxyz/simple-taiko-node).

## Software Dependencies

| Dependency | Version | Version Check Command |
| ------------------------------------------------------------- | -------- | --------------------- |
| [git](https://git-scm.com/) | `^2` | `git --version` |
| [Docker](https://docs.docker.com/engine/install/) | `^24.0` | `docker --version` |

## Prerequisites

- [Docker](https://docs.docker.com/engine/install/) is installed and **running**.
- [Git](https://github.com/git-guides/install-git/) is installed.
- If using Windows, you should install [Git BASH](https://gitforwindows.org/) or [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) to use as your terminal.
- 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 (at the time of writing).

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
---
title: Run a Testnet Taiko Node From Source
description: This guide will help you start up a Testnet (Hekla) Taiko node.
---

import { Steps, Tabs, TabItem } from "@astrojs/starlight/components";

This tutorial explains how to run an Taiko node for our testnet Hekla from source code.

## Building the Source Code

Please follow the [Building a Node from Source](/guides/build-a-taiko-node-from-source) guide before continuing.
This guide presumes you have built the required images already (`taiko-geth` and `taiko-client`).

## Hardware Requirements

These are the recommended specs of a [mainnet Geth node](https://geth.ethereum.org/docs/getting-started/hardware-requirements); the actual requirements may be lower.

* 16GB RAM
* 2TB SSD
* Quad-core CPU

Node operators should plan for future storage needs as the requirements will grow continuously.

### Create a JWT Secret

`taiko-geth` and `taiko-client` communicate over the standard Ethereum engine API authrpc. This communication is secured using a shared secret.

You will need to generate a shared secret in the form of a 32 byte hex string.

```bash
openssl rand -hex 32 > jwt.txt
```

### Start `taiko-geth`

It's generally better to start `taiko-geth` before you start `taiko-client` as you will encounter less error messages.

`taiko-geth` can be started without `taiko-client` and will wait until `taiko-client` begins communicating.

<Steps>

1. Navigate to your `taiko-geth` directory

Find the directory where you built the `taiko-geth` binary.

2. Copy the JWT secret you generated into the `taiko-geth` directory.

```bash
cp /path/to/jwt.txt .
```

3. Start taiko-geth

Use the following command to start `taiko-geth` in a default configuration.
The JSON-RPC API will become available on port 28545.

```bash
./build/bin/geth \
--taiko \
--networkid 167009 \
--gcmode archive \
--datadir ./data/taiko-geth \
--metrics \
--metrics.expensive \
--metrics.addr "0.0.0.0" \
--bootnodes enode://2f7ee605f84362671e7d7c6d47b69a3358b0d87e9ba4648befcae8b19453275ed19059db347c459384c1a3e5486419233c06bf6c4c6f489d81ace6f301a2a446@43.153.55.134:30303,enode://c067356146268d2855ad356c1ce36ba9f78c1633a72f9b7f686679c2ffe04bab6d24e48ef6eefb0e01aa00dff5024f7f94bc583da90b6027f40be4129bbbc5fd@43.153.90.191:30303,enode://acc2bdb6416feddff9734bee1e6de91e684e9df5aeb1d36698cc78b920600aed36a2871e4ad0cf4521afcdc2cde8e2cd410a57038767c356d4ce6c69b9107a5a@170.106.109.12:30303,enode://eb5079aae185d5d8afa01bfd2d349da5b476609aced2b57c90142556cf0ee4a152bcdd724627a7de97adfc2a68af5742a8f58781366e6a857d4bde98de6fe986@34.66.210.65:30303,enode://2294f526cbb7faa778192289c252307420532191438ce821d3c50232e019a797bda8c8f8541de0847e953bb03096123856935e32294de9814d15d120131499ba@34.72.186.213:30303 \
--authrpc.addr "0.0.0.0" \
--authrpc.port 28551 \
--authrpc.vhosts "*" \
--authrpc.jwtsecret ./jwt.txt \
--http \
--http.api admin,debug,eth,net,web3,txpool,miner,taiko \
--http.addr "0.0.0.0" \
--http.port 28545 \
--http.vhosts "*" \
--ws \
--ws.api admin,debug,eth,net,web3,txpool,miner,taiko \
--ws.addr "0.0.0.0" \
--ws.port 28546 \
--ws.origins "*" \
--gpo.ignoreprice "100000000" \
--port 30304 \
--syncmode full \
--state.scheme=path
```
</Steps>

### Start `taiko-client`

This guide assumes you are running both `taiko-geth` and `taiko-client` on the same machine.

If you aren't, you can configure the ports and addresses so that the services can access each other.
<Steps>
1. Navigate to your `taiko-client` directory
Find the directory where you built the `taiko-client` binary.
2. Copy the JWT secret
:::note
This should be the *same* JWT secret you used in the previous step for `taiko-geth`.
:::
```bash
cp /path/to/jwt.txt .
```
3. Set environment variables
The following URLs should be a Holesky node.
You will need either an RPC provider, or run a full Holesky node yourself.
```bash
export L1_WS=... # the WS address for the node to sync from.
export L1_BEACON_URL=... # URL address for the L1 Beacon-node HTTP endpoint to use.
```
4. Start taiko-client
Use the following command to start `taiko-client` in a default configuration.
You can find all other configurable flags by running `./bin/taiko-client driver`.
This command assumes you've run the `taiko-geth` command as is, if you've changed ports please change them accordingly.
```bash
./bin/taiko-client driver \
--l1.ws ${L1_WS} \
--l1.beacon ${L1_BEACON_URL} \
--l2.ws ws://localhost:28546 \
--taikoL1 0x79C9109b764609df928d16fC4a91e9081F7e87DB \
--taikoL2 0x1670090000000000000000000000000000010001 \
--jwtSecret ./jwt.txt \
--l2.auth http://localhost:28551/ \
--verbosity 3
```
:::note
If you've participated in our old testnets, the L1 Node is no longer required to be an archive node!
:::
</Steps>

### Syncing

Once you've started `taiko-geth` and `taiko-client` properly you should see them communicate with each other and start syncing.
Syncing can take several hours, depending on the size of the chain.
## Next Steps
* If you run into any problems, please visit the [troubleshooting page](/guides/node-troubleshooting) for help.
Loading

0 comments on commit 9094604

Please sign in to comment.