Setting Up a Validator Node

Author: AmpereChain Team Published: Dec 08, 2023 Updated: Jan 02, 2023

Cautions to Consider:

  1. In the event a validator fails to produce a block within a 15-minute timeframe, a penalty of 1% (2000 AMPERE) will be enforced and validator will be removed.

  2. A strict policy limits a single validator per IP address, permitting only one port (30303).

  3. Ensure you possess 200,000 AMPERE tokens to set up the validator node on AmpereChain Network.

  4. Rewards acquired will be locked for a period of 6 months and released on the 1st and 15th of each month.

These steps are vital for configuring a validator to engage in blockchain block validation. Please thoroughly review the entire document before proceeding.

Hardware Specifications:

  • CPU: Intel i3/AMD Ryzen 5 or higher (Recommended)

  • RAM: 4 GB DDR5 or above (Recommended)

  • Disk Space: Minimum of 200 GB NVMe storage, scalable to accommodate blockchain growth

  • Operating System: Ubuntu 20.04 or above

  • Network Speed: Recommended 1GBPS+ with a static IP

AmpereChain Validator Portal:

AmpereChain validator portal available at https://apps.amperechain.com/validator

You can use MetaMask wallet to access AmpereChain validator portal.

Validator Portal Elements:

  1. Validator Wallet Address: MetaMask Connected Wallet Address

  2. Server IP Address: Server Static IP Address On Which Validator Hosted

  3. RPC HTTP API Port: 8545 Port to Connect AmpereChain Besu API.

  4. RPC WS API Port: 8546 Port to Connect AmpereChain Besu API.

  5. P2P Port: P2P Port Used By Validator to Connect Other Validators.

  6. Status: Current Validator Status. Refer Validator Status Section to Know in Details.

  7. Validated Blocks: Blocks Validated by Validator

  8. Total Earned Rewards: Total Earned Rewards by Validator

  9. Locked Coins: Locked Coins By Validator for Activation

  10. Enode: Enode URL of Validator

  11. Add Validator (Button): To Add New Validator(Visible if Unlocked Wallet is Not Validator)

  12. Remove Validator (Button): To Remove Validator(Visible if Unlocked Wallet is Validator)

Validator Status:

Configuration Steps:

Follow below steps to configure AmpereChain validator

