Tool that automatically claims your Kusama/Polkadot validator rewards.
Deployable in a Kubernetes cluster as a cronjob (helm chart).
Forked from https://github.com/ironoa/polkadot-k8s-payouts
You can start by cloning the repo and installiing the dependencies, NodeJS and Yarn are required:
$ git clone https://github.com/w3f/polkadot-k8s-payouts
$ cd polkadot-k8s-payouts
$ yarn
Then you should create a configuration file, you can start by copying a sample provided with the repo and customizing it:
$ cp config/main.sample.yaml config/main.yaml
Now you can customize config/main.yaml
, see the following configurations about how to do it. Once you are done you
can run the tool with:
$ yarn start
You can generate the keystore file by exporting your account either from the polkadot.js.org app(Create a backup file) or from the polkadot{.js} extension(Export Account)
The password file should not contain any trailing new line charaters, therefore you could use this command to be sure to create a properly formatted password file: echo -n "yourPassword" > yourFileName
The claims extrinsics are batched in utility.batch extrinsic calls. This parameter is the maximum number of calls to be packed into the batch extrinsic.
ATTENTION: if you increase too much this value you might incur in this extrinsic error:
This is an optional parameter you can add to configure a grace period limitation you wish to introduce: it will prevent a claim to be triggered if the validator rewards is not "old" enough eras from the current one.
For example, in Kusama this is equivalent to a grace period of 4 days:
# config/main.yaml
logLevel: info
wsEndpoint: "wss://kusama-rpc.polkadot.io/"
gracePeriod:
enabled: true
eras: 16
claims:
enabled: true
claimerKeystore:
filePath: /path/to/validator-000/keystore
passwordPath: /path/to/validator-000/keystore/password
targets:
- alias: validator-000
validatorAddress: "<validator-000-stash-address>"
- alias: validator-001
validatorAddress: "<validator-001-stash-address>"
This is an optional parameter you can add to force a scan starting from the last 84 era, rather then relying on the onchain account ledger information. Keep it disabled for normal operations.
The list of target addresses can be dynamically retrieved (app startup/restart) from a Git file. Check the GitConfigLoader implementation.