Skip to content

Commit

Permalink
docs(website): add alerts for hackathon network config
Browse files Browse the repository at this point in the history
  • Loading branch information
dionysuzx committed Apr 15, 2023
1 parent 1a6b5c2 commit 332e5e3
Show file tree
Hide file tree
Showing 9 changed files with 116 additions and 49 deletions.
8 changes: 8 additions & 0 deletions packages/website/pages/docs/guides/build-a-dapp.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import { Callout } from "nextra-theme-docs";

<Callout>
Please use the [ETHTokyo network
config](/docs/reference/ethglobal-tokyo-reference.mdx) for the hackathon!
</Callout>

This guide will help you build a dapp on Taiko (Askja testnet)! The starter dapp highlights an important feature of Taiko: sending secure cross-chain messages between Taiko and Ethereum. Read more about cross-chain messaging [here](/docs/concepts/bridging/cross-chain-messaging).

## Prerequisites

- A curiosity to learn and build 🙃.

## Steps

1. Visit the [dapp-slaps starter template](https://github.com/d1onys1us/dapp-slaps) to create an Ethereum dapp with one-click.
9 changes: 9 additions & 0 deletions packages/website/pages/docs/guides/configure-your-wallet.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import AddEthereumChainButton from "../../../components/AddEthereumChainButton";
import { Steps } from "nextra-theme-docs";
import { Callout } from "nextra-theme-docs";

<Callout>
Please use the [ETHTokyo network
config](/docs/reference/ethglobal-tokyo-reference.mdx) for the hackathon!
</Callout>

This guide help you connect your wallet to Taiko (Askja testnet). There are two networks to configure your wallet with: **Ethereum (Sepolia testnet)** and **Taiko (Askja testnet)**.

Expand All @@ -18,8 +24,11 @@ This guide help you connect your wallet to Taiko (Askja testnet). There are two

### Add HORSE and BLL tokens to your wallet
Use your wallet (e.g., Metamask) and [import the tokens](https://support.ledger.com/hc/en-us/articles/6375103346077-Add-custom-tokens-to-MetaMask?docs=true) with [this configuration](https://gist.githubusercontent.com/d1onys1us/8f8824daed0882b1094296f824fae53c/raw/15204c4a4927a7f48a78c195323ce0d573d6b7c0/taiko_tokens.json).

</Steps>

## Troubleshooting

### The add chain buttons did not work

Try to manually add the network to your wallet using the [RPC configuration](/docs/reference/rpc-configuration).
39 changes: 25 additions & 14 deletions packages/website/pages/docs/guides/deploy-a-contract.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { Callout, Steps } from "nextra-theme-docs";

<Callout>
Please use the [ETHTokyo network
config](/docs/reference/ethglobal-tokyo-reference.mdx) for the hackathon!
</Callout>

<Callout type="warning" emoji="⚠️">
Make sure you are using a test / throwaway wallet, to be safe. Don't ever reveal the private key of your main wallet!
Make sure you are using a test / throwaway wallet, to be safe. Don't ever
reveal the private key of your main wallet!
</Callout>

This guide will help you deploy a smart contract to Taiko (Askja testnet) using Foundry.
Expand All @@ -10,12 +16,12 @@ This guide will help you deploy a smart contract to Taiko (Askja testnet) using

- [Foundry](https://book.getfoundry.sh/getting-started/installation) is installed.
- You have the private key handy to an account that has testnet ETH on Taiko (to pay the transaction fee for deploying the contract).
- [Retrieve private key with MetaMask](https://support.metamask.io/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key#:~:text=On%20the%20account%20page%2C%20click,click%20%E2%80%9CConfirm%E2%80%9D%20to%20proceed.).
- [Generate wallet keys with OpenSSL](https://gist.github.com/miguelmota/3793b160992b4ea0b616497b8e5aee2f).
- [Generate wallet keys with ethereumjs-wallet](https://piyopiyo.medium.com/how-to-generate-ethereum-private-key-and-address-in-local-offline-environment-90294308593c).
- [Retrieve private key with MetaMask](https://support.metamask.io/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key#:~:text=On%20the%20account%20page%2C%20click,click%20%E2%80%9CConfirm%E2%80%9D%20to%20proceed.).
- [Generate wallet keys with OpenSSL](https://gist.github.com/miguelmota/3793b160992b4ea0b616497b8e5aee2f).
- [Generate wallet keys with ethereumjs-wallet](https://piyopiyo.medium.com/how-to-generate-ethereum-private-key-and-address-in-local-offline-environment-90294308593c).
- Have some testnet ETH on Taiko:
- First, [request Sepolia ETH](/docs/guides/receive-tokens) from the faucet.
- Then, [use the bridge](/docs/guides/use-the-bridge) to send the testnet ETH to Taiko.
- First, [request Sepolia ETH](/docs/guides/receive-tokens) from the faucet.
- Then, [use the bridge](/docs/guides/use-the-bridge) to send the testnet ETH to Taiko.

## Steps

Expand All @@ -25,13 +31,18 @@ This guide will help you deploy a smart contract to Taiko (Askja testnet) using
forge init hello_foundry && cd hello_foundry
```

### Deploy the contract
Deploy the contract located at `src/Counter.sol`. Replace `YOUR_PRIVATE_KEY` below with your private key which has some testnet ETH on Taiko.
> Note: The `--legacy` flag is needed because EIP-1559 is currently disabled on Taiko—it will be re-enabled in the future.
```sh
forge create --legacy --rpc-url https://rpc.a2.taiko.xyz --private-key YOUR_PRIVATE_KEY src/Counter.sol:Counter
```
### Deploy the contract

Deploy the contract located at `src/Counter.sol`. Replace `YOUR_PRIVATE_KEY` below with your private key which has some testnet ETH on Taiko.

> Note: The `--legacy` flag is needed because EIP-1559 is currently disabled on Taiko—it will be re-enabled in the future.
```sh
forge create --legacy --rpc-url https://rpc.a2.taiko.xyz --private-key YOUR_PRIVATE_KEY src/Counter.sol:Counter
```

### View your contract

Paste the address from the output into the [Taiko block explorer](https://explorer.a2.taiko.xyz) and verify that the contract was deployed.

### View your contract
Paste the address from the output into the [Taiko block explorer](https://explorer.a2.taiko.xyz) and verify that the contract was deployed.
</Steps>
15 changes: 10 additions & 5 deletions packages/website/pages/docs/guides/enable-a-prover.mdx
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import { Callout, Steps } from "nextra-theme-docs";

<Callout>
Please use the [ETHTokyo network
config](/docs/reference/ethglobal-tokyo-reference.mdx) for the hackathon!
</Callout>
<Callout>
Only the first prover can get the reward, and others will be rejected by the protocol smart contract. This means the fastest prover will be able to prove the block and earn the reward, **if you have just the minimum hardware outlined in the prerequisited below, running a single prover, it's unlikely you will be able to prove any blocks (because you will be competing against other high-performance provers)**.

Meaning, if you do not have a powerful prover, the primary purpose of running a prover is to help test out and provide community feedback on running the node software. Keep in mind this will have a cost in electricity on your computer, and if you are not proving blocks, it's unlikely you will receive a reward to offset that electricity cost.
</Callout>

</Callout>

## Prerequisites

- Must have some ETH on Sepolia (see [receive tokens](/docs/guides/receive-tokens)).
- Should have at least 8/16 core CPU and 32GB of RAM. (**note: see warning above**)


## Steps

<Steps>
Expand All @@ -21,10 +25,11 @@ Set the following environment variables to enable your node as a prover:
- Set `L1_PROVER_PRIVATE_KEY` to that of your wallet's private key; it will need some balance on Sepolia to prove blocks (if using MetaMask, follow these directions to [retrieve the private key](https://metamask.zendesk.com/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key)).

### Verify prover logs
Verify you have some prover logs:
- `💰 Your block proof was accepted` means you are the first prover and receive the reward.
- `✅ Valid block proven` just means a proposed block was successfully proved on TaikoL1 (by anyone).

Verify you have some prover logs: - `💰 Your block proof was accepted` means you are the first prover and receive the reward. - `✅ Valid block proven` just means a proposed block was successfully proved on TaikoL1 (by anyone).

</Steps>

## Troubleshooting

Consult [Run a node - Troubleshooting](/docs/guides/run-a-node#troubleshooting) for common issues.
9 changes: 8 additions & 1 deletion packages/website/pages/docs/guides/receive-tokens.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { Callout, Steps } from "nextra-theme-docs";

<Callout>
Please use the [ETHTokyo network
config](/docs/reference/ethglobal-tokyo-reference.mdx) for the hackathon!
</Callout>

<Callout type="info" emoji="ℹ️">
The HORSE token and BLL token are both dummy test tokens that are used for testing the bridge and swap.
The HORSE token and BLL token are both dummy test tokens that are used for
testing the bridge and swap.
</Callout>

This guide will help you receive testnet tokens from the faucet(s).
Expand All @@ -26,4 +32,5 @@ This guide will help you receive testnet tokens from the faucet(s).

### Receive BLL
Repeat the previous step for receiving HORSE, except select "BLL" from the dropdown.

</Steps>
59 changes: 35 additions & 24 deletions packages/website/pages/docs/guides/run-a-node.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { Callout, Steps, Tab, Tabs } from "nextra-theme-docs";

<Callout>
Please use the [ETHTokyo network
config](/docs/reference/ethglobal-tokyo-reference.mdx) for the hackathon!
</Callout>

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.
Expand Down Expand Up @@ -34,21 +39,9 @@ Next, open the `.env` file in your preferred text editor:
{" "}

<Tabs items={["Mac", "Linux", "Windows"]} defaultIndex="0">
<Tab>
```sh
nano .env
```
</Tab>
<Tab>
```sh
vim .env
```
</Tab>
<Tab>
```sh
notepad .env
```
</Tab>
<Tab>```sh nano .env ```</Tab>
<Tab>```sh vim .env ```</Tab>
<Tab>```sh notepad .env ```</Tab>
</Tabs>

Finally, set the following environment variables:
Expand All @@ -58,7 +51,9 @@ Finally, set the following environment variables:

<Callout>
You can get a Sepolia L1 endpoint from a few places,
[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**.
[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**.
</Callout>

### Enable your node as a prover (optional)
Expand All @@ -68,7 +63,11 @@ See [enable a prover](/docs/guides/enable-a-prover) for more information.
### Start a node

<Callout>
If you ran an alpha-1 testnet node make sure to first run a `docker compose down -v` to remove the old volumes. Also, it may take some time to synchronize from the genesis block. You can monitor this progress through logs, or in the local grafana dashboard and see the latest L2 chain status in the [Taiko alpha-2 block explorer](https://explorer.a2.taiko.xyz/).
If you ran an alpha-1 testnet node make sure to first run a `docker compose
down -v` to remove the old volumes. Also, it may take some time to synchronize
from the genesis block. You can monitor this progress through logs, or in the
local grafana dashboard and see the latest L2 chain status in the [Taiko
alpha-2 block explorer](https://explorer.a2.taiko.xyz/).
</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`).
Expand Down Expand Up @@ -130,8 +129,10 @@ docker compose logs -f taiko_client_prover_relayer
docker compose logs -f l2_execution_engine
```

###### View the live data streams of your running containers
###### 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
```
Expand All @@ -153,37 +154,47 @@ A [Grafana](https://grafana.com/) dashboard with a [Prometheus](https://promethe
## Troubleshooting

### Node warning logs

You can ignore any WARN logs.

### Node error logs
### Node error logs

#### `error: L1_ID`

The block that you want to prove has already been verified, you can ignore this.

#### `error: L1_ALREADY_PROVEN`

This block has been proven by someone else, but its not verified yet, you can ignore it.

#### `Fatal: Failed to register the Ethereum service: database contains incompatible genesis`
Try to remove the node with `docker compose down -v` and then try again.

Try to remove the node with `docker compose down -v` and then try again.

#### `Unhandled trie error: missing trie node`

You can ignore this error, it doesn't affect you and goes away after a while.

#### `Block batch iterator callback error; error="failed to fetch L2 parent block: not found`

You can ignore this error.

#### `Error starting ...: listen tcp4 0.0.0.0:{port} bind: address already in use`

The port is already in use by another service. You can either shut down the other program or change the port in the .env file.

#### `error parsing HTTP 403 response body: invalid character '<' looking for beginning of value`

Your IP address is being geo-blocked due to sanctions lists. If you're affected, try changing hosting locations or utilize a VPN to change your IP address.

#### `ERROR: The Compose file './docker-compose.yml' is invalid because: Unsupported config option for some_service 'pull_policy'`
Your docker installation is out of date. You need to update your docker compose installation: https://docs.docker.com/compose/install/.

#### `daemon docker is not running` <br></br> `Cannot connect to the Docker daemon`
Need to start the Docker before running the commands.
Your docker installation is out of date. You need to update your docker compose installation: https://docs.docker.com/compose/install/.

#### `daemon docker is not running` <br></br> `Cannot connect to the Docker daemon`

Need to start the Docker before running the commands.

#### `database contains incompatible genesis`
If you ran an alpha-1 testnet node make sure to first run a docker compose down -v to remove the old volumes.

If you ran an alpha-1 testnet node make sure to first run a docker compose down -v to remove the old volumes.
10 changes: 9 additions & 1 deletion packages/website/pages/docs/guides/swap-tokens.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { Callout, Steps } from "nextra-theme-docs";

<Callout>
Please use the [ETHTokyo network
config](/docs/reference/ethglobal-tokyo-reference.mdx) for the hackathon!
</Callout>

<Callout type="info" emoji="ℹ️">
The HORSE token and BLL token are both dummy test tokens that are used for testing the bridge and swap.
The HORSE token and BLL token are both dummy test tokens that are used for
testing the bridge and swap.
</Callout>

This guide will help you interact with Swap, which is a fork of Uniswap v2 which Taiko has deployed only for testing purposes.
Expand All @@ -25,9 +31,11 @@ This guide will help you interact with Swap, which is a fork of Uniswap v2 which
Provide liquidity to a pool. You can receive some testnet tokens [here](/docs/guides/receive-tokens).

![provide liquidity](/images/guides/swap-liquidity.png)

</Steps>

## Troubleshooting

### Token list does not show up

If the "Taiko Tokens List" does not show up at "Select a list", you can add [this token list](https://gist.githubusercontent.com/d1onys1us/8f8824daed0882b1094296f824fae53c/raw/15204c4a4927a7f48a78c195323ce0d573d6b7c0/taiko_tokens.json).
12 changes: 10 additions & 2 deletions packages/website/pages/docs/guides/use-the-bridge.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { Callout, Steps } from "nextra-theme-docs";

<Callout type="warning" emoji="⚠️">
The BLL token should succeed when **minting** from the faucet, and when **sending the bridge message** to Sepolia or Taiko. However, it will fail about 50% of the time when **claiming** on Sepolia—this is intentionally done so we can test the error handling.
<Callout>
Please use the [ETHTokyo network
config](/docs/reference/ethglobal-tokyo-reference.mdx) for the hackathon!
</Callout>

<Callout type="warning" emoji="⚠️">
The BLL token should succeed when **minting** from the faucet, and when
**sending the bridge message** to Sepolia or Taiko. However, it will fail
about 50% of the time when **claiming** on Sepolia—this is intentionally done
so we can test the error handling.
</Callout>

This guide will help you use the bridge to send tokens between Sepolia and Taiko (Askja testnet). You can read more about how bridging works [here](/docs/concepts/bridging/cross-chain-messaging).

Expand All @@ -26,4 +33,5 @@ This guide will help you use the bridge to send tokens between Sepolia and Taiko

### Bridge tokens from Taiko to Sepolia
Try bridging ETH, HORSE, and/or BLL from Taiko to Sepolia. You can also try manually claiming the transfer yourself by clicking the "Claim" button under the "Transactions" tab.

</Steps>
4 changes: 2 additions & 2 deletions packages/website/theme.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ export default {
key: "banner",
text: (
<a
href="https://mirror.xyz/labs.taiko.eth/A6G6TNN-CXDAhl42k_bNHg_20fyGcT0xH-LBBSOPNzU"
href="https://taiko.xyz/docs/reference/ethglobal-tokyo-reference"
target="_blank"
>
🌋 Askja testnet is here! Learn more
📌 Please use the <u>ETHTokyo network config</u> for the hackathon
</a>
),
},
Expand Down

0 comments on commit 332e5e3

Please sign in to comment.