Execute below command lines in Terminal as root access.

  1. Connect to VPS

    • Using PuTTY:

      1. Download and Install PuTTY: Get PuTTY from PuTTY Download and install it.

      2. Open PuTTY: Launch PuTTY.

      3. Enter VPS IP: Input the VPS IP address in the "Host Name" field.

      4. Configure Connection: Choose the connection type as SSH and ensure the port is set to 22 (default).

      5. Optional - Save Session: Save this configuration for future use by naming it under "Saved Sessions."

      6. Connect: Click "Open" to establish the connection.

      7. Login: When prompted, enter your username (usually "root") and your password.

    • Using SSH:

      1. Open Terminal/Command Prompt: Launch the terminal on Linux/Mac or Command Prompt on Windows.

      2. SSH Command: Enter the command ssh root@your_vps_ip, replacing your_vps_ip with your VPS IP.

      3. Login: Input the root user password when prompted.

    • Access Terminal:

      1. Access Terminal using PuTTY: If you're using PuTTY, once the connection is established, execute the commands within the PuTTY window.

      2. Using SSH: If you're connecting via SSH, you're already within the terminal. Proceed directly with the commands.

  2. Create a New User:

    • Create a new user with the desired username (replace your_username with your chosen username):

      adduser your_username

    • Enter passowd and remaining just Keep pressing Enter and when you asker for Is the information correct? [Y/n] , Press Y and Enter.

    • Grant Sudo Privileges:

      Add the new user to the sudo group to grant administrative privileges:

      usermod -aG sudo your_username

    • Test if you can log in with the new user in new tab:

      ssh your_username@your_server_ip

      Note down the username and password for future interaction with vps.

    • If you are able to login with new user then

      • Steps to secure remote root access:

        • Edit the SSH configuration file:

          sudo nano /etc/ssh/sshd_config
        • Press "ctrl w" the the screen pops up and search for PermitRootLogin directly and then hit ENTER

        • Find the line PermitRootLogin yes and change it to PermitRootLogin no.

        • To Find PermitRootLogin 'Cntl+w' and then

          sudo nano /etc/ssh/sshd_config
        • Find the line PermitRootLogin yes and change it to PermitRootLogin no.

        • Click Ctrl + x keys and y key and then Enter key to save file.

        • Allow port 22 and enter y if asked for Proceed with operation (y|n)?

          sudo ufw --force disable  && sudo ufw --force reset && sudo ufw enable && sudo ufw allow 22
        • Restart the SSH service:

          sudo service ssh restart

  3. Update System and Install Java Development Kit (JDK)

    sudo apt update
    sudo apt install -y default-jdk default-jre
    sudo apt install -y openjdk-17-jre-headless

  4. Install Additional Tools

    sudo apt install -y curl
    sudo apt install -y unzip tmux

  5. Open 8545, 8546 and 30303 port from terminal using below command.

    sudo ufw --force disable  && sudo ufw --force reset  && sudo ufw enable && sudo ufw allow from 173.225.107.84 to any port 8545 && sudo ufw allow from 173.225.107.84 to any port 8546 && sudo ufw allow 30303 && sudo ufw allow 22

    Press y and the ENTER when you asked for 'Proceed with operation (y|n)?'

  6. Download AmpereChain-BesuClient and Prepare AmpereChain Directory and Set Access

    cd /
    sudo wget -O Blockchain.zip "https://codeload.github.com/amperechain/Blockchain/zip/refs/heads/main"
    sudo unzip Blockchain.zip
    sudo mkdir AmpereChain
    sudo mv /Blockchain-main/AmpereChain-BesuClient/* AmpereChain
    sudo chmod 777 /AmpereChain
    

  7. Create essential directories

    cd /AmpereChain
    sudo mkdir DQBFT-Network
    cd DQBFT-Network
    sudo mkdir Node
    cd Node
    sudo mkdir data
    sudo mkdir key

    And Press ENTER

  8. Create node private key file for wallet used for validator

    cd /
    sudo nano /AmpereChain/DQBFT-Network/Node/key/key

    Enter private key of wallet you are going to use as validator in nano editor (Add 0x at start if not exist). Also make sure there is no new line or extra spaces. For example: DDfeba0822db7A823F8535874d56862a8526148e then 0xDDfeba0822db7A823F8535874d56862a8526148e Click Ctrl + x keys and y key and then Enter key to save file.

  9. Run the AmpereChain BesuClient and Wait for server to sync up-to the latest block

    If you're using a graphical interface like Putty, copy and paste the following command line directly. If not, using tools like 'tmux' will help you maintain active sessions.

    Here's how to work with tmux:

    • Creating a Session: Use this command to start a session: tmux new -s amperechain. This sets up a session named "amperechain."

    • Reconnecting to a Session: If you need to reconnect after closing the tab or disconnecting, type tmux attach -t amperechain. This command reconnects you to the previous "amperechain" session.

    • Viewing All Sessions: You can see all active sessions by typing tmux ls.

    Note: If you're working in a tmux session, it's okay to close the tab or window. You can always reconnect using the tmux attach -t amperechain command to resume where you left off.

    sudo chmod +x /AmpereChain/bin/besu

    sudo /AmpereChain/bin/besu --data-path=/AmpereChain/DQBFT-Network/Node/data --genesis-file=/AmpereChain/genesis.json --host-allowlist=* --min-gas-price=0 --rpc-http-api=ETH,NET,WEB3,QBFT,TRACE,TXPOOL,ADMIN --rpc-http-cors-origins=* --rpc-http-enabled=true --rpc-http-host=0.0.0.0 --rpc-http-max-active-connections=10000 --rpc-http-max-batch-size=-1 --rpc-http-port=8545 --rpc-tx-feecap=1000000000000000 --rpc-ws-api=ETH,NET,WEB3,QBFT,TRACE,TXPOOL,ADMIN --rpc-ws-enabled=true --rpc-ws-host=0.0.0.0 --rpc-ws-max-active-connections=10000 --rpc-ws-port=8546 --p2p-port=30303 --sync-mode=FULL --bootnodes="enode://c74f62b1764425d5824b40a04fb11e14efcbbe080d6a09e8473bb917cc4af05fe4f11e8570b4df78cb26ad52a2542ad4fe771fc326ac80656bc93e9a95547daa@216.219.86.11:30303" --node-private-key-file=/AmpereChain/DQBFT-Network/Node/key/key --miner-enabled=true --miner-coinbase=<ValidatorWalletAddress>
    

    Don't forget to replace <ValidatorWalletAddress> from above command line For example in our case command line is: sudo /AmpereChain/bin/besu --data-path=/AmpereChain/DQBFT-Network/Node/data --genesis-file=/AmpereChain/genesis.json --host-allowlist=* --min-gas-price=0 --rpc-http-api=ETH,NET,WEB3,QBFT,TRACE,TXPOOL,ADMIN --rpc-http-cors-origins=* --rpc-http-enabled=true --rpc-http-host=0.0.0.0 --rpc-http-max-active-connections=10000 --rpc-http-max-batch-size=-1 --rpc-http-port=8545 --rpc-tx-feecap=1000000000000000 --rpc-ws-api=ETH,NET,WEB3,QBFT,TRACE,TXPOOL,ADMIN --rpc-ws-enabled=true --rpc-ws-host=0.0.0.0 --rpc-ws-max-active-connections=10000 --rpc-ws-port=8546 --p2p-port=30303 --sync-mode=FULL --bootnodes="enode://c74f62b1764425d5824b40a04fb11e14efcbbe080d6a09e8473bb917cc4af05fe4f11e8570b4df78cb26ad52a2542ad4fe771fc326ac80656bc93e9a95547daa@216.219.86.11:30303" --node-private-key-file=/AmpereChain/DQBFT-Network/Node/key/key --miner-enabled=true --miner-coinbase=0xDDfeba0822db7A823F8535874d28862a8526 Note: Please wait for the server to synchronize with other nodes and generate new blocks. This synchronization process may require several hours to complete. Rushing through this stage before complete synchronization poses a high probability of incurring penalties.

  10. Apply for Validator on portal Caution: Before applying, make sure to open the correct wallet associated with AmpereChain and ensure you're on the AmpereChain network. Applying with the wrong wallet or network may require validator removal and could disrupt access for other users on the portal. If all settings are proper and validator synchronization is completed and started importing latest new blocks then Apply for validator from https://apps.amperechain.com/validator Visit above mentioned validator portal and connect with MetaMask(make sure you use same wallet as validator) Enter Server IP Address and click on Add Validator then sign transaction from MetaMask. It will lock 200000 AMPERE and wait for few mins to get status reflected to "Active-Offline" Portal will show validator status as Activated when node starts generating new blocks.

Important Things:

  1. Leave terminal running and lock VPS

  2. Don't share your private key with anyone

Thank you for becoming a validator. Your commitment secures the network. Stay vigilant, stay secure.

Last updated