Chain Setup Guide

SPHX Testnet Setup Guide

Introduction

This guide provides detailed steps to set up and run a node on the SPHX Testnet. By the end of this guide, you will have your node configured, connected to bootnodes, and running as a systemd service for easy management.


Prerequisites

Before setting up the node, ensure you have:

  1. A server or machine with the following minimum requirements:

    • 2 CPU cores

    • 4 GB of RAM

    • 100 GB SSD storage

    • A stable internet connection

  2. Basic command-line knowledge to execute commands and manage configurations.


Step 1: Install SPHX Binaries

Start by downloading and installing the latest version of SPHX binaries. You can find the most recent release here.

For Linux, follow these steps:

# Download SPHX binary
https://github.com/sphx-dev/infra-chain/releases/download/v0.0.5/sphx

# Move the sphxd binary to a location in your PATH
sudo mv sphx /usr/local/bin/sphxd

# Verify the installation
sphxd version

Step 2: Initialize Your Node

Next, initialize the node with your desired moniker (node name):

sphxd init <Your_Node_Name> --chain-id sphx-testnet

This command will create the configuration files needed to run the node. The configuration files will be located in ~/.sphxd.


Step 3: Configure Bootnodes and Seeds

Edit the config.toml file located in ~/.sphxd/config/ to include the provided bootnodes. Use a text editor such as nano:

nano ~/.sphxd/config/config.toml

Find the persistent_peers field and add the following bootnodes:

persistent_peers = "4000c9ae9c849ca02b2a19844265bee8ebf1e0f3@52.91.173.91:26656,9070c993919d31b1f02b872f731f59bb901f0512@54.172.101.52:26656"

Make sure to also adjust the seeds field if needed (this is optional if the bootnodes are working well).


Step 4: Download Genesis File

Download the latest SPHX Testnet genesis file and place it in the configuration folder:

wget -O ~/.sphxd/config/genesis.json https://github.com/sphx-dev/infra-chain/releases/download/v0.0.5/genesis.json

Step 5: Configure Systemd Service

To ensure your node runs continuously and restarts automatically in case of a reboot or failure, you can create a systemd service file.

Create blockchain.service File

Create a new systemd service file by running:

sudo nano /etc/systemd/system/blockchain.service

Add the following content to the file:

[Unit]
Description=SPHX Blockchain Node
After=network.target

[Service]
User=<your_user>
ExecStart=/usr/local/bin/sphxd start
Restart=always
RestartSec=3
LimitNOFILE=4096

[Install]
WantedBy=multi-user.target

Make sure to replace <your_user> with your actual username.

Enable and Start the Service

After creating the service file, reload systemd and enable the service to start automatically:

# Reload systemd to recognize the new service
sudo systemctl daemon-reload

# Enable the service to start on boot
sudo systemctl enable blockchain.service

# Start the blockchain node service
sudo systemctl start blockchain.service

Check the status of the service to ensure itโ€™s running:

sudo systemctl status blockchain.service

Step 6: Verify Node Synchronization

Once your node is running as a service, you can check its synchronization status using:

sphxd status

This will provide you with details about the current block height and whether your node is catching up with the network.


Step 7: Monitoring and Logs

To monitor your nodeโ€™s logs, use the following command:

journalctl -u blockchain.service -f

This will provide a real-time view of the logs generated by your node. If any issues arise, you can troubleshoot by reviewing these logs.


Final Notes

  • System Security: Consider securing your server by using SSH key authentication, configuring a firewall, and monitoring resource usage.

  • Community and Support: Join the SPHX community for updates and assistance in case of issues.

  • Regular Updates: Make sure to periodically update your node software as new versions of SPHX are released to ensure compatibility with the latest network features.


By following these steps, your SPHX Testnet node should be up and running smoothly as a systemd service. If you encounter any issues or need further assistance, donโ€™t hesitate to reach out to the community or consult the official documentation.

Last updated