Celestia Light Node
Light nodes are the most efficient way to interact with the Celestia network. They perform data availability sampling to verify that block data is available without downloading the entire block.
What is a Light Node?
A Celestia Light Node:
- Downloads block headers but not the full block data
- Performs data availability sampling to verify block data availability
- Requires minimal resources (storage and bandwidth)
- Provides security guarantees through fraud proofs
- Can submit transactions and query network state
System Requirements
System Requirements
Minimum Requirements
- CPU: 1 core
- RAM: 2 GB
- Storage: 25 GB SSD
- Network: 100 Mbps
Recommended Requirements
- CPU: 2 cores
- RAM: 4 GB
- Storage: 50 GB SSD
- Network: 100 Mbps
Prerequisites
Ensure you have completed the Installation guide before proceeding.
Initialize Light Node
Initialize light node
celestia light init --p2p.network blockspacerace
Backup Your Keys
Save the address and mnemonic phrase displayed after initialization! You'll need them to recover your node.
Configuration
Basic Configuration
Edit configuration
# Open configuration file
nano ~/.celestia-light-blockspacerace-0/config.toml
Key Configuration Options
[Core]
# Core node RPC endpoint
IP = "127.0.0.1"
RPCPort = "26657"
GRPCPort = "9090"
[P2P]
# Network to connect to
Network = "blockspacerace"
# Listen address
ListenAddresses = ["/ip4/0.0.0.0/tcp/2121"]
[RPC]
# RPC server settings
Address = "127.0.0.1"
Port = "26658"
[Gateway]
# Gateway API settings
Address = "127.0.0.1"
Port = "26659"
Enabled = true
Start the Light Node
Manual Start
Start light node manually
celestia light start --p2p.network blockspacerace
Service Setup
Service Management Commands
- Basic Commands
- Auto-start
- Logs
Start service
sudo systemctl start celestia-light
Stop service
sudo systemctl stop celestia-light
Restart service
sudo systemctl restart celestia-light
Check status
sudo systemctl status celestia-light
Enable auto-start on boot
sudo systemctl enable celestia-light
Disable auto-start
sudo systemctl disable celestia-light
View real-time logs
sudo journalctl -u celestia-light -f --no-hostname -o cat
View last 100 lines
sudo journalctl -u celestia-light -n 100 --no-hostname -o cat
Verification
Check Node Status
Check if node is running
# Check service status
sudo systemctl status celestia-light
# Check if RPC is responding
curl -X GET http://localhost:26658/head
Check Sync Status
Check sync status
celestia light header sync-state --p2p.network blockspacerace
Expected output when synced:
{
"result": {
"id": 1,
"height": 123456,
"from_height": 1,
"to_height": 123456,
"from_hash": "A1B2C3...",
"to_hash": "D4E5F6...",
"start": "2023-10-01T10:00:00Z",
"end": "2023-10-01T10:05:00Z"
}
}
API Usage
Basic API Calls
Test API endpoints
# Get latest header
curl -X GET http://localhost:26658/head
# Get header by height
curl -X GET http://localhost:26658/header/123456
# Submit blob data
curl -X POST http://localhost:26658/submit_pfb -H "Content-Type: application/json" -d '{
"namespace_id": "0c204d39600fddd3",
"data": "SGVsbG8gQ2VsZXN0aWE=",
"gas_limit": 80000,
"fee": 2000
}'
JavaScript SDK Example
Connect with JS SDK
import { NodeHttpRpc } from "@celestiaorg/celestia-rpc";
const rpc = new NodeHttpRpc("http://localhost:26658");
// Get latest header
const header = await rpc.header.get();
console.log("Latest height:", header.height);
// Submit blob
const blob = {
namespace: new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1]),
data: new TextEncoder().encode("Hello Celestia!")
};
const response = await rpc.blob.submit([blob], {
fee: 2000,
gasLimit: 80000
});
console.log("Blob submitted:", response);
Monitoring
Log Analysis
Monitor logs
# Follow logs in real-time
sudo journalctl -fu celestia-light
# Check for errors
sudo journalctl -u celestia-light | grep -i error
# Check sync progress
sudo journalctl -u celestia-light | grep -i "syncing"
Key Metrics to Monitor
- Sync Height: Should match network height
- Peer Count: Should maintain stable connections
- Sampling Rate: Data availability sampling success rate
- API Response Time: RPC endpoint performance
Troubleshooting
Common Issues
Node Not Syncing
Check peers and connectivity
# Check peer connections
celestia light p2p peers --p2p.network blockspacerace
# Reset and restart if needed
sudo systemctl stop celestia-light
celestia light unsafe-reset-store --p2p.network blockspacerace
sudo systemctl start celestia-light
RPC Not Responding
Check RPC configuration
# Verify RPC is enabled in config
grep -A 5 "[RPC]" ~/.celestia-light-blockspacerace-0/config.toml
# Check if port is listening
netstat -tulpn | grep :26658
# Test local connection
curl -v http://localhost:26658/head
High Resource Usage
Optimize resource usage
# Check disk usage
du -sh ~/.celestia-light-blockspacerace-0/
# Prune old data (if supported)
celestia light prune --p2p.network blockspacerace
# Monitor resource usage
htop
iotop
Security Best Practices
-
Firewall Configuration
- Only expose necessary ports (26658 for RPC, 2121 for P2P)
- Use firewall rules to limit access
-
Key Management
- Backup your node keys regularly
- Store mnemonics securely offline
- Use hardware security modules for production
-
Monitoring
- Set up alerts for node downtime
- Monitor for unusual network activity
- Keep software updated