Skip to content

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=300

Step 3: Start the Node

bash
# Start the daemon
csd -daemon

# Monitor the initial sync
tail -f ~/.cs/debug.log

# Check sync status
cs-cli getblockchaininfo

Step 4: Verify Connection

bash
# Check peer connections
cs-cli getpeerinfo | grep -c "addr"

# Get network info
cs-cli getnetworkinfo

Initial 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=64

Node 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 stop

Monitoring

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 files
bash
# Or start with prune flag
csd -prune=5000 -daemon

Note: 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:16178

Whitelisting

ini
# cs.conf
whitelist=127.0.0.1
whitelist=192.168.1.0/24

Security 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 enable

2. 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.1

3. Keep Software Updated

bash
# Check for updates regularly
git pull origin main
make -j$(nproc)
sudo make install

4. 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.target

Enable and start:

bash
sudo systemctl daemon-reload
sudo systemctl enable csd
sudo systemctl start csd
sudo systemctl status csd

Troubleshooting

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 status

High Memory Usage

ini
# Reduce cache size
dbcache=512

# Limit mempool
maxmempool=100

Slow Sync

  • Ensure you're using an SSD
  • Increase dbcache to 4096 or higher
  • Check network bandwidth
  • Verify no other processes are consuming disk I/O

Next Steps

Released under the MIT License.