From 5c7a1227e1fed0fe7d0e81caa6cd390b897092eb Mon Sep 17 00:00:00 2001
From: Roger <50648015+RogerLamTd@users.noreply.github.com>
Date: Wed, 22 May 2024 04:12:15 -0400
Subject: [PATCH 1/4] feat(docs-site): node from source (#17208)
---
packages/docs-site/astro.config.ts | 6 +-
.../guides/build-a-taiko-node-from-source.mdx | 147 +++++++++++++++++
.../content/docs/guides/enable-a-proposer.mdx | 2 +-
.../content/docs/guides/enable-a-prover.mdx | 2 +-
.../docs/guides/node-troubleshooting.mdx | 23 +++
.../run-a-mainnet-taiko-node-from-source.mdx | 4 +
...e.mdx => run-a-taiko-node-with-docker.mdx} | 13 +-
.../run-a-testnet-taiko-node-from-source.mdx | 154 ++++++++++++++++++
8 files changed, 344 insertions(+), 7 deletions(-)
create mode 100644 packages/docs-site/src/content/docs/guides/build-a-taiko-node-from-source.mdx
create mode 100644 packages/docs-site/src/content/docs/guides/node-troubleshooting.mdx
create mode 100644 packages/docs-site/src/content/docs/guides/run-a-mainnet-taiko-node-from-source.mdx
rename packages/docs-site/src/content/docs/guides/{run-a-taiko-node.mdx => run-a-taiko-node-with-docker.mdx} (91%)
create mode 100644 packages/docs-site/src/content/docs/guides/run-a-testnet-taiko-node-from-source.mdx
diff --git a/packages/docs-site/astro.config.ts b/packages/docs-site/astro.config.ts
index 7f7e2bd6e05..c42d6690cbe 100644
--- a/packages/docs-site/astro.config.ts
+++ b/packages/docs-site/astro.config.ts
@@ -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/" }
],
},
{
diff --git a/packages/docs-site/src/content/docs/guides/build-a-taiko-node-from-source.mdx b/packages/docs-site/src/content/docs/guides/build-a-taiko-node-from-source.mdx
new file mode 100644
index 00000000000..a6e48974201
--- /dev/null
+++ b/packages/docs-site/src/content/docs/guides/build-a-taiko-node-from-source.mdx
@@ -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`.
+
+
+
+1. Clone the Taiko monorepo
+
+ The [Taiko monorepo](https://github.com/taikoxyz/taiko-mono) contains the source code for the `taiko-client`.
+
+
+
+ ```bash
+ git clone https://github.com/taikoxyz/taiko-mono.git
+ cd taiko-mono/packages/taiko-client
+ ```
+
+
+ ```sh
+ git clone https://github.com/taikoxyz/taiko-mono.git
+ cd taiko-mono/packages/taiko-client && git config core.autocrlf false
+ ```
+
+
+
+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
+ ```
+
+ :::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
+ ```
+
+
+
+## Building the Execution Engine
+
+Next you're going to build `taiko-geth`.
+
+
+
+1. Clone taiko-geth
+
+ The [`taiko-geth` repository](https://github.com/taikoxyz/taiko-geth) contains the source code for our execution engine.
+
+
+
+ ```bash
+ git clone https://github.com/taikoxyz/taiko-geth.git
+ cd taiko-geth
+ ```
+
+
+ ```sh
+ git clone https://github.com/taikoxyz/taiko-geth.git
+ cd taiko-geth && git config core.autocrlf false
+ ```
+
+
+
+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
+ ```
+
+ :::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
+ ```
+
+
+
+## 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.
\ No newline at end of file
diff --git a/packages/docs-site/src/content/docs/guides/enable-a-proposer.mdx b/packages/docs-site/src/content/docs/guides/enable-a-proposer.mdx
index e9010d85fa5..60309eaa8a1 100644
--- a/packages/docs-site/src/content/docs/guides/enable-a-proposer.mdx
+++ b/packages/docs-site/src/content/docs/guides/enable-a-proposer.mdx
@@ -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`
diff --git a/packages/docs-site/src/content/docs/guides/enable-a-prover.mdx b/packages/docs-site/src/content/docs/guides/enable-a-prover.mdx
index de25c60c739..d4f919cb87e 100644
--- a/packages/docs-site/src/content/docs/guides/enable-a-prover.mdx
+++ b/packages/docs-site/src/content/docs/guides/enable-a-prover.mdx
@@ -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
diff --git a/packages/docs-site/src/content/docs/guides/node-troubleshooting.mdx b/packages/docs-site/src/content/docs/guides/node-troubleshooting.mdx
new file mode 100644
index 00000000000..45242747725
--- /dev/null
+++ b/packages/docs-site/src/content/docs/guides/node-troubleshooting.mdx
@@ -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!
diff --git a/packages/docs-site/src/content/docs/guides/run-a-mainnet-taiko-node-from-source.mdx b/packages/docs-site/src/content/docs/guides/run-a-mainnet-taiko-node-from-source.mdx
new file mode 100644
index 00000000000..4425c0b6c90
--- /dev/null
+++ b/packages/docs-site/src/content/docs/guides/run-a-mainnet-taiko-node-from-source.mdx
@@ -0,0 +1,4 @@
+---
+title: Run a Mainnet Taiko Node From Source
+description: This guide will help you start up a Taiko node.
+---
\ No newline at end of file
diff --git a/packages/docs-site/src/content/docs/guides/run-a-taiko-node.mdx b/packages/docs-site/src/content/docs/guides/run-a-taiko-node-with-docker.mdx
similarity index 91%
rename from packages/docs-site/src/content/docs/guides/run-a-taiko-node.mdx
rename to packages/docs-site/src/content/docs/guides/run-a-taiko-node-with-docker.mdx
index 62329b806e1..53296f38296 100644
--- a/packages/docs-site/src/content/docs/guides/run-a-taiko-node.mdx
+++ b/packages/docs-site/src/content/docs/guides/run-a-taiko-node-with-docker.mdx
@@ -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).
diff --git a/packages/docs-site/src/content/docs/guides/run-a-testnet-taiko-node-from-source.mdx b/packages/docs-site/src/content/docs/guides/run-a-testnet-taiko-node-from-source.mdx
new file mode 100644
index 00000000000..8590253f16a
--- /dev/null
+++ b/packages/docs-site/src/content/docs/guides/run-a-testnet-taiko-node-from-source.mdx
@@ -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.
+
+
+
+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
+ ```
+
+
+### 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.
+
+
+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!
+ :::
+
+
+### 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.
\ No newline at end of file
From a551de1ce507aabb126d678871b7a0b4646869f3 Mon Sep 17 00:00:00 2001
From: Bernat Canal Garceran
Date: Wed, 22 May 2024 12:26:02 +0200
Subject: [PATCH 2/4] refactor(ui-lib): color export simplification (#17287)
Co-authored-by: bearni95
---
packages/ui-lib/.storybook/main.ts | 7 +-
.../src/lib/components/Footer/Footer.svelte | 46 +--
.../ResponsiveController.svelte | 13 +-
packages/ui-lib/src/lib/theme/colors.js | 75 ----
packages/ui-lib/src/lib/theme/dark-mode.js | 39 --
packages/ui-lib/src/lib/theme/light-mode.js | 39 --
packages/ui-lib/src/routes/+layout.ts | 5 +
packages/ui-lib/src/routes/+page.svelte | 25 +-
.../src/stories/Colors/Colors.stories.ts | 35 --
.../src/stories/Colors/Component.svelte | 26 --
packages/ui-lib/tailwind.config.js | 347 +++++++++++++++++-
11 files changed, 403 insertions(+), 254 deletions(-)
delete mode 100644 packages/ui-lib/src/lib/theme/colors.js
delete mode 100644 packages/ui-lib/src/lib/theme/dark-mode.js
delete mode 100644 packages/ui-lib/src/lib/theme/light-mode.js
create mode 100644 packages/ui-lib/src/routes/+layout.ts
delete mode 100644 packages/ui-lib/src/stories/Colors/Colors.stories.ts
delete mode 100644 packages/ui-lib/src/stories/Colors/Component.svelte
diff --git a/packages/ui-lib/.storybook/main.ts b/packages/ui-lib/.storybook/main.ts
index 45703fa98c0..d9a1d07d52b 100644
--- a/packages/ui-lib/.storybook/main.ts
+++ b/packages/ui-lib/.storybook/main.ts
@@ -7,15 +7,10 @@ export const framework = {
export const docs = { autodocs: false };
export const addons = [
- '@storybook/addon-links',
- '@storybook/addon-essentials',
- '@chromatic-com/storybook',
- '@storybook/addon-interactions',
- '@storybook/addon-themes'
+ '@storybook/addon-essentials'
];
const config: StorybookConfig = {
- //framework: '@taiko/ui-lib',
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
staticDirs: ['../static'],
framework: {
diff --git a/packages/ui-lib/src/lib/components/Footer/Footer.svelte b/packages/ui-lib/src/lib/components/Footer/Footer.svelte
index 507d164546f..01a7707f5b6 100644
--- a/packages/ui-lib/src/lib/components/Footer/Footer.svelte
+++ b/packages/ui-lib/src/lib/components/Footer/Footer.svelte
@@ -110,7 +110,7 @@
'flex flex-col',
'items-center',
'justify-center',
- 'bg-tko-background-elevated',
+ 'bg-background-elevated',
//'bg-primary',
'mt-5',
'p-5',
@@ -129,7 +129,7 @@
'text-xs',
'font-bold',
'font-sans',
- 'text-tko-content-primary'
+ 'text-content-primary'
);
const socialLinksWrapperClasses = classNames(
'w-full',
@@ -145,12 +145,12 @@
'flex flex-row',
'items-center',
'justify-center',
- 'bg-tko-background-neutral',
+ 'bg-background-neutral',
'lg:p-5',
'p-3',
'gap-3',
'rounded-xl',
- 'text-tko-content-primary',
+ 'text-content-primary',
'font-medium',
'lg:text-2xl',
'md:text-base',
@@ -187,14 +187,14 @@
'text-4xl',
'font-clash-grotesk',
'font-medium',
- 'text-tko-content-primary',
+ 'text-content-primary',
'md:text-left',
'text-center',
'w-full'
);
const bottomContentClasses = classNames(
- 'text-tko-content-secondary',
+ 'text-content-secondary',
'font-sans',
'text-base',
'font-normal',
@@ -213,7 +213,7 @@
'pt-6',
'font-sans',
'text-base',
- 'text-tko-content-secondary',
+ 'text-content-secondary',
'font-normal'
);
@@ -222,7 +222,7 @@
'flex flex-col',
'items-center',
'justify-center',
- 'bg-tko-background-neutral',
+ 'bg-background-neutral',
'rounded-3xl',
'p-7'
);
@@ -253,14 +253,14 @@
const textLinkTitleClasses = classNames(
'font-bold',
- 'text-tko-content-primary',
+ 'text-content-primary',
'text-base',
'uppercase'
);
const textLinkContentClasses = classNames(
'hover:text-primary',
- 'text-tko-content-secondary',
+ 'text-content-secondary',
'text-base',
'cursor-pointer'
);
@@ -275,9 +275,11 @@
'py-3',
'font-sans',
'text-base',
- 'text-tko-content-secondary',
+ 'text-content-secondary',
'font-normal'
);
+
+ $: hoveredIcon, console.log({ hoveredIcon });