Skip to content

Commit

Permalink
docs: full node guide (#462)
Browse files Browse the repository at this point in the history
* Full node, before refining

* Rewording

* use bash instead of toml code block

* update overview

* Add comments on moniker, jsonrpc and api ports, and tip on data dir
  • Loading branch information
yarikbratashchuk authored Sep 23, 2024
1 parent f0770dd commit c564635
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 101 deletions.
4 changes: 2 additions & 2 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ function sidebarHome() {
link: "/guides/restart-rollup",
},
{
text: "Run as a full and sequencer node",
link: "/guides/full-and-sequencer-node",
text: "Run a rollup full node",
link: "/guides/full-node",
},
{
text: "Configuration",
Expand Down
98 changes: 0 additions & 98 deletions guides/full-and-sequencer-node.md

This file was deleted.

91 changes: 91 additions & 0 deletions guides/full-node.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Rollup Full Node Setup Guide

## Introduction

This guide covers how to set up a full node to run alongside a sequencer node in a Rollkit-based blockchain network. A full node maintains a complete copy of the blockchain and helps validate transactions, improving the network's decentralization and security.

## Prerequisites

Before starting, ensure you have:

- A local Data Availability (DA) network node running on port `7980`.
- A Rollkit sequencer node running and posting blocks to the DA network.
- The Rollkit CLI installed on your system.

## Setting Up Your Full Node

### Initialize Chain Config and Copy Genesis File

First, update the `config_dir` in the `rollkit.toml` file:

```bash
[chain]
config_dir = "/root/.yourrollupd" // [!code --]
config_dir = "/root/.yourrollupd_fn" // [!code ++]
```

Initialize the chain config for the full node, lets call it `FullNode` and set the chain ID to your rollup chain ID:

```bash
rollkit init FullNode --chain-id=your-rollup-chain-id
```

Copy the genesis file from the sequencer node:

```bash
cp /root/.yourrollupd/config/genesis.json /root/.yourrollupd_fn/config/genesis.json
```

### Set Up P2P Connection to Sequencer Node

Identify the sequencer node's P2P address from its logs. It will look similar to:

```
1:55PM INF listening on address=/ip4/127.0.0.1/tcp/36656/p2p/12D3KooWJbD9TQoMSSSUyfhHMmgVY3LqCjxYFz8wQ92Qa6DAqtmh
```

Create an environment variable with the P2P address:

```bash
export P2P_ID="12D3KooWJbD9TQoMSSSUyfhHMmgVY3LqCjxYFz8wQ92Qa6DAqtmh"
```

### Start the Full Node

Run your full node with the following command:

```bash
rollkit start --rollkit.aggregator=false \
--rollkit.da_address http://127.0.0.1:7980 \
--rpc.laddr tcp://127.0.0.1:46657 \
--grpc.address 127.0.0.1:9390 \
--p2p.seeds $P2P_ID@127.0.0.1:26656 \
--p2p.laddr "0.0.0.0:46656" \
--json-rpc.ws-address 127.0.0.1:8547 \
--api.address tcp://localhost:1318
```

Key points about this command:
- `--rollkit.aggregator=false` indicates this is not an aggregator node.
- The ports and addresses are different from the sequencer node to avoid conflicts. Not everything may be necessary for your setup.
- We use the `P2P_ID` environment variable to set the seed node.

## Verifying Full Node Operation

After starting your full node, you should see output similar to:

```
2:33PM DBG indexed transactions height=1 module=txindex num_txs=0
2:33PM INF block marked as DA included blockHash=7897885B959F52BF0D772E35F8DA638CF8BBC361C819C3FD3E61DCEF5034D1CC blockHeight=5532 module=BlockManager
```

This output indicates that your full node is successfully connecting to the network and processing blocks.

:::tip
If your rollup uses EVM as an execution layar and you see an error like `datadir already used by another process`, it means you have to remove all the state from rollup data directory (`/root/.yourrollup_fn/data/`) and specify a different data directory for the EVM client.
:::


## Conclusion

You've now set up a full node running alongside your Rollkit sequencer.
2 changes: 1 addition & 1 deletion guides/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ In this section, you'll find:
* [How to restart your rollup](/guides/restart-rollup.md)
* [zkML rollup](/guides/zkml.md)
* [IBC connection](/guides/ibc-connection.md)
* [Full and sequencer node rollup setup](/guides/full-and-sequencer-node.md)
* [Full rollup node setup](/guides/full-node.md)
* [How to configure gas price](/guides/gas-price.md)
* [How to change speed of block production](/guides/block-times.md)
* [How to use lazy sequencing (aggregation)](/guides/lazy-sequencing.md)
Expand Down

0 comments on commit c564635

Please sign in to comment.