-
Notifications
You must be signed in to change notification settings - Fork 57
docs: full node guide #462
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
cb6f466
Full node, before refining
yarikbratashchuk 81c1e0b
Rewording
yarikbratashchuk 4fc67f3
use bash instead of toml code block
yarikbratashchuk ee4b62b
update overview
yarikbratashchuk 60a99ff
Merge branch 'main' into yarik/fullnode-guide
yarikbratashchuk d700dc5
Add comments on moniker, jsonrpc and api ports, and tip on data dir
yarikbratashchuk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 [email protected]: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 | ||
``` | ||
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. | ||
|
||
:::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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.