Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: full node guide #462

Merged
merged 6 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

84 changes: 84 additions & 0 deletions guides/full-node.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# 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:

```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
```
yarikbratashchuk marked this conversation as resolved.
Show resolved Hide resolved

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 [email protected]:26656 \
--p2p.laddr "0.0.0.0:46656"
```

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.
- 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
```
yarikbratashchuk marked this conversation as resolved.
Show resolved Hide resolved

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

## 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
Loading