Getting Started with Sei
1. System Requirements
Before beginning your Sei node setup, verify that your system meets the following minimum requirements:
Hardware Specifications
Component | Minimum | Recommended | Notes |
---|---|---|---|
CPU | 8 cores | 16 cores | Modern processor (Intel Xeon/Core i7/i9 or AMD Epyc/Ryzen) |
RAM | 32GB | 64GB | DDR4 or better |
Storage | 1TB NVMe SSD | 2TB NVMe SSD | High IOPS required; SATA SSDs are not recommended |
Network | 1Gbps | 2Gbps | Low latency connection is critical |
Base System Setup
Start with a fresh installation of Debian 12, Ubuntu 20.04 LTS (or later). Then, update your system and install essential packages:
sudo apt update && sudo apt upgrade -y
sudo apt install make gcc git jq chrony curl lz4 wget tar build-essential -y
Tip: Ensure your system clock is synchronized (via
chrony
orntpd
) and your timezone is UTC to avoid potential issues with block verification, IBC transfers etc.
2. Quick Start Options
2.1 Automated Setup Script (Development/Testing)
For rapid deployment or testing environments, use our automated setup script. This option is ideal when you want a quick way to spin up a node without diving deep into manual configuration:
git clone https://github.com/sei-protocol/sei-chain
cd sei-chain
python3 scripts/run-node.py
The script will guide you through selecting:
- Network: (mainnet, testnet, or local)
- Database backend: (with
sei-db
recommended) - Basic configuration options
2.2 Production Setup Overview
In general, setup follows this sequence:
- Install the
seid
Binary - Configure Your Node
- Initialize the Chain
- Set Up and Start the Node Service
3. Installation of the Sei Binary
Choose one of the following methods:
Option 1: Pre-built Binary
wget -O seid https://github.com/sei-protocol/sei-chain/releases/download/[version]/seid-[version]-linux-amd64
sudo mv seid /usr/local/bin/
sudo chmod +x /usr/local/bin/seid
Option 2: Build from Source
git clone https://github.com/sei-protocol/sei-chain
cd sei-chain
git checkout [version] # See below for version reference
make install
To determine the correct version for any given network (mainnet/testnet/devnet) please refer to this table
4. Node Initialization and Basic Configuration
4.1 Initialize Your Node
Set your node’s moniker and chain ID, then initialize the node:
# Set a "name" name and the relevant chain-id [pacific-1 / atlantic-2 / arctic-1]
MONIKER="your-node-name"
CHAIN_ID="pacific-1"
## Initialize node
seid init $MONIKER --chain-id $CHAIN_ID
4.2 Update Essential Settings
Confirm the minimum gas prices (min 0.02usei) by updating the app.toml
file:
sed -i 's/minimum-gas-prices = ""/minimum-gas-prices = "0.02usei"/g' ~/.sei/config/app.toml
5. Advanced Synchronization Options
Depending on your operational requirements, choose one of the following synchronization methods:
5.1 State Sync Configuration (Non-Archive Nodes)
State sync enables your node to rapidly catch up by fetching a recent snapshot from trusted peers rather than replaying all historical blocks.
Steps
Edit the [statesync]
Section:
In ~/.sei/config/config.toml
, update or add the following persistent peers:
d7ad900ff4bd1cdb37b69ce0ae631b98ef2506e7@p2p.state-sync-0.pacific-1.seinetwork.io:26656,
c79ecbb4f2f139b5a0eb3a3b323ea77e3b11387c@p2p.state-sync-1.pacific-1.seinetwork.io:26656,
ce46d5f39f30b62bc2f899a914f971daf53519dc@p2p.state-sync-2.pacific-1.seinetwork.io:26656
Automate Trust Parameter Configuration:
Use the following script to dynamically set the trust height and hash based on a provided RPC endpoint:
click to expand
#!/bin/bash
# Check if RPC URL or IP:PORT is provided
if [ -z "$1" ]; then
echo "Usage: $0 <rpc_url_or_ip:port>"
exit 1
fi
RPCADDR=$1
CONFIG_FILE="$HOME/.sei/config/config.toml"
# Fetch current height and latest block hash from /status
STATUS_DATA=$(curl -s "$RPCADDR/status" | jq -r '.sync_info.latest_block_height + " " + .sync_info.latest_block_hash')
CURRENT_HEIGHT=$(echo "$STATUS_DATA" | cut -d' ' -f1)
LATEST_HASH=$(echo "$STATUS_DATA" | cut -d' ' -f2)
if [ -z "$CURRENT_HEIGHT" ] || [ -z "$LATEST_HASH" ]; then
echo "Error: Could not fetch current height or latest block hash from $RPCADDR"
exit 1
fi
# Adjust the current height for safety
ADJUSTED_HEIGHT=$((CURRENT_HEIGHT - 9000))
ROUNDED_HEIGHT=$(( (ADJUSTED_HEIGHT / 10000) * 10000 + 1 ))
TRUST_HEIGHT=$ROUNDED_HEIGHT
# Fetch trust hash for the calculated trust height
BLOCK_DATA=$(curl -s "$RPCADDR/block?height=$TRUST_HEIGHT" | jq -r '.block_id.hash')
TRUST_HASH=$BLOCK_DATA
if [ -z "$TRUST_HASH" ]; then
echo "Error: Could not fetch trust hash for height $TRUST_HEIGHT from $RPCADDR"
exit 1
fi
# Update the config.toml file
if [ -f "$CONFIG_FILE" ]; then
sed -i "s/^enable = .*/enable = true/" "$CONFIG_FILE"
sed -i "s/^use-p2p = .*/use-p2p = true/" "$CONFIG_FILE"
sed -i "s/^trust-height = .*/trust-height = $TRUST_HEIGHT/" "$CONFIG_FILE"
sed -i "s/^trust-hash = .*/trust-hash = \"$TRUST_HASH\"/" "$CONFIG_FILE"
echo "Updated $CONFIG_FILE with the following values:"
echo " trust-height = $TRUST_HEIGHT"
echo " trust-hash = $TRUST_HASH"
else
echo "Error: Config file $CONFIG_FILE not found."
exit 1
fi
Usage:
chmod +x script.sh
./script.sh <rpc_url>
Engsure that the [statesync]
section already contains the persistent peers
listed above.
5.2 Archive Node Configuration
An archive node maintains the complete historical record of the chain. This requires disabling state sync and starting with a pre-existing database using a "snapshot".
Disable State Sync:
In ~/.sei/config/config.toml
, modify the [statesync]
section as follows:
#######################################################
### State Sync Configuration Options ###
#######################################################
[statesync]
enable = false
Configure Archive Node Peers:
To sync from the height your snapshot was created at, you need peers retaining
a large amount of historical blocks. These specific peers should be used during
initial sync, which can be changed at a later time.
2b0cbaac0ea04011b9f2eba189acad93649dfeb2@88.99.11.133:26656
35d3de63eb8f4c3b08eb0349c6e89ff536466861@88.198.0.190:26656
Restore from Snapshot:
Archive nodes must restore from a trusted, full historical snapshot. There may
be several providers, here is one of them:
Archive Snapshot Resources
Latest Snapshot JSON:
The snapshots are rotated weeekly - current/most recent snapshot details are
maintained in this JSON:
{
"network": "pacific-1",
"height": "128127546",
"type": "archive",
"mirror": "EU",
"url": "https://dl-eu2.ccvalidators.com/SNAPSHOTS/archive/sei/pacific-1_128127546.tar.lz4",
"filename": "pacific-1_128127546.tar.lz4",
"date": "2025-01-26 07:51",
"database": "seidb",
"size": "6.3T",
"provider": "CryptoCrew"
}
Snapshot Restoration
-
Stop the node service
sudo systemctl stop seid
-
Remove Existing Data Directory
mv ~/.sei/data ~/.sei/data_backup_$(date +%s)
-
Download and Extract the Snapshot: Follow the instructions from the linked markdown file or use a command similar to:
wget -O snapshot.tar.lz4 "https://dl-eu2.ccvalidators.com/SNAPSHOTS/archive/sei/pacific-1_128127546.tar.lz4"
lz4 -d snapshot.tar.lz4 | tar -x -C ~/.sei
- Restart the node service
sudo systemctl start seid
Additional guidance can be found here (opens in a new tab).
6. Mempool Configuration Tuning
For optimal transaction handling and resource management, it is suggested to
update the mempool settings in your config.toml
file as follows:
#######################################################
### Mempool Configuration Option ###
#######################################################
[mempool]
# Broadcast transactions to other nodes
broadcast = true
# Maximum number of transactions in the mempool
size = 5000
# Limit the total size of all txs in the mempool.
max-txs-bytes = 10737418240
# Size of the cache (used to filter duplicate transactions)
cache-size = 10000
# Do not remove invalid transactions from the cache
keep-invalid-txs-in-cache = false
# Maximum size of a single transaction
max-tx-bytes = 2048576
# Maximum size of a batch of transactions to send to a peer
max-batch-bytes = 0
# Time-to-live duration for transactions in the mempool
ttl-duration = "3s"
# Maximum number of blocks a transaction can remain in the mempool
ttl-num-blocks = 5
tx-notify-threshold = 0
check-tx-error-blacklist-enabled = false
check-tx-error-threshold = 0
pending-size = 5000
max-pending-txs-bytes = 1073741824
pending-ttl-duration = "3s"
pending-ttl-num-blocks = 5
Recommendation: Adjust these parameters if you encounter performance or resource issues.
7. Service Setup with systemd
Setting up a systemd service ensures that your node starts automatically on boot and restarts if it crashes.
sudo tee /etc/systemd/system/seid.service > /dev/null << EOF
[Unit]
Description=Sei Node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which seid) start
Restart=always
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable seid
sudo systemctl start seid
Note: Verify that the
User
field is correct for your environment. If running under a different user, update accordingly.
8. Verification and Troubleshooting
8.1 Verify Your Setup
Run the following commands to confirm your node’s status:
# View sync status
seid status | jq .SyncInfo
# Check live logs
journalctl -u seid -f -o cat
Your node is properly set up when:
- The sync status shows
"catching_up": false
- Logs indicate blocks are being processed
8.2 Common Troubleshooting Tips
Sync Issues
- Verify that you have sufficient disk space.
- Ensure stable network connectivity.
- Confirm that system time is correctly synchronized.
- Use state sync for a rapid initial sync (note: not applicable for archive nodes).
Performance Problems
- Monitor system resources (CPU, RAM, I/O).
- Evaluate disk performance and network bandwidth.
- Adjust mempool and persistent-peer settings if necessary.
Network Connectivity
- Confirm that firewall rules allow required ports (e.g., 26656, 26657, 9090).
- Check that DNS resolution is working correctly.
- Verify peer connectivity by reviewing system logs and node info through the RPC [localhost:26657/net_info]
9. Next Steps
After your node is up and running, consider the following:
- Monitoring & Alerting: Set up tools to monitor node health and performance.
- Security Best Practices: Harden your server (firewall, SSH keys, etc.).
- Backup Procedures: Regularly backup your configuration and data directories.
Additional documentation is available in: