Sitemap

Structs | Validator Node Setup Guide

6 min read5 days ago

--

Press enter or click to view image in full size

Structs is a strategic game of interstellar enterprise and empire.

Structs is a decentralized game in the Cosmos ecosystem, operated and governed by its community of players — ensuring Structs remains online as long as there are players to play it.

In the distant future the species of the galaxy are embroiled in a race for Alpha Matter, the rare and dangerous substance that fuels galactic civilization. Players take command of Structs, a race of sentient machines, and must forge alliances, conquer enemies and expand their influence to control Alpha Matter and the fate of the galaxy.

Site | Game Beta | Discord | X | GitHub | YouTube

Before interacting with any project, please DYOR about the project.

Prerequisite

1) Update the local package repository database & upgrade installed packages to their latest versions based on the updated package database:

apt update && apt upgrade -y

2) Install packages:

apt install curl gcc tmux htop nvme-cli pkg-config libssl-dev libleveldb-dev tar clang bsdmainutils ncdu unzip libleveldb-dev build-essential git wget jq make -y

3) Install Go:

ver="1.26.1" && \
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" && \
sudo rm -rf /usr/local/go && \
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz" && \
rm "go$ver.linux-amd64.tar.gz" && \
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile && \
source $HOME/.bash_profile && \
go version

4) Install Ignite:

curl https://get.ignite.com/cli! | bash && \
ignite version

Installation

1) Install the binary:

git clone --branch master https://github.com/playstructs/structsd.git && \
cd structsd && \
make install

2) Check version:

structsd version --long | grep -e version -e commit

Output should be:

commit: f6dc0047fa896aaa4fdc4be21eb22c12f7ae3e1e
version:
master-f6dc0047fa896aaa4fdc4be21eb22c12f7ae3e1e

3) Configure the binary:

structsd config set client chain-id structstestnet-111
structsd config set client node tcp://localhost:26657
structsd config set client keyring-backend os

4) Initialize node:

structsd init <YOUR_NODE_ID> --chain-id structstestnet-111

5) Download genesis file:

wget -O $HOME/.structs/config/genesis.json "https://raw.githubusercontent.com/playstructs/structs-networks/refs/heads/main/genesis.json"

6) Check genesis:

sha256sum ~/.structs/config/genesis.json

Output should be:

447685d89fd7835b233086cc5affadcb51ef60a4fbe93ad61e77d6a828a709c9 /root/.structs/config/genesis.json

7) Check validator state:

cd && cat .structs/data/priv_validator_state.json

Should be at the beginning:

{
"height": "0",
"round": 0,
"step": 0
}

If not, run:

structsd tendermint unsafe-reset-all --home $HOME/.structs --keep-addr-book

8) Setup minimum gas prices in app.toml file:

sed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0ualpha\"/;" $HOME/.structs/config/app.toml

9) Setup external address:

external_address=$(wget -qO- eth0.me)
sed -i.bak -e "s/^external_address *=.*/external_address = \"$external_address:26656\"/" $HOME/.structs/config/config.toml

10) Add peers:

SEEDS=""
PEERS="b6b65ce63735dde7f178428a83e02c9efa1f2f6c@152.53.0.11:26656,8d4549173680e9a03c135428a323407a69ddad07@155.138.136.251:26656,06367e7e2090c2209d3344cb853619a78c235143@155.138.137.244:26656,09e8f5be4c58c0a8ddf5596742a2322431523f2f@216.128.181.240:26656,f9ff152e331904924c26a4f8b1f46e859d574342@155.138.142.145:26656,c0f0cba61afecf89b63c2f9c15f0a6fa0518af8d@149.248.63.201:26656,f9ff152e331904924c26a4f8b1f46e859d574342@155.138.142.145:26656"
sed -i -e "/^\[p2p\]/,/^\[/{s/^[[:space:]]*seeds *=.*/seeds = \"$SEEDS\"/}" -e "/^\[p2p\]/,/^\[/{s/^[[:space:]]*persistent_peers *=.*/persistent_peers = \"$PEERS\"/}" $HOME/.structs/config/config.toml

11) Add maximum inbound/outbound peers:

sed -i 's/max_num_inbound_peers =.*/max_num_inbound_peers = 40/g' $HOME/.structs/config/config.toml
sed -i 's/max_num_outbound_peers =.*/max_num_outbound_peers = 10/g' $HOME/.structs/config/config.toml

12) Add “bad” peers filtration:

sed -i -e "s/^filter_peers *=.*/filter_peers = \"true\"/" $HOME/.structs/config/config.toml

13) Download Addr book:

wget -O $HOME/.structs/config/addrbook.json "https://crptcpchk.com/nodes/structs/addrbook.json"

14) Add pruning:

pruning="custom"
pruning_keep_recent="1000"
pruning_interval="10"
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.structs/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.structs/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.structs/config/app.toml

15) Create service file:

tee /etc/systemd/system/structsd.service > /dev/null <<EOF
[Unit]
Description=Structs Validator Node
After=network-online.target

[Service]
User=$USER
ExecStart=$(which structsd) start
Restart=on-failure
RestartSec=3
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF

State sync (Optional)

SNAP_RPC=https://structs-test-rpc.crptcpchk.com:443

LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 100)); \
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_RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ; \
s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"\"|" $HOME/.structs/config/config.toml

16) Reload daemon, enable and start structsd.service:

systemctl daemon-reload && \
systemctl enable structsd && \
systemctl start structsd && \
systemctl status structsd

If everything went ok, should look like this:

Press enter or click to view image in full size

17) Check logs:

journalctl -u structsd -f -o cat

18) Wait for synchronization.

