Skip to content

Commit

Permalink
docs(website): Docs guides nodes curl request chainId and consensus l…
Browse files Browse the repository at this point in the history
…ayer syncing status (#14414)

Co-authored-by: d1onys1us <13951458+d1onys1us@users.noreply.github.com>
  • Loading branch information
MarcusWentz and dionysuzx authored Aug 10, 2023
1 parent bd8c953 commit b84afe4
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,34 @@ sudo ./ethd up

### Check your connection

Check if the node is connected and synced by requesting the latest Sepolia block from the Execution Layer client (change port from `8545` to whatever you have the execution client p2p port set to in your `.env` file):
Check if the Execution Layer client is connected to Sepolia (change port from `8545` to whatever you have the execution client p2p port set to in your `.env` file)

```bash
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":0}' http://127.0.0.1:8545
curl http://localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_chainId","params":[],"id":1,"jsonrpc":"2.0"}'
```

which should return chainId = 0xaa36a7 = 11155111

```json
{ "jsonrpc": "2.0", "id": 0, "result": "0xaa36a7" }
```

Wait for your Consensus Layer client to fully sync by checking

```bash
./ethd logs -f consensus
```

Check if the Execution Layer client is synced by requesting the latest Sepolia block from the Execution Layer client

```bash
curl http://localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_blockNumber","params":[],"id":1,"jsonrpc":"2.0"}'
```

If your response block number is less than the current block, check the Execution Layer client logs:
Expand Down
46 changes: 44 additions & 2 deletions packages/website/pages/docs/guides/run-a-node/run-a-taiko-node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -152,17 +152,57 @@ Make sure Docker is running and then run the following command to start the node
For a Grimsvotn L2 node:

```sh
docker compose up -d --remove-orphans
sudo docker compose up -d --remove-orphans
```

For an Eldfell L3 node:

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

### Verify node is running

#### Check with curl commands

1. Check if the Execution Layer client is connected to Taiko L2 / L3:

```bash
curl http://localhost:8547 \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_chainId","params":[],"id":1,"jsonrpc":"2.0"}'
```

which should return the chainId as `0x28c5d` (167005):

```json
{"jsonrpc":"2.0","id":0,"result":"0x28c5d"}
```

For Taiko L3, use port 8549 for the `eth_chainId` curl request and you should get chainId `0x28c5e` (167006).

2. Check if the Execution Layer client is synced by requesting the latest Taiko L2 / L3 block from the Execution Layer client:

```bash
curl http://localhost:8547 \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_blockNumber","params":[],"id":1,"jsonrpc":"2.0"}'
```

3. If the blockNumber response value is `0` or not growing, check the Taiko L2 logs here:
```bash
sudo docker compose logs -f
```
or the Taiko L3 logs here
```bash
sudo docker compose -f ./docker-compose.l3.yml --env-file .env.l3 logs -f
```
If you find an error, check the [Node troubleshooting](/docs/reference/node-troubleshooting) page.

#### Check with the node dashboard

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:3001/d/L2ExecutionEngine/l2-execution-engine-overview](http://localhost:3001/d/L2ExecutionEngine/l2-execution-engine-overview).

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.
Expand All @@ -176,6 +216,8 @@ You can verify that your node is syncing by checking the **chain head** on the d
height={1106}
/>

If you find an error, check the [Node troubleshooting](/docs/reference/node-troubleshooting) page.

### Operate the node

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).
Expand Down

0 comments on commit b84afe4

Please sign in to comment.