Lumenx Testnet Validator

Lumenx Testnet Validator

By Staking Hub | LumenX Network | 15 Mar 2023


How to set a new Lumenx-Testnet validator

Enter the virtual console by typing this command.

$ ssh [email protected]

Then, the console will ask for permission to create a key pair for the new remote connection. Accept the key creation, and you will switch into your server shell.

Upgrade the installed packages

$ apt update && apt upgrade

Install critical packages

$ apt install software-properties-common nano git curl make ufw jq build-essential unzip snap -y

Optional: create a separate user for your node

$ adduser testnet #testnet is the name for the newuser, you may choose any other

$ adduser testnet sudo #add testnet to the superuser group

$ su — testnet

Install the compiler

$ sudo snap install go — channel=stable — classic

$ go version #check the version installed

$ export PATH=$PATH:$HOME/go/bin

$ echo export PATH=$PATH:$HOME/go/bin >> ~/.bashrc #add go binaries directory to path

Compile and install node binaries

$ git clone https://github.com/cryptonetD/lumenx.git && cd lumenx

$ git checkout v1.4.0

$ make install

$ lumenxd version #check the installation is correct

Initialize the node

$ lumenxd init YourNodeName #Choose the public name to be displayed

$ wget -O ${HOME}/.lumenx/config/genesis.json https://raw.githubusercontent.com/cryptonetD/chains/main/Lumenx/TestNet/genesis.json #Download genesis file

Add seeds to your config file

$ sed -E -i ‘s/persistent_peers = \”.*\”/persistent_peers = \”[email protected]:26706,[email protected]:26656\”/’ $HOME/.lumenx/config/config.toml

Or you can edit the config file

$ nano ~/.lumenx/config/config.toml

scroll down to persistent_peers and add the content of this file

https://github.com/cryptonetD/chains/blob/main/Lumenx/TestNet/persistent_peers.txt

Set StateSync module

SNAP_RPC=”https://testrpc-lumenx.cryptonet.pl:443"

SNAP_RPC2=”https://rpc.lumenx-test.chaintools.tech:443"

LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \

BLOCK_HEIGHT=$((LATEST_HEIGHT — 1000)); \

TRUST_HASH=$(curl -s “$SNAP_RPC/block?height=$BLOCK_HEIGHT” | jq -r .result.block_id.hash)

echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH

sed -i.bak -E “s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \

s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\”$SNAP_RPC,$SNAP_RPC2\”| ; \

s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \

s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\”$TRUST_HASH\”| ; \

s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\”\”|” $HOME/.lumenx/config/config.toml

Or edit config.toml using nano command, scroll down to StateSync, enable the module and fill with the content shown here:

https://testnet.explorer.chaintools.tech/lumenx/statesync

Create daemon service

$ sudo tee /lib/systemd/system/testnet.service > /dev/null << EOF

[Unit]

Description=Lumenx Testnet Node Service

After=network-online.target

[Service]

User=$USER

ExecStart=$HOME/go/bin/lumenxd start

Restart=on-failure

Restart=always

RestartSec=10

LimitNOFILE=4096

Environment=”DAEMON_HOME=$HOME/.lumenx”

Environment=”DAEMON_NAME=lumenxd”

[Install]

WantedBy=multi-user.target

EOF

$ sudo systemctl enable testnet #enable the service to run at startup

$ sudo systemctl start testnet #start the service manually

Check the node daemon is synchronized and validating transactions

$ sudo journalctl -fu testnet -o cat #check the service feed #CTRL+C to exit

Create keyring pairs

$ lumenxd keys add key_file_name -i #you can choose any name for your key file

At this point you will need to insert your Cosmos account BIP39 mnemonic (to access your wallet). Click enter. For the second question,just hit enter. Finally, establish a password (any password you choose) to save your key pair. If no error is displayed, you are ready for the last step!

CREATE VALIDATOR

$ MONIKER=YourNodeName #repeat the public name chosen for your node

lumenxd tx staking create-validator \

 — amount= 1000000ulumen \ #The amount of tokens to autostake *1000000

 — pubkey=$(lumenxd tendermint show-validator) \

 — moniker=”$MONIKER” \

 — commission-rate=”0.10" \

 — commission-max-rate=”0.20" \

 — commission-max-change-rate=”0.05" \

 — min-self-delegation=”1" \

 — from=key_file_name \ #repeat the name of your key file

 — chain-id=lumenx-test \

 — fees=5000ulumen

In the example above, we are autostaking 1 lumen (note that any amount is given in microunits, so it’s necessary to multiply it by a million, adding six zeros). The commission rate is the part of all delegators’ rewards you will receive. In this case, it is 10% (0.10). The maximum commission rate is a warrant to delegators you won’t be able to rise it above this value. In this case, it is 20% (0.20). This data can’t be changed, so specify a comfortable value margin.

Rate change is the maximum amount you will be able to change at once, using the edit options. Minimum self delegation is the minimum amount you ought to autostake. If you ever fall below this minimum, your validator will be jailed.

Once created, check your validator status by typing

$ lumenxd status | jq ‘.validator_info’

Also check your validator is visible here:

https://testnet.explorer.chaintools.tech/lumenx-test/staking

Don’t forget to backup also this file

$HOME/.lumenx/config/priv_validator_key.json

It’s the blockchain identity of your validator. If you ever lose it, you won’t be able to restore it again.

Good luck and enjoy your staking.

How do you rate this article?

2



LumenX Network
LumenX Network

ANNs, documents and useful guides related to LumenX network ecosystem www.lumenx.app

Publish0x

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.