Running a Node
Running a Cloud Service node is essential for supporting the network and enabling full participation in the Cloud Service ecosystem. This guide will walk you through setting up and maintaining your own node.
Why Run a Node?
- Support the Network — Help validate transactions and maintain decentralization
- Full Control — Verify your own transactions without trusting third parties
- Privacy — Broadcast your own transactions directly to the network
Node Setup
Step 1: Install Cloud Service
Follow the Installation Guide to install Cloud Service on your system.
Step 2: Configure Your Node
Create or edit your cs.conf file:
ini
# ~/.cs/cs.conf
# Network Settings
server=1
listen=1
port=16178
maxconnections=128
# RPC Settings
rpcuser=your_rpc_username
rpcpassword=your_secure_password
rpcport=16180
rpcallowip=127.0.0.1
# Node Settings
txindex=1
addressindex=1
timestampindex=1
spentindex=1
# Performance
dbcache=2048
maxorphantx=100
maxmempool=300Step 3: Start the Node
bash
# Start the daemon
csd -daemon
# Monitor the initial sync
tail -f ~/.cs/debug.log
# Check sync status
cs-cli getblockchaininfoStep 4: Verify Connection
bash
# Check peer connections
cs-cli getpeerinfo | grep -c "addr"
# Get network info
cs-cli getnetworkinfoInitial Block Download
When starting a new node, it must download and validate the entire blockchain:
Tips for Faster Sync
ini
# Increase database cache (in cs.conf)
dbcache=4096
# Limit connections to prevent bandwidth issues
maxconnections=64Node Management
Useful Commands
bash
# Get blockchain info
cs-cli getblockchaininfo
# Get network info
cs-cli getnetworkinfo
# Get wallet info
cs-cli getwalletinfo
# List connected peers
cs-cli getpeerinfo
# Get mining info
cs-cli getmininginfo
# Stop the node gracefully
cs-cli stopMonitoring
bash
# Check node status
cs-cli getnodeaddresses
# View recent logs
tail -100 ~/.cs/debug.log
# Monitor resource usage
htop -p $(pgrep csd)Advanced Configuration
Pruning
If you have limited disk space, enable pruning:
ini
# cs.conf
prune=5000 # Keep 5GB of block filesbash
# Or start with prune flag
csd -prune=5000 -daemonNote: Pruned nodes cannot serve historical blocks to other nodes and some RPC features may be limited.
Adding Nodes
Manually add peer nodes if needed:
ini
# cs.conf
addnode=node1.cs.network
addnode=node2.cs.network
addnode=192.168.1.100:16178Whitelisting
ini
# cs.conf
whitelist=127.0.0.1
whitelist=192.168.1.0/24Security Best Practices
1. Use a Firewall
bash
# Allow only necessary ports
sudo ufw allow 16178/tcp # P2P
sudo ufw allow 16180/tcp # RPC (restrict to localhost)
sudo ufw enable2. Secure RPC Access
ini
# Use strong credentials
rpcuser=long_random_username
rpcpassword=long_random_password
# Restrict access
rpcallowip=127.0.0.1
rpcbind=127.0.0.13. Keep Software Updated
bash
# Check for updates regularly
git pull origin main
make -j$(nproc)
sudo make install4. Use systemd for Auto-Restart
Create /etc/systemd/system/csd.service:
ini
[Unit]
Description=Cloud Service Daemon
After=network.target
[Service]
Type=forking
User=cscoin
Group=cscoin
ExecStart=/usr/local/bin/csd -daemon -conf=/home/cscoin/.cs/cs.conf
Restart=always
RestartSec=10
LimitNOFILE=65536
[Install]
WantedBy=multi-user.targetEnable and start:
bash
sudo systemctl daemon-reload
sudo systemctl enable csd
sudo systemctl start csd
sudo systemctl status csdTroubleshooting
Node Won't Connect
bash
# Check DNS resolution
nslookup node.cs.network
# Manually add a peer
cs-cli addnode <IP>:16178 onetry
# Check firewall
sudo ufw statusHigh Memory Usage
ini
# Reduce cache size
dbcache=512
# Limit mempool
maxmempool=100Slow Sync
- Ensure you're using an SSD
- Increase
dbcacheto 4096 or higher - Check network bandwidth
- Verify no other processes are consuming disk I/O
Next Steps
- Learn about different Node Types
- Configure your Node Settings
- Set up Monitoring & Maintenance