{"id":13604011,"url":"https://github.com/turboflakes/crunch","last_synced_at":"2026-02-10T11:07:18.873Z","repository":{"id":45477897,"uuid":"386462597","full_name":"turboflakes/crunch","owner":"turboflakes","description":"Crunch is a command-line interface (CLI) and Matrix Bot to claim staking rewards  every Era for Substrate-based chains","archived":false,"fork":false,"pushed_at":"2026-01-14T10:39:10.000Z","size":20223,"stargazers_count":68,"open_issues_count":4,"forks_count":26,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-01-14T14:32:54.165Z","etag":null,"topics":["kusama","polkadot","substrate"],"latest_commit_sha":null,"homepage":"https://turboflakes.io","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/turboflakes.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-07-16T00:39:22.000Z","updated_at":"2026-01-14T10:39:14.000Z","dependencies_parsed_at":"2025-05-26T13:48:12.450Z","dependency_job_id":"9b36daf9-2935-4b88-bd5b-352a2426f3a0","html_url":"https://github.com/turboflakes/crunch","commit_stats":null,"previous_names":[],"tags_count":102,"template":false,"template_full_name":null,"purl":"pkg:github/turboflakes/crunch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turboflakes%2Fcrunch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turboflakes%2Fcrunch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turboflakes%2Fcrunch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turboflakes%2Fcrunch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/turboflakes","download_url":"https://codeload.github.com/turboflakes/crunch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turboflakes%2Fcrunch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29298505,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T10:40:02.018Z","status":"ssl_error","status_checked_at":"2026-02-10T10:38:28.459Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kusama","polkadot","substrate"],"created_at":"2024-08-01T19:00:38.100Z","updated_at":"2026-02-10T11:07:18.771Z","avatar_url":"https://github.com/turboflakes.png","language":"Rust","funding_links":[],"categories":["Libraries"],"sub_categories":["Multisig Wallets"],"readme":"# crunch \u0026middot; ![latest release](https://github.com/turboflakes/crunch/actions/workflows/create_release.yml/badge.svg)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/turboflakes/crunch/blob/main/assets/crunchbot-github-header.png?raw=true\"\u003e\n\u003c/p\u003e\n\n`crunch` is a command-line interface (CLI) to easily automate payouts of staking rewards on Substrate-based chains.\n\n## Why use `crunch`\n\nTo claim staking rewards for just one or a list of Validators at the end of each Era or every X hours.\n\nTo get notified about the amount and rate of the total staking rewards each Validator and their Nominators got\n\nTo be informed about era stats for each Validator, e.g. inclusion rate, claimed rewards rate, era points trend, active for current era\n\nTo easily inspect about any unclaimed eras for a given Validator stash\n\nTo promote Validators by publicly publish their automated staking rewards to a public **Crunch Bot** room\n\nFor Nominators in private or public rooms check their chosen Validators rewards performance\n\nFor Pool Operators to ensure that all active validators selected - active pool nominees - payout on time. An additional guarantee for Pool members that Pool operatos act in members best interests.\n\nFor Pool Operators to auto-compound members rewards above certain threshold.\n\n## Installation\n\n```bash\n#!/bin/bash\n# create `crunch-bot` directory\nmkdir /crunch-bot\n# download `crunch` binary latest version\nwget -P /crunch-bot https://github.com/turboflakes/crunch/releases/download/v0.18.0/crunch\n# make `crunch` binary file executable\nchmod +x /crunch-bot/crunch\n```\n\nNote: Alternatively download [`crunch-update.sh`](https://github.com/turboflakes/crunch/blob/main/crunch-update.sh) bash script file and make it executable. Easier installation and faster updates.\n\n## Configuration\n\nCreate a configuration file `.env` inside `crunch-bot` folder and copy the default variables from [`.env.example`](https://github.com/turboflakes/crunch/blob/main/.env.example) (Note: `.env` is the default name and a hidden file, if you want something different you can adjust it later with the option `crunch --config-path /crunch-bot/config_kusama.env` )\n\n```bash\n#!/bin/bash\n# create/open a file with a file editor (Vim in this case) and add/change the configuration\n# variables with your own personal values\nvi /crunch-bot/.env\n# when ready write and quit (:wq!)\n```\n\nConfiguration file example: [`.env.example`](https://github.com/turboflakes/crunch/blob/main/.env.example)\n\n```bash\n# ----------------------------------------------------------------\n# crunch CLI configuration variables \n# ----------------------------------------------------------------\n# [CRUNCH_STASHES] Validator stash addresses for which 'crunch flakes', 'crunch rewards'\n# or 'crunch view' will be applied. \n# If needed specify more than one (e.g. stash_1,stash_2,stash_3).\nCRUNCH_STASHES=5GTD7ZeD823BjpmZBCSzBQp7cvHR1Gunq7oDkurZr9zUev2n\n#\n# [CRUNCH_STASHES_URL] Additionally the list of stashes could be defined and available in a remote file.\n# `crunch` will try to fetch the stashes from the endpoint predefined here before triggering the respective payouts\n# Please have a look at the file '.remote.stashes.example' as an example\nCRUNCH_STASHES_URL=https://raw.githubusercontent.com/turboflakes/crunch/main/.remote.stashes.example\n#\n# [CRUNCH_LIGHT_CLIENT_ENABLED] Enable lightweight client to connect to substrate-based chains. \n# With this option enabled there is no need to specify specific RPCs endpoints for 'substrate-ws-url' \n# or 'substrate-people-ws-url'\nCRUNCH_LIGHT_CLIENT_ENABLED=true\n#\n# [CRUNCH_SUBSTRATE_WS_URL] Substrate websocket endpoint for which 'crunch' will try to\n# connect. (e.g. wss://rpc.turboflakes.io:443/kusama) (NOTE: substrate_ws_url takes precedence\n# than \u003cCHAIN\u003e argument) \n#CRUNCH_SUBSTRATE_WS_URL=ws://localhost:9944\n#\n# [CRUNCH_SUBSTRATE_PEOPLE_WS_URL] Substrate websocket endpoint for which 'crunch' will try to \n# connect and retrieve identities from. (e.g. wss://sys.turboflakes.io:443/people-kusama)\n#CRUNCH_SUBSTRATE_PEOPLE_WS_URL=wss://sys.turboflakes.io:443/people-kusama\n#\n# [CRUNCH_MAXIMUM_PAYOUTS] Maximum number of unclaimed eras for which an extrinsic payout\n# will be submitted. (e.g. a value of 4 means that if there are unclaimed eras in the last\n# 84 the maximum unclaimed payout calls for each stash address will be 4). [default: 4]\nCRUNCH_MAXIMUM_PAYOUTS=4\n#\n# [CRUNCH_MAXIMUM_HISTORY_ERAS] Maximum number of history eras for which crunch will look for \n# unclaimed rewards. The maximum value supported is the one defined by constant history_depth\n# (e.g. a value of 4 means that crunch will only check in the latest 4 eras if there are any \n# unclaimed rewards for each stash address). [default: 4]\nCRUNCH_MAXIMUM_HISTORY_ERAS=4\n#\n# [CRUNCH_MAXIMUM_CALLS] Maximum number of calls in a single batch. [default: 4]\nCRUNCH_MAXIMUM_CALLS=4\n#\n# [CRUNCH_SEED_PATH] File path containing the private seed phrase to Sign the extrinsic \n# payout call. [default: .private.seed]\n#CRUNCH_SEED_PATH=.private.seed.example\n# ----------------------------------------------------------------\n# Matrix configuration variables\n# ----------------------------------------------------------------\nCRUNCH_MATRIX_USER=@your-regular-matrix-account:matrix.org\nCRUNCH_MATRIX_BOT_USER=@your-own-crunch-bot-account:matrix.org\n# NOTE: type the bot password within \"\" so that any special character could be parsed correctly into a string.\nCRUNCH_MATRIX_BOT_PASSWORD=\"anotthateasypassword\"\n# ----------------------------------------------------------------\n# ONE-T configuration variables\n# ----------------------------------------------------------------\nCRUNCH_ONET_API_ENABLED=true\nCRUNCH_ONET_API_URL=https://kusama-onet-api.turboflakes.io\nCRUNCH_ONET_API_KEY=crunch-101\nCRUNCH_ONET_NUMBER_LAST_SESSIONS=6\n# ----------------------------------------------------------------\n# Nomination Pools configuration variables\n# ----------------------------------------------------------------\n# [CRUNCH_POOL_IDS] Additionally the list of stashes could be defined from a single or more Nomination Pool Ids.\n# `crunch` will try to fetch the nominees of the respective pool id predefined here before triggering the respective payouts\nCRUNCH_POOL_IDS=10,15\n#\n# [CRUNCH_POOL_COMPOUND_THRESHOLD] Define minimum pending rewards threshold in PLANCKS. \n# Note: only pending rewards above the threshold are included in the auto-compound batch.\nCRUNCH_POOL_COMPOUND_THRESHOLD=100000000000\n#\n# [CRUNCH_POOL_MEMBERS_COMPOUND_ENABLED] Enable auto-compound rewards for every member that belongs to the pools \n# previously selected by CRUNCH_POOL_IDS. Note that members have to have their permissions \n# set as PermissionlessCompound or PermissionlessAll.\n#CRUNCH_POOL_MEMBERS_COMPOUND_ENABLED=true\n#\n# [CRUNCH_POOL_ONLY_OPERATOR_COMPOUND_ENABLED] Enable auto-compound rewards for the pool operator member that belongs to the pools \n# previously selected by CRUNCH_POOL_IDS. Note that operator member account have to have their permissions \n# set as PermissionlessCompound or PermissionlessAll.\nCRUNCH_POOL_ONLY_OPERATOR_COMPOUND_ENABLED=true\n#\n# [CRUNCH_POOL_ACTIVE_NOMINEES_PAYOUT_ENABLED] Enable payouts only for ACTIVE nominees assigned to the pools \n# previously selected by CRUNCH_POOL_IDS.\n#CRUNCH_POOL_ACTIVE_NOMINEES_PAYOUT_ENABLED=true\n#\n# [CRUNCH_POOL_ALL_NOMINEES_PAYOUT_ENABLED] Enable payouts for ALL nominees assigned to the pools \n# previously selected by CRUNCH_POOL_IDS.\n#CRUNCH_POOL_ALL_NOMINEES_PAYOUT_ENABLED=true\n```\n\nCreate a seed private file `.private.seed` inside `crunch-bot` folder and write the private seed phrase of the account responsible to sign the extrinsic payout call as in [`.private.seed.example`](https://github.com/turboflakes/crunch/blob/main/.private.seed.example) (Note: `.private.seed` is the default name and a hidden file, if you want something different you can adjust it later with the option `crunch flakes --seed-path ~/crunch-bot/.kusama.private.seed` )\n\n```bash\n#!/bin/bash\n# create a file with a file editor (Vim in this case) and write the private seed phrase \n# of the account responsible to sign the extrinsic payout call\nvi /crunch-bot/.private.seed\n# when ready write and quit (:wq!)\n```\n\n### Configuration of _systemd_ service\n\nA good idea is to run the tool as a `systemd` service. Based on the previous path configuration, here is an example for reference:\n\n```bash\n[Unit]\nDescription=Kusama Crunch Bot\n\n[Service]\nExecStart=/crunch-bot/crunch --config-path /crunch-bot/.env rewards era --seed-path /crunch-bot/.private.seed\nRestart=always\nRestartSec=15\n\n[Install]\nWantedBy=multi-user.target\n\n```\n\n### Crunch Bot ([Matrix](https://matrix.org/))\n\nIf you set up `crunch` on your server with a matrix user 👉  you get your own **Crunch Bot**.\n\nTo enable **Crunch Bot** you will need to create a specific account on Element or similar and  copy the values to the respective environment variables `CRUNCH_MATRIX_BOT_USER` and `CRUNCH_MATRIX_BOT_PASSWORD` like in the configuration example file [`.env.example`](https://github.com/turboflakes/crunch/blob/main/.env.example). You may also want to set your regular matrix user to the environment variable `CRUNCH_MATRIX_USER`. So that **Crunch Bot** could create a private room and send in messages. By default **Crunch Bot** will automatically invite your regular matrix user to a private room. Also by default **Crunch Bot** will send a copy of the messages to the respective network public room for which is connected to.\n\n### Public Rooms available\n\nJoin and read the messages history of all the Public Rooms for which **Crunch Bots** are sending messages:\n\n\u003ctable style=\"width:100%;\" cellspacing=\"0\" cellpadding=\"0\"\u003e\n  \u003ctr\u003e\n    \u003ctd style=\"width: 100px;\"\u003e\n        \u003cimg style=\"width: 80px;\" src=\"https://github.com/turboflakes/crunch/blob/main/assets/crunchbot-westend-room-128.png?raw=true\" /\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\u003ca href=\"https://matrix.to/#/%23westend-crunch-bot:matrix.org\" target=\"_blank\"\u003eWestend Crunch Bot (Public)\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd style=\"width: 100px;\"\u003e\n        \u003cimg style=\"width: 80px;\" src=\"https://github.com/turboflakes/crunch/blob/main/assets/crunchbot-kusama-room-128.png?raw=true\" /\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\u003ca href=\"https://matrix.to/#/%23kusama-crunch-bot:matrix.org\" target=\"_blank\"\u003eKusama Crunch Bot (Public)\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd style=\"width: 100px;\"\u003e\n        \u003cimg style=\"width: 80px;\" src=\"https://github.com/turboflakes/crunch/blob/main/assets/crunchbot-polkadot-room-128.png?raw=true\" /\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\u003ca href=\"https://matrix.to/#/%23polkadot-crunch-bot:matrix.org\" target=\"_blank\"\u003ePolkadot Crunch Bot (Public)\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### Crunch Bot messages\n\n![crunch bot notification messages example](https://github.com/turboflakes/crunch/blob/main/assets/matrix-example-512.png?raw=true)\n\n## Usage\n\nIf you have been doing `crunch` configuration as described in previous steps (assuming `.env` and `.private.seed` defined inside `/crunch-bot` folder), run `crunch` when `/crunch-bot` folder is your current working directory. Otherwise you will have to specify `.env` and `.private.seed` custom paths.\n\n```bash\n#!/bin/bash\n# set /crunch-bot your current working directory\ncd /crunch-bot\n```\n\nBy default `crunch` tries to connect to your local substrate node on the default websocket port `ws://127.0.0.1:9944`. This can be changed by typing one of polkadot main chains - westend, kusama or polkadot. Or by changing the substrate websocket url with the option `--substrate-ws-url`.\n\n`crunch` default sub command is `flakes`, there are fun messages if you stick with it, or you can choose the regular sub command `rewards` rather than `flakes`. As you prefer. Both sub commands are identical in terms of job execution. But logs, messages/notifications differ.\n\nEssentially `crunch` motto is enjoy **Crunch Bot** while `crunch flakes` :)\n\nIf all has been set as previously described `crunch` should be ready with just the following options:\n\n```bash\n#!/bin/bash\n# if running a local node than simple run crunch with default options\n# by default crunch will try to connect to ws://localhost:9944\n# and claim staking rewards as soon as the current era finishes\ncrunch rewards\n# or be specific to which network crunch will try to connect\ncrunch kusama rewards\n# or for Polkadot network and claiming rewards once a day at a specific time\ncrunch polkadot rewards daily\n# or for Westend network and claiming rewards every 6 hours at a specific time\ncrunch westend rewards turbo\n# or just once and exit\ncrunch westend rewards once\n# or for Westend network with unique stashes verified and for all configured pools nominees and claiming rewards every era\ncrunch westend --enable-unique-stashes rewards era --enable-pool-all-nominees-payout\n# or to auto-compound members rewards of nomination pools you operate\ncrunch kusama rewards --enable-pool-members-compound\n# or to know which ONE-T grade a validator got from the last 6 sessions\ncrunch kusama rewards --enable-onet-api\n# or why not and try crunch with light client usage\ncrunch kusama --enable-light-client rewards once\n# or try flakes just for fun :)\ncrunch flakes\n# to list all options try help\ncrunch help\n```\n\nIf you need more customization run help to check all sub commands, flags and options.\n\nNote: All flags and options are also available through environment variables if defined in `.env` configuration file. You can choose which way you want to configure `crunch`. Take in consideration that if the same variable is defined on both sides e.g. defined in `.env` and through CLI flag/option, `crunch` will take the value defined by CLI.\n\n```bash\n#!/bin/bash\n# if you need a custom crunch check all the options and flags available\ncrunch help\n\nUSAGE:\n    crunch [FLAGS] [OPTIONS] [CHAIN] [SUBCOMMAND]\n\nFLAGS:\n        --enable-group-identity    Enables payouts and messages to be grouped and processed by main identity.\n        --enable-light-client      Enable lightweight client to connect to substrate-based chains. With this option\n                                   enabled there is no need to specify specific RPCs endpoints for 'substrate-ws-url' or\n                                   'substrate-people-ws-url'\n        --enable-unique-stashes    From all given stashes crunch will Sort by stash adddress and Remove duplicates.\n    -h, --help                     Prints help information\n    -V, --version                  Prints version information\n\nOPTIONS:\n    -c, --config-path \u003cFILE\u003e\n            Sets a custom config file path. The config file contains 'crunch' configuration variables. [default: .env]\n\n        --github-pat \u003cgithub-pat\u003e\n            Github Personal Access Token with read access to the private repo defined at 'stashes-url'.\n\n    -s, --stashes \u003cstashes\u003e\n            Validator stash addresses for which 'crunch view', 'crunch flakes' or 'crunch rewards' will be applied. If\n            needed specify more than one (e.g. stash_1,stash_2,stash_3).\n        --stashes-url \u003cstashes-url\u003e\n            Remote stashes endpoint for which 'crunch' will try to fetch the validator stash addresses (e.g.\n            https://raw.githubusercontent.com/turboflakes/crunch/main/.remote.stashes.example).\n        --substrate-people-ws-url \u003csubstrate-people-ws-url\u003e\n            Substrate websocket endpoint for which 'crunch' will try to connect and retrieve identities from. (e.g.\n            wss://sys.turboflakes.io:443/people-kusama)\n    -w, --substrate-ws-url \u003csubstrate-ws-url\u003e\n            Substrate websocket endpoint for which 'crunch' will try to connect. (e.g.\n            wss://rpc.turboflakes.io:443/kusama) (NOTE: substrate_ws_url takes precedence than \u003cCHAIN\u003e argument)\n\nARGS:\n    \u003cCHAIN\u003e    Sets the substrate-based chain for which 'crunch' will try to connect [possible values: kusama,\n               polkadot, paseo, westend]\n\nSUBCOMMANDS:\n    flakes     Crunch awesome flakes (rewards) every era, daily or in turbo mode -\u003e 4x faster\n    help       Prints this message or the help of the given subcommand(s)\n    rewards    Claim staking rewards for unclaimed eras once a day or four times a day [default subcommand]\n    view       Inspect staking rewards for the given stashes and display claimed and unclaimed eras.\n```\n\n```bash\n#!/bin/bash\n# or help for any subcommand like\ncrunch rewards --help\n\nUSAGE:\n    crunch rewards [FLAGS] [OPTIONS] [MODE]\n\nFLAGS:\n        --debug                                 Prints debug information verbosely.\n        --disable-matrix                        Disable matrix bot for 'crunch rewards'. (e.g. with this flag active\n                                                'crunch rewards' will not send messages/notifications about claimed or\n                                                unclaimed staking rewards to your private or public 'Crunch Bot' rooms)\n                                                (https://matrix.org/)\n        --disable-matrix-bot-display-name       Disable matrix bot display name update for 'crunch rewards'. (e.g. with\n                                                this flag active 'crunch rewards' will not change the matrix bot user\n                                                display name)\n        --disable-public-matrix-room            Disable notifications to matrix public rooms for 'crunch rewards'. (e.g.\n                                                with this flag active 'crunch rewards' will not send\n                                                messages/notifications about claimed or unclaimed staking rewards to any\n                                                public 'Crunch Bot' room)\n        --enable-onet-api                       Allow 'crunch' to fetch grades for every stash from ONE-T API.\n        --enable-pool-active-nominees-payout    Enable payouts only for ACTIVE nominees assigned to the Nomination Pools\n                                                defined in 'pool-ids'. (e.g. with this flag active 'crunch' will try to\n                                                trigger payouts only for the ACTIVE nominees and not all).\n        --enable-pool-all-nominees-payout       Enable payouts for ALL the nominees assigned to the Nomination Pools\n                                                defined in 'pool-ids'. (e.g. with this flag active 'crunch' will try to\n                                                trigger payouts for ALL nominees and not only the active ones - the ones\n                                                the stake of the Nomination Pool was allocated).\n        --enable-pool-members-compound          Allow 'crunch' to compound rewards for every member that belongs to the\n                                                pools previously selected by '--pool-ids' option. Note that members have\n                                                to have their permissions set as PermissionlessCompound or\n                                                PermissionlessAll.\n        --enable-pool-only-operator-compound    Allow 'crunch' to compound rewards for the pool operator member that\n                                                belongs to the pools previously selected by '--pool-ids' option. Note\n                                                that the operator member account have to have their permissions set as\n                                                PermissionlessCompound or PermissionlessAll.\n    -h, --help                                  Prints help information\n        --medium                                Display essential information (e.g. with this flag active 'crunch\n                                                rewards' will send essential verbose messages/notifications about\n                                                claimed rewards like points and validator rewards)\n        --short                                 Display only minimum information (e.g. with this flag active 'crunch\n                                                rewards' will send minimum verbose messages/notifications about claimed\n                                                rewards)\n    -V, --version                               Prints version information\n\nOPTIONS:\n        --enable-pool-compound-threshold \u003cenable-pool-compound-threshold\u003e\n            Define minimum pending rewards threshold in PLANCKS. (e.g. Only pending rewards above the threshold are\n            include in the auto-compound batch)\n        --error-interval \u003cerror-interval\u003e\n            Interval value (in minutes) from which 'crunch' will restart again in case of a critical error.\n\n        --matrix-bot-password \u003cmatrix-bot-password\u003e\n            Password for the 'Crunch Bot' matrix user sign in.\n\n        --matrix-bot-user \u003cmatrix-bot-user\u003e\n            Your new 'Crunch Bot' matrix user. e.g. '@your-own-crunch-bot-account:matrix.org' this user account will be\n            your 'Crunch Bot' which will be responsible to send messages/notifications to your private or public 'Crunch\n            Bot' rooms.\n        --matrix-user \u003cmatrix-user\u003e\n            Your regular matrix user. e.g. '@your-regular-matrix-account:matrix.org' this user account will receive\n            notifications from your other 'Crunch Bot' matrix account.\n        --maximum-calls \u003cmaximum-calls\u003e\n            Maximum number of calls in a single batch. [default: 8]\n\n        --maximum-history-eras \u003cmaximum-history-eras\u003e\n            Maximum number of history eras for which crunch will look for unclaimed rewards. The maximum value supported\n            is the one defined by the constant history_depth - usually 84 - (e.g. a value of 4 means that crunch will\n            only check in latest 4 eras if there are any unclaimed rewards for each stash address). [default: 4]\n    -m, --maximum-payouts \u003cmaximum-payouts\u003e\n            Maximum number of unclaimed eras for which an extrinsic payout will be submitted. (e.g. a value of 4 means\n            that if there are unclaimed eras in the last 84 the maximum unclaimed payout calls for each stash address\n            will be 4).\n        --pool-ids \u003cpool-ids\u003e\n            Nomination pool ids for which 'crunch' will try to fetch the validator stash addresses (e.g. poll_id_1,\n            pool_id_2).\n    -f, --seed-path \u003cFILE\u003e\n            Sets a custom seed file path. The seed file contains the private seed phrase to Sign the extrinsic payout\n            call.\n        --tx-mortal-period \u003ctx-mortal-period\u003e\n            Define the number of blocks the transaction is mortal for (default is 64 blocks)\n\n        --tx-tip \u003ctx-tip\u003e\n            Define a tip in PLANCKS for the block author.\n\n\nARGS:\n    \u003cMODE\u003e    Sets how often staking rewards should be claimed from unclaimed eras. (e.g. the option 'era' sets\n              'crunch' task to run as soon as the EraPaid on-chain event is triggered; the option 'daily' sets\n              'crunch' task to be repeated every 24 hours; option 'turbo' sets 'crunch' task to be repeated every 6\n              hours;option 'once' tries to run the payout once and exit;) [default: era]  [possible values: era,\n              daily, turbo, once]\n```\n\nNote: By default `crunch` collects the outstanding payouts from previous eras and group all the extrinsic payout calls in group of 4 or whatever value defined in the flag `maximum-calls` so that a single batch call per group can be made. The collection of all outstanding payouts from previous eras is also limited by 2 other flags. The first being `maximum-payouts` which default value is 4, this flag limits the number of payouts **per stash**. The other one is the `maximum-history-eras` which default is also 4, this flag limits the number of past eras `crunch` will look for unclaimed rewards - but this flag only applies if `short` flag is also used in the configuration. This is done so that `crunch` can run efficiently every era.\n\nWith that said, if it's the **first time** you are running `crunch` and you are not sure if you have any unclaimed rewards or if you just want to know for the stash accounts defined in the confguration file (`.env`), which eras from the last 84 have already been claimed or unclaimed, you can simply run `crunch view`.\n\nNote: The `crunch view` mode only logs information into the terminal.\n\n```bash\n#!/bin/bash\n# log unclaimed rewards for Westend network \ncrunch westend view\n# or for Kusama network\ncrunch kusama view\n# or for Polkadot network\ncrunch polkadot view\n```\n\nNote: You can run `crunch` inside a tmux session and leave it, or using something like `systemd` to run `crunch` on server restarts for example. By default `crunch` will wake up every X hours to claim rewards if there are any to claim.\n\n## Common issue on Ubuntu 22.04 when using the crunch binary\n\nInstall previous openssl version from:\n```\nwget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb\ndpkg -i libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb\n```\n\n## Development / Build from Source\n\nIf you'd like to build from source, first install Rust.\n\n```bash\ncurl https://sh.rustup.rs -sSf | sh\n```\n\nIf Rust is already installed run\n\n```bash\nrustup update\n```\n\nVerify Rust installation by running\n\n```bash\nrustc --version\n```\n\nOnce done, finish installing the support software\n\n```bash\nsudo apt install build-essential git clang libclang-dev pkg-config libssl-dev\n```\n\nBuild `crunch` by cloning this repository\n\n```bash\n#!/bin/bash\ngit clone http://github.com/turboflakes/crunch\n```\n\nCompile `crunch` package with Cargo\n\n```bash\n#!/bin/bash\ncargo build\n```\n\nAnd then run it\n\n```bash\n#!/bin/bash\n./target/debug/crunch westend flakes daily\n```\n\nOtherwise, recompile the code on changes and run the binary\n\n```bash\n#!/bin/bash\ncargo watch -x 'run --bin crunch'\n```\n\n### Downloading metadata from a Substrate node\n\nUse the [`subxt-cli`](./cli) tool to download the metadata for your target runtime from a node.\n\nInstall\n```bash\ncargo install subxt-cli\n```\nSave the encoded metadata to a file\n```bash\nsubxt metadata --url https://westend-rpc.polkadot.io  -f bytes \u003e westend_metadata.scale\n```\n(Optional) Generate runtime API client code from metadata\n```bash\nsubxt codegen --url https://westend-rpc.polkadot.io | rustfmt --edition=2018 --emit=stdout \u003e westend_runtime.rs\n```\n\n## Docker\n\n`crunch` can also be built and run from a Docker container.\n\nBuild Image\n\n```bash\ngit clone http://github.com/turboflakes/crunch\ncd crunch\ndocker build -t localhost/crunch .\n```\n\nRun Container\n\n```bash\ndocker run --rm -it localhost/crunch:latest --version\n```\n\nThe config and seed files can be mounted from the host. Any options supported by `crunch` can be added.\n\n```bash\ndocker run --rm -it \\\n  --volume=/etc/crunch/env:/.env:U \\\n  --volume=/etc/crunch/private.seed:/.private.seed:U \\\n  localhost/crunch:latest \\\n    rewards era\n```\n\n## Inspiration\n\nSimilar projects that had influence in crunch design.\n\n- \u003ca href=\"https://github.com/canontech/staking-payouts\" target=\"_blank\"\u003estaking-payouts\u003c/a\u003e - CLI to make staking payout transactions for Substrate FRAME-based chains.\n- \u003ca href=\"https://github.com/stakelink/substrate-payctl\" target=\"_blank\"\u003esubstrate-payctl\u003c/a\u003e - Simple command line application to control the payouts of Substrate validators (Polkadot and Kusama among others).\n- \u003ca href=\"https://dribbble.com/shots/6453317-Mac-And-Cross-Bones\" target=\"_blank\"\u003eJetpacks and Rollerskates\u003c/a\u003e - Illustration work heavily inspired **Crunch Bot** logo.\n\n## Collaboration\n\nHave an idea for a new feature, a fix or you found a bug, please open an [issue](https://github.com/turboflakes/crunch/issues) or submit a [pull request](https://github.com/turboflakes/crunch/pulls).\n\nAny feedback is welcome.\n\n## About\n\n`crunch` was made by **TurboFlakes**. Visit us at \u003ca href=\"https://turboflakes.io\" target=\"_blank\" rel=\"noreferrer\"\u003eturboflakes.io\u003c/a\u003e to know more about our work.\n\nIf you like this project\n  - 🚀 Share our work \n  - ✌️ Visit us at \u003ca href=\"https://turboflakes.io\" target=\"_blank\" rel=\"noreferrer\"\u003eturboflakes.io\u003c/a\u003e\n  - ✨ Or you could also star the Github project :)\n\nTips are welcome\n\n- Polkadot 14Sqrs7dk6gmSiuPK7VWGbPmGr4EfESzZBcpT6U15W4ajJRf (turboflakes.io)\n- Kusama H1tAQMm3eizGcmpAhL9aA9gR844kZpQfkU7pkmMiLx9jSzE (turboflakes.io)\n\n### License\n\n`crunch` - The entire code within this repository is licensed under the [Apache License 2.0](./LICENSE).\n\n### Quote\n\n\u003e \"Study hard what interests you the most in the most undisciplined, irreverent and original manner possible.\"\n― Richard Feynmann\n\n__\n\nEnjoy `crunch`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturboflakes%2Fcrunch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fturboflakes%2Fcrunch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturboflakes%2Fcrunch/lists"}