Services
  • 𝐥𝐞𝐬𝐧𝐢𝐤 | 𝐔𝐓𝐒𝐀
  • 🌐Cosmos WIKI
    • 🔧Creating / Editing a Validator
    • 📨Cosmos / governance
    • 🛠️Useful commands
    • 🔨Changing ports in the Cosmos ecosystem
    • 🌁IBC (HERMES)
    • ⚒️Node-exporter + Grafana + Prometheus + Alertmanager
    • ⚒️TenderDuty v2 - monitoring and alerting
  • Mainnet
    • Arkeo
      • 💻Installation
      • ⌚State sync
      • 📬Updates
    • Atomone
      • 💻Installation
      • ⌚State sync
      • ⌚Snapshots
      • 📬Updates
    • Aura
      • 💻Installation
      • ⌚State sync
      • 📬Updates
    • Dora Factory
      • 💻Installation
      • ⌚State sync
      • 📬Updates
    • Dymension
      • 💻Installation
      • ⌚State sync
      • 📬Updates
    • Genesis L1
      • 💻Installation
      • ⌚State sync
      • 📬Updates
    • Gitopia
      • 💻Installation
      • ⌚State sync
      • 📬Updates
    • Jackal
      • 💻Installation
      • ⌚State sync
      • 📬Updates
    • Konstellation
      • 💻Installation
      • ⌚Snapshot
      • 📬Updates
    • Nibiru
      • 💻Installation
      • ⌚State sync
      • 📬Updates
      • 📬Price feeder (✔️Oracle)
    • Provenance
      • 💻Installation
      • 📬Updates
    • Teritori
      • 💻Installation
      • ⌚State sync
      • 📬Updates
    • Quicksilver
      • 💻Installation
      • ⌚State sync
      • 📬Updates
    • Uptick
      • 💻Installation
      • ⌚State sync
      • 📬Updates
    • Source protocol
      • 💻Installation
      • 📬Updates
    • Zenrock
      • 💻Installation
      • 💻Sidecar (✔️Oracle)
      • 💻Create a validator
      • ⌚State sync
      • ⌚Snapshot
      • 📬Updates
  • TESTNET
    • Atomone
      • 💻Installation
      • 📬Updates
    • Airchains
      • 💻Installation
      • ⌚State sync
      • 📬Updates
    • Aura
      • 💻Installation
      • 📬Updates
    • Arkeo
      • 💻Installation
      • ⌚State sync
      • 📬Updates
      • 📬Providers
    • AXON PROTOCOL
      • 💻Installation
      • ⌚State sync
      • 📬Updates
    • Dora Factory
      • 💻Installation
      • 📬Updates
    • Dymension
      • 💻Installation
      • ⌚State sync
      • 📬Updates
    • Empeiria
      • 💻Installation
      • ⌚State sync
      • 📬Updates
    • Galactica
      • 💻Installation
      • ⌚State sync
      • 📬Updates
    • Jackal
      • 💻Installation
      • 📬Updates
    • Kira
      • 💻Installation
    • PRYSM
      • 💻Installation
      • ⌚State sync
      • 📬Updates
    • Source protocol
      • 💻Installation
      • 📬Updates
    • Story Protocol
      • 💻Installation
      • 💻Create a validator
      • ⌚State sync
      • ⌚Snapshot
      • 📬Updates
    • Tellor
      • 💻Installation
      • ⌚State sync
      • 📬Updates
      • 📬Data Reporter (✔️Oracle)
    • Quicksilver
      • 💻Installation
      • 📬Updates
    • Warden Protocol
      • 💻Installation
      • ⌚State sync
      • 📬Updates
      • 📬Oracle
    • XRPL EVM
      • 💻Installation
      • ⌚State sync
      • ⌚Snapshots
      • 📬Updates
    • Zenrock
      • 💻Installation
      • 💻Sidecar (✔️Install)
      • 💻✔️config.yaml
      • 💻✔️eigen_operator_config.yaml
      • 💻Create a validator
      • 📬Updates
  • OTHER PROJECTS
    • Avail mainnet
      • 💻Installation
      • ⌚Snapshot
      • 📬Validator migration
    • Avail testnet
      • 💻Installation
      • ⌚Snapshot
      • 📬Validator migration
    • Kusama
      • 💻Decentralized nodes
      • 💻Installation
      • ⌚Snapshot
      • ⚙️Validator setup
      • ⚙️Validator migration
      • 🛠️Crunch bot
    • Polkadot
      • 💻Decentralized nodes
      • 💻Installation
      • ⌚Snapshot
      • ⚙️Validator setup
      • ⚙️Validator migration
      • 🛠️Crunch bot
    • Tangle Network
      • 💻Installation
      • 📬Validator migration
    • UOMI (GPU)
      • 💻Installation
      • ⌚Snapshot
      • 📬Validator migration
  • ARCHIVE
    • Entrypoint
      • 💻Installation
      • ⌚State sync
      • 📬Updates
    • Celestia
      • 💻Consensus Node
      • 🖥️Bridge node (Shwap)
      • 🖥️Full node (Shwap)
      • 🖥️Light node (Shwap)
      • ⌚Snapshots
      • ⌚State Sync [consensus node]
      • 🔎Analysis of the Bridge Node
    • Celestia-testnet
      • 💻Consensus Node
      • 🖥️Bridge node (Shwap)
      • 🖥️Full node (Shwap)
      • 🖥️Light node (Shwap)
      • ⌚Snapshots
      • ⌚State Sync [consensus node]
      • 🔎Analysis of the Bridge Node
    • Native [migration to SUI]
      • 💻Installation
      • ⌚Snapshots
      • ⌚State sync
      • 📬Updates
    • Nubit
      • 💻Light node
      • 📬Full Node
    • Lava network
      • 💻Installation
      • ⌚State sync
      • ⌚Snapshot
      • 📬Updates
      • ⌚Providers
    • Lava network
      • 💻Installation
      • ⌚State sync
      • ⌚Snapshot
      • 📬Updates
      • ⌚Providers
    • XAI
      • 💻Installation
    • Ojo
      • 💻Installation
      • ⌚State sync
      • ⌚Snapshot
      • 📬Updates
      • 📬Price feeder (✔️Oracle)