Run:

structsd status | jq '.sync_info'

Look for “catching_up”: false.

Get crptcpchk’s stories in your inbox

Join Medium for free to get updates from this writer.

19) Create wallet:
Change <WALLET_NAME> with Your wallet name.

structsd keys add <WALLET_NAME>

Enter password (passphrase).
Save mnemonic and wallet address.

Register validator

1) Retrieve your pubkey:

structsd comet show-validator

2) Create validator.json file:

nano $HOME/.structs/validator.json

Add your config info:

{
"pubkey": {<YOUR_PUBKEY_FROM_STEP_1>},
"amount": "1000000ualpha",
"moniker": "<YOUR_MONIKER>",
"identity": "...",
"website": "...",
"security": "...",
"details": "...",
"commission-rate": "0.05",
"commission-max-rate": "0.20",
"commission-max-change-rate": "0.01",
"min-self-delegation": "1"
}

Save and exit:

Ctrl+X
Y
Enter

3) Create validator:
Change <WALLET_NAME> with the name of you wallet.

structsd tx staking create-validator $HOME/.structs/validator.json --from <WALLET_NAME> --gas auto -y

Useful commands

Check logs:

journalctl -u structsd -f -o cat

Check balance:

structsd q bank balances <WALLET_ADDRESS>

Retrieve your pubkey:

structsd comet show-validator

Query delegations made by an address:

structsd query staking delegations <DELEGATOR_ADDRESS>

Validator details:

structsd query staking validator <YOUR_VALOPER_ADDRESS>

Unjail validator:

structsd tx slashing unjail --from <WALLET_NAME> --gas auto -y

Jail reason (how many blocks missed):

structsd q slashing signing-info $(structsd tendermint show-validator)

Edit validator details:

structsd tx staking edit-validator --moniker <YOUR_MONIKER> --from <WALLET_NAME> --gas auto -y

List active validators:

structsd q staking validators -o json \
| jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' \
| jq -r '.tokens + " - " + .description.moniker' \
| sort -gr | nl

List inactive validators:

structsd q staking validators -o json \
| jq '.validators[] | select(.status=="BOND_STATUS_UNBONDED")' \
| jq -r '.tokens + " - " + .description.moniker' \
| sort -gr | nl

General:

Check port status:

curl localhost:26657/status | jq

Staking parameters:

structsd q staking params

Slashing parameters:

structsd q slashing params

Transactions:

Get transaction details by hash:

structsd query tx <TX_HASH>

Delegate to your validator:

structsd tx staking delegate <YOUR_VALOPER_ADDRESS> 1000000ualpha --from <WALLET_NAME> --gas auto -y

Withdraw reward from all delegations by a wallet:

structsd tx distribution withdraw-all-rewards --from <WALLET_NAME> --gas auto -y

Withdraw rewards and commission:

structsd tx distribution withdraw-rewards <YOUR_VALOPER_ADDRESS> --from <WALLET_NAME> --commission --gas auto -y

Redelegate:

structsd tx staking redelegate <CURRENT_VALIDATOR> <DESTINATION_VALIDATOR> 1000000ualpha --from <WALLET_NAME> --gas auto -y

Unbond:

structsd tx staking unbond <YOUR_VALOPER_ADDRESS> 1000000ualpha --from <WALLET_NAME> --gas auto -y

Send tokens:

structsd tx bank send <WALLET_NAME> <ADDRESS> 1000000ualpha --gas auto -y

Wallets:

List all keys:

structsd keys list

Create wallet:

structsd keys add <WALLET_NAME>

Recover wallet:

structsd keys add <WALLET_NAME> --recover

Delete wallet:

structsd keys delete <WALLET_NAME>

Show account key:

structsd keys show <WALLET_NAME> --bech acc

Show validator key:

structsd keys show <WALLET_NAME> --bech val

Show consensus key:

structsd show <WALLET_NAME> --bech cons

Show account data:

structsd q auth account $(structsd keys show <WALLET_NAME> -a) -o text

Governance

List of proposals:

structsd q gov proposals

Vote “Yes”:

structsd tx gov vote 1 yes --from <WALLET_NAME> --gas auto -y

Vote “Abstain”:

structsd tx gov vote 1 abstain --from <WALLET_NAME> --gas auto -y

Vote “No”:

structsd tx gov vote 1 no --from <WALLET_NAME> --gas auto -y

Vote “NoWithVeto”:
A NoWithVeto vote also contributes to the proposal’s veto threshold, which is commonly 1/3 of votes.

structsd tx gov vote 1 no_with_veto --from <WALLET_NAME> --gas auto -y

Deposit into proposal:

structsd tx gov deposit 1 1000000ualpha --from <WALLET_NAME> --gas auto -y

Check voting result:

structsd q gov proposals --voter <ADDRESS>

Create proposal:

structsd tx gov submit-proposal \
--title="Reward crptcpchk for his setup guide. =)" \
--description="He's a good lad." \
--type="Text" \
--deposit="1000000ualpha" \
--from=<WALLET_NAME> \
--gas=auto \
--y

Delete Node

systemctl stop structsd && \
systemctl disable structsd && \
rm /etc/systemd/system/structsd.service && \
systemctl daemon-reload && \
rm -f $(which structsd) && \
rm -rf $HOME/.structs $HOME/structsd

Links

Follow for more guides on nodes, drops and other useful stuff.

Discord: https://discord.gg/9kvtEQwtqJ

X: https://twitter.com/the01100011

Telegram: https://t.me/psicrypto

--

--

crptcpchk
crptcpchk

Written by crptcpchk

@RawBox Squad | Blockchain Validator