A comprehensive automation script for setting up a Selendra RPC node with HTTPS support across various Linux distributions.
Before running this script, make sure your domain's DNS A record points to your server's IP address!
The SSL certificate setup will fail if your domain doesn't resolve to your server. The script includes verification and waiting options, but setting up DNS in advance will make the installation smoother.
- Create an A record for your domain (e.g.,
rpcx.selendra.org
) - Point it to your server's IP address
- Wait for DNS propagation (can take up to 24-48 hours, but often just minutes)
- Cross-Distribution Support: Works on Arch Linux, Debian, Ubuntu, Fedora, RHEL, CentOS, and more
- Automatic Installation: Handles all dependencies including Nginx and Certbot
- SSL/HTTPS Configuration: Automatic HTTPS setup with Let's Encrypt certificates
- Custom Domain Support: Configure your own domain name for the RPC endpoint
- Systemd Integration: Creates and configures systemd service for automatic startup
- Unified Management: Simple command-line tool for managing all aspects of your node
- A Linux server with root/sudo access
- A domain name with DNS A record already pointing to your server IP
- Open ports 80 and 443 (for HTTP/HTTPS)
- Open port 40333 (default P2P port, configurable)
# Option 1: Download with wget
wget https://github.com/selendra/selendra-rpc/raw/main/selendra-rpc-setup.sh -O selendra-rpc-setup.sh
# Option 2: Download with curl
curl -L https://github.com/selendra/selendra-rpc/raw/main/selendra-rpc-setup.sh -o selendra-rpc-setup.sh
# Make it executable
chmod +x selendra-rpc-setup.sh
# Run with sudo
sudo ./selendra-rpc-setup.sh
- Detects your Linux distribution and installs required dependencies
- Downloads the latest Selendra binary from GitHub
- Sets up Nginx as a reverse proxy with proper configurations
- Obtains SSL certificates via Let's Encrypt (certbot)
- Creates a systemd service for running the Selendra node
- Installs management tools for easy administration
During installation, you'll be prompted for:
- Domain name: Your RPC endpoint domain (e.g., rpcx.selendra.org)
- Node name: How your node will appear on the network
- Database path: Where chain data will be stored
- RPC port: Default is 9933
- P2P port: Default is 40333
- Email address: For SSL certificate notifications
After installation, you can use the selendra-rpc
command to manage all aspects of your node:
# View available commands
selendra-rpc help
# Basic service management
selendra-rpc start # Start the Selendra RPC service
selendra-rpc stop # Stop the Selendra RPC service
selendra-rpc restart # Restart the Selendra RPC service
selendra-rpc status # Check service status
selendra-rpc logs # View real-time logs
# Nginx management
selendra-rpc nginx-reload # Reload Nginx configuration
selendra-rpc nginx-test # Test Nginx configuration
# SSL certificate management
selendra-rpc ssl-test # Test certificate renewal
selendra-rpc ssl-renew # Force certificate renewal
The Selendra node runs with the following default parameters:
--chain selendra # Selendra mainnet
--rpc-external # Accept external RPC connections
--rpc-cors all # Allow all origins for CORS
--pool-limit 1024 # Connection pool limit
--db-cache 1024 # Database cache size (MB)
--runtime-cache-size 2 # Runtime cache size
--max-runtime-instances 8 # Maximum runtime instances
🚨 CRITICAL: Configure your DNS BEFORE running the script!
For the SSL setup to work correctly, your domain must point to your server:
- Log in to your domain registrar or DNS provider
- Create an A record for your domain (e.g.,
rpcx.selendra.org
) - Enter your server's IP address as the value
- Save the changes and wait for propagation
You can verify DNS propagation with:
dig +short your-domain.com
# or
nslookup your-domain.com
The output should show your server's IP address. If it doesn't, wait longer for propagation or check your DNS configuration.
The script includes DNS verification and will guide you through options if DNS isn't properly configured, but setting it up in advance will prevent certificate issuance failures.
If you encounter issues:
- Check the service status:
selendra-rpc status
- View the logs:
selendra-rpc logs
- Verify Nginx configuration:
selendra-rpc nginx-test
- Test SSL certificates:
selendra-rpc ssl-test
The script creates configuration files in the following locations:
- Nginx configuration:
/etc/nginx/sites-available/yourdomain.conf
- Systemd service:
/etc/systemd/system/selendra.service
- Selendra binary:
/usr/local/bin/selendra-node
- SSL certificates:
/etc/letsencrypt/live/yourdomain/
You can manually edit these files for advanced customization.
- The script sets up HTTPS with modern SSL parameters
- Automatic certificate renewal is configured
- Strict Transport Security headers are added
- The RPC endpoint is publicly accessible (be aware of potential abuse)
To update the Selendra binary:
- Stop the service:
selendra-rpc stop
- Download the new binary and replace the existing one
- Start the service:
selendra-rpc start
This script is provided under the MIT License.
- Selendra Network for developing the blockchain
- Let's Encrypt for providing free SSL certificates
- Nginx for the powerful reverse proxy capabilities
- Selendra Foundation
- Community Contributors
For assistance with this script, please create an issue on GitHub.
For Selendra-specific questions, refer to the Selendra documentation.