Powered by GitBook
On this page
  • Installing crunch-bot
  • Setting .env
  • Launching crunch-bot
  1. OTHER PROJECTS
  2. Polkadot

Crunch bot

PreviousValidator migrationNextTangle Network

Last updated 6 months ago

Crunch bot - automatic reward payments

Crunch is a command line interface (CLI) for easily automating staking reward payouts on Substrate-based chains

Crunch allows you to:

  • claim staking rewards for one or a list of validators at the end of each epoch or every X hours

  • receive notifications about the amount and rate of total staking rewards received by each validator and its nominators

  • get statistics for each validator. For example - inclusion rate, claimed reward rate, epoch score trend, activity for the current epoch

  • check for any unclaimed epochs for a given validator

You can check out all the features of Crunch on the

Installing crunch-bot

Create a directory and download the binary file

mkdir $HOME/.kusama/crunch-bot && cd $HOME/.kusama/crunch-bot
wget https://github.com/turboflakes/crunch/releases/download/v0.18.1/crunch
chmod +x $HOME/.kusama/crunch-bot/crunch
cp $HOME/.kusama/crunch-bot/crunch /usr/local/bin/
crunch --version
#crunch 0.18.1

When running on ubuntu 22.04, an error may occur with the openssl library You can install it yourself

wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb
dpkg -i libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb

Setting .env

By default crunch will try to connect to ws://IP:9944

If you use RPC to connect, then add the following flagCRUNCH_SUBSTRATE_WS_URL=ws://IP:9944

Replace:

  • CRUNCH_STASHES on your validator's stash

  • CRUNCH_MATRIX_USER to your main matrix account

  • CRUNCH_MATRIX_BOT_USER to your additional matrix account, which you will need to create in advance and from which you will receive messages

  • CRUNCH_MATRIX_BOT_PASSWORD to your password from the additional matrix account

nano $HOME/.kusama/crunch-bot/.env
# ----------------------------------------------------------------
# crunch CLI configuration variables 
# ----------------------------------------------------------------
#
CRUNCH_STASHES=JHRygZAwLR5oScvgF6QcLLR3sFx9GFZWYzirx2cvgF6QcLL
CRUNCH_LIGHT_CLIENT_ENABLED=false
CRUNCH_MAXIMUM_PAYOUTS=4
CRUNCH_MAXIMUM_HISTORY_ERAS=4
CRUNCH_MAXIMUM_CALLS=3
#
# ----------------------------------------------------------------
# Matrix configuration variables
# ----------------------------------------------------------------
#
CRUNCH_MATRIX_DISABLED=false
CRUNCH_MATRIX_PUBLIC_ROOM_DISABLED=true
CRUNCH_MATRIX_USER=@matrix:matrix.org
CRUNCH_MATRIX_BOT_USER=@matrix_bot:matrix.org
CRUNCH_MATRIX_BOT_PASSWORD="password_bot"
#
# ----------------------------------------------------------------
# Nomination Pools configuration variables
# ----------------------------------------------------------------
CRUNCH_POOL_IDS=2
# 1 DOT = 10000000000 PLANCKS
# 1 KSM = 1000000000000 PLANCKS
CRUNCH_POOL_COMPOUND_THRESHOLD=1000000000000
CRUNCH_POOL_ONLY_OPERATOR_COMPOUND_ENABLED=true

We also need to create a separate wallet from which to pay for transactions. We top it up and enter the Seed phrase from the wallet in .private.seed

echo "utsa utsa utsa utsa utsa utsa utsa utsa utsa utsa utsa utsa">> .private.seed

Launching crunch-bot

Now we can see in information form which awards from the last 84 eras were claimed and which were not claimed

# for Kusama
crunch kusama view 
# for Polkadot
crunch polkadot view

Create a service file

'era' - run crunch immediately after EraPaid event is triggered in chain

'daily' - repeat crunch task every 24 hours

'turbo' - repeat crunch task every 6 hours

'once' - tries to payout once and exit

tee /etc/systemd/system/crunch.service > /dev/null <<EOF
[Unit]
Description=Kusama Crunch Bot

[Service]
User=$USER
ExecStart=/usr/local/bin/crunch kusama --config-path $HOME/.kusama/crunch-bot/.env rewards daily --seed-path $HOME/.kusama/crunch-bot/.private.seed
Restart=always
RestartSec=15

[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable crunch
systemctl restart crunch && journalctl -u crunch -f -o cat

Create a main .env configuration file and configure it. The example below provides a simplified configuration file that uses 1 Kusama validator stash wallet. You can see the full functionality

🛠️
official github page
here