Skip to main content

Setting Up and Running the Snapshotter Lite Node V2

This guide provides instructions for installing and running the Snapshotter Lite Node V2, covering prerequisites and operational procedures.

The Snapshotter Lite Node V2 can be set up using either the Docker image or by running natively on the local machine. However, using the Docker image is the recommended approach, as it provides the simplest and most reliable method for deployment.

Node Mint

Node Mint is now live at: https://mint.powerloom.network/. For detailed information on our rewards structure, frequently asked questions, and other aspects related to node minting, please visit: https://powerloom.network/mint-docs/.

Follow the step-by-step instructions in the relevant guide to set up your Snapshotter Lite Node V2. If you need further assistance, refer to our troubleshooting documentation or reach out to us on discord for support.

Important note
  1. It is recommended that the node operates continuously, 24/7.
  2. If you possess multiple slots, refer to the section on setting up multiple nodes for further details.

We have streamlined the setup process based on your operating system. To begin, please choose your operating system from the tabs provided below.

  • For those looking to set up the node on a local Windows or Mac machine, please select the "Windows / MacOS" tab.
  • If you are configuring your node on a Linux VPS, select the "Linux" tab and follow the provided instructions to get started.

Setting up the Snapshotter Lite Node V2

Deploying a Snapshotter Lite Node V2 on a Virtual Private Server (VPS)

Deploying a Snapshotter Lite Node V2 on a Virtual Private Server (VPS) ensures seamless 24/7 operation without utilizing your local resources.

This section provides instructions for setting up your Snapshotter Lite Node V2 on an Ubuntu VPS.

While you're free to choose any provider, this guide specifically utilizes DigitalOcean for demonstration purposes.

Recommended VPS Providers:

  • DigitalOcean
  • Hostinger

Hardware Requirements

The Snapshotter Lite Node V2 is designed for minimal hardware demands, allowing it to operate effectively on various setups, including both local systems and cloud-based Virtual Machines.

For users running the node on Virtual Private Servers (VPS), the minimum specifications are:

  • RAM: At least 4 GB.
  • CPU Core: Minimum of 2 Cores
  • Disk Space: A minimum of 40 GB.

Step 1: Creating Your VPS

  1. Sign Up/Login: Start creating an account on your VPS provider or log in if you already have one.

  2. Choose an Image: Select Ubuntu as your operating system. We recommend using the latest stable version of Ubuntu for optimal performance.

  3. Select a Plan: Choose a plan that meets the minimum hardware requirements for the Snapshotter Lite Node V2. A plan with at least 4 GB RAM and 40 GB of disk space is advisable.

  4. Authentication: Set up SSH keys for secure access to your VPS.

  5. Finalize and Create: Choose any additional options, like backups if required. Your VPS will be set up within a few minutes.

Step 2: Accessing Your VPS

  • SSH into Your VPS: Use the following command from your terminal/command prompt, replacing your_vps_ip with the IP address of your VPS.
ssh root@your_vps_ip
  • If you set up SSH keys, you should be logged in without needing a password. Otherwise, you can also set your password for the VPS.

Step 3: Setting Up the Environment

  1. Update and Upgrade Your VPS:
sudo apt-get update && sudo apt-get upgrade -y
  1. Install Git:
    Git is necessary for cloning the Snapshotter Lite repository. Install it using:
sudo apt-get install git -y
  1. Install Docker and Docker Compose:
    Ensure Docker and Docker Compose are installed. You can install docker on Ubuntu using the following commands:
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

Once the Docker repository is added successfully, let’s install Docker and necessary components by using the below command:

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Step 4: Cloning the Repository and Setting Up the Node

  1. Clone the Snapshotter Lite Repository:
    Navigate to the directory where you want to install the node and clone the repository:
git clone https://github.com/PowerLoom/snapshotter-lite-v2.git powerloom-pre-mainnet
  1. Navigate to the Directory:
    Change to the directory of the cloned repository:
cd powerloom-pre-mainnet

Step 5: Running the Node

  1. Setting up Screen:
    The Screen utility allows you to run processes in the background, enabling you to maintain long-running tasks without keeping a terminal window open. To initiate a new Screen session for managing the Snapshotter Lite Node V2, follow these steps:

Enter the following command to create a new Screen session named "powerloom-pre-mainnet":

screen -S powerloom-pre-mainnet
  • This command opens a new Screen session, where you can start the Snapshotter Lite Node V2.
  • Once inside the new Screen session, initiate the Snapshotter Lite Node V2 as required.

This approach ensures your node can continue running in the background, even if you disconnect from the terminal session.

  1. Initialize the Node:
    Initiate the snapshotter lite node v2 setup by typing the command in the terminal:
./build.sh

Follow the prompts to enter the required information.

tip

Please do not use your NFT minting wallet to run the snapshotter lite node v2. The safest approach is to generate and assign a burner wallet. You can generate a burner wallet through any of the tools listed below:

Once generated, make sure you assign your burner wallet on your snapshotter dashboard.

Environment Setup:
After initiating the process, the terminal will prompt you to enter the following information:

  • During the setup, you'll be prompted to enter the following values:

    • $SOURCE_RPC_URL: Use any Ethereum Mainnet RPC, such as Ankr, Infura, or Alchemy.

    • $SIGNER_ACCOUNT_ADDRESS: Utilize a burner wallet for the signer account address. Please DO NOT use your main/primary wallet.

    • $SIGNER_ACCOUNT_PRIVATE_KEY: Use the private key from your burner wallet.

    • $SLOT_ID: To assign your node to a specific slot, please provide the corresponding Slot ID or NFT ID. You can locate your NFT ID within your transaction details on PolygonScan.

  • Optionally, you can provide to following values:

    • $TELEGRAM_CHAT_ID: Can be provided if you would like to enable Telegram reporting for node issues. See our Telegram Bot Setup page for instructions on how to get your Telegram Chat ID.

After entering these details, the node will start running the background processes.

If you want to exit your screen, type the command in the terminal:

CTRL+A+D

Step 6: Maintaining Your Node

  • Regular Updates: Keep your system and Snapshotter Lite Node V2 updated by regularly pulling the latest changes from the repository and applying system updates.

  • Monitoring: Regularly check the status of your node and the VPS to ensure everything is running smoothly.

Everytime you start or restart the node, it goes through two stages

Simulation mode submissions

This does not count towards your snapshot quota. This ensures that your node can establish connections to the sequencer over libp2p relay circuits.

info

Read more about monitoring and verifying the simulation mode submissions on the Monitoring and Troubleshooting page.

Regular snapshot submissions

Once you can verify the simulation mode submissions, you will have log messagse similar to the one shown below that will ensure that your node is capturing epoch releases and submitting snapshots to the sequencer.

note

It usually takes 2 - 5 minutes between the simulation mode submissions and a subsequence epoch release to be caught to trigger the regular snapshot submissions.

Sample node logs

info

For further details on using the snapshotter dashboard to monitor the running status of your node, check the Monitoring Node Activity with the Snapshotter Dashboard section.


Setting Up Multiple Nodes on a VPS

If you're looking to run multiple nodes, you can use our Multi-node setup python script. This section will guide you through setting up and managing multiple nodes.

Clone the Multi-node setup script

First, clone our multi-node script to get started:

git clone https://github.com/PowerLoom/snapshotter-lite-multi-setup
cd snapshotter-lite-multi-setup

Setting Up the Environment

It is imperative to create an isolated virtual environment that includes the necessary Python version and modules. This approach ensures that the global Python installations on the VPS or your local machine are not altered.

Installing Pyenv

Follow the steps below to install pyenv according to your OS. Open the terminal and execute the below commands.

sudo apt install build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

After installing the packages, run the following command to execute the script for pyenv installation:

curl https://pyenv.run | bash

Next, add pyenv to the bashrc file:

nano ~/.bashrc

Inside the nano editor, add the following lines at the end of the file:

export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

To save changes in the .bashrc file, press ctrl + o.

Refresh the terminal by typing:

source ~/.bashrc

Next, proceed to install Python 3.11.5:

pyenv install 3.11.5

Installing pyenv-virtualenv

Execute the commands below to install pyenv-virtualenv:

echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
pyenv virtualenv 3.11.5 ss_lite_multi_311
pyenv local ss_lite_multi_311

Executing the Setup

To establish a multi-node setup, follow these steps:

# Prepare the .env file
./init.sh
# Install all Python requirements
pip install -r requirements.txt
# Execute the setup
python multi_clone.py

When you execute python multi_clone.py, you will see the following prompts that guide you through setting up your node(s).

  1. Terminate Existing containers: "Do you want to kill all running containers and screen sessions of testnet nodes? (y/n) n"
  • Type y. Use this option and stop all active containers or node instances. This will clean up all the older containers. Remember to cross-check your running containers before executing this command.
  1. Custom Slot ID Deployment: "Do you want to deploy a custom index of slot IDs (indices begin at 0, enter in the format [begin, end])? (indices/n)"
  • For instance, to deploy the first four slot IDs as nodes, input [0, 3], where 0 is the start index, and 3 represents the fourth element in the slot ID array associated with the wallet holder. If you want to deploy the entire array of slot IDs, type n.
  1. Deployment Batch Size: " Enter the batch size into which you wish to split the deployment"
  • A batch size of 1 means nodes will be deployed one by one, in batch size of 1. A batch size of 2 takes two nodes at a time and proceeds with deployment, and so on.

Following the setup prompts, the script will configure your node slots to run in separate screen sessions. To view the logs for a specific node slot, you can use the following commands:

To list all active screen sessions:

screen -ls

This command displays all currently running screen sessions.

screen-command

To attach to a specific node slot's screen session and check its status, use:

screen -r <screenId>

Note: Replace <screenId> with the actual ID of the screen session you wish to access.

To detach from the screen session and leave it running in the background, press Ctrl + A followed by D.

For more instructions and further assistance, please visit our multi-node setup repository.


Troubleshooting

If you encounter any issues, please refer to our Troubleshooting section for more information.