Skip to content

Commit d783951

Browse files
authored
Merge pull request #87 from sei-protocol/dev-node_quickstart
Updates run-node quickstart guide
2 parents c41758b + d579ed9 commit d783951

File tree

1 file changed

+96
-12
lines changed

1 file changed

+96
-12
lines changed

pages/dev-node/quickstart.mdx

+96-12
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1-
# Running a Sei RPC node
2-
A full Sei node is a fundamental building block of the Sei Blockchain. It consists of a local copy of the blockchain, including its history and state. Running a full node is essential for participating in network operations like validating transactions, joining consensus, and broadcasting events to other network participants.
1+
# Quick start
32

4-
## System Configuration
5-
- CPU Cores RAM Disk
6-
- 16 cores 64GB 1TB NVMe
73

8-
## Quick start
9-
There is a setup script that runs a lot of the basic setup to easily get you started running an RPC node. If you are an advanced user, please see Node Configurations.
4+
For quick simple setups you can use the `run-node.py` script in the `./scripts` directory of the `sei-chain` repo. It allows you to choose which network to launch on, including a private local network purely for testing. This method bypasses the need for most initial environment setup or node configuration, although there are some basic configurables in the script near the top if needed.
105

11-
You can use this startup script:
6+
For more advanced setup, please refer to the [Node Operators guide](./node-operators.mdx).
127

13-
`python3 scripts/run-node.py`
8+
Before running the script, ensure you have the required dependencies, then simply run the script and follow the prompts to specify the network and database format. (Sei-db is highly recommended for increased speed & efficiency)
149

15-
```sh
10+
11+
12+
13+
```shell
14+
apt update && apt upgrade -y
15+
apt install python3 nano make build-essential gcc git jq chrony tar curl lz4 wget -y
16+
```
17+
18+
19+
```shell
1620
python3 scripts/run-node.py
1721

1822
..:=++****++=:.
@@ -33,5 +37,85 @@ python3 scripts/run-node.py
3337
.--. .:*###*:. ... .+###*-.
3438
.:+#######*-:..::*#####=.
3539
.-+###############*+:.
36-
..-+********+-..
37-
```
40+
..-+********+-.
41+
42+
[...]
43+
```
44+
45+
46+
## Configurable Parameters
47+
48+
Before running the script, take a moment to understand the configurable parameters near the top of the file. These parameters allow you to customize the installation process to fit several varying needs:
49+
50+
1. **moniker**:
51+
- **Description**: This is the custom name for your node.
52+
- **Default**: `"pynode"`
53+
- **Usage**: Any name you prefer for easy identification of your node.
54+
55+
2. **trust_height_delta**:
56+
- **Description**: The negative height offset for state sync. It defines how many blocks before the latest block you trust for syncing.
57+
- **Default**: `20000`
58+
- **Usage**: Adjust this, usually lawer if you experience syncing issues.
59+
60+
3. **enable_unsafe_reset**:
61+
- **Description**: Determines whether to wipe the existing configs, database and keys before setting up the node.
62+
- **Default**: `True`
63+
- **Usage**: Set to `False` if you want to retain existing data. Use `True` for a clean setup.
64+
65+
4. **version_override**:
66+
- **Description**: Overrides automatic version selection in favor of version(s) specified in [`ENV_TO_CONFIG`](https://github.com/sei-protocol/sei-chain/blob/3b8b27c597a93b968f17335f911d35b38e5cf1f6/scripts/run-node.py#L28)
67+
- **Default**: `False`
68+
- **Usage**: Set `True` to force version specified in the parameters below.
69+
70+
5. **MAINNET_VERSION, DEVNET_VERSION, TESTNET_VERSION**:
71+
- **Description**: Versions of the chain binary for several environments, both testing and production.
72+
- **Default**:
73+
- MAINNET_VERSION = `"v3.9.0"`
74+
- DEVNET_VERSION = `"v5.2.2"`
75+
- TESTNET_VERSION = `"v5.2.2"`
76+
- **Usage**: Specify the version to be installed if `version_override` is `True`.
77+
78+
6. **ENV_TO_CONFIG**:
79+
- **Description**: This maps environment names to their chain IDs and version overrides.
80+
- **Default**:
81+
```python
82+
ENV_TO_CONFIG = {
83+
"local": {"chain_id": None, "version": "latest"},
84+
"devnet": {"chain_id": "arctic-1", "version": DEVNET_VERSION},
85+
"testnet": {"chain_id": "atlantic-2", "version": TESTNET_VERSION},
86+
"mainnet": {"chain_id": "pacific-1", "version": MAINNET_VERSION}
87+
}
88+
```
89+
- **Usage**: Modify this dictionary to run a specific chian version for a given network.
90+
91+
---
92+
93+
## Running the Script
94+
95+
1. **Initial Setup**:
96+
- Ensure you have the required dependencies installed: Go 1.21, make, gcc, and Docker.
97+
- Backup any important existing data before proceeding, the script will wipe existing data by default.
98+
99+
2. **Execute the Script**:
100+
- Run the script using Python: `python3 ./scripts/run_node.py`
101+
- Follow the prompts to choose the environment (local, devnet, testnet, mainnet) and the database backend (legacy or sei-db).
102+
103+
3. **Environment Selection**:
104+
- The script will fetch the chain ID and version based on your environment selection. If `local` is selected, it will fetch the latest / most current version from GitHub.
105+
106+
4. **Installation and Configuration**:
107+
- The script will download the specified version, extract it, and install it using `make install`.
108+
- If `enable_unsafe_reset` is `True`, it will reset the Tendermint state and any existing configs + keys.
109+
- The script will initialize the node with the given moniker and chain ID.
110+
- For non-local environments, it will fetch state sync parameters, persistent peers, and apropriate genesis file.
111+
112+
5. **Configuration Files**:
113+
- The script will modify `config.toml` and `app.toml` based on your selections and the fetched data.
114+
- If `sei-db` is selected as the database backend, additional configurations will be applied to `app.toml`.
115+
116+
6. **Start the Node**:
117+
- The script then starts the node and begins to sync.
118+
- At this point you may stop the script [`ctrl+C`] and run the node manually or as a service, or keep running in the terminal as long as needed.
119+
120+
121+
---

0 commit comments

Comments
 (0)