The automatic reward distribution service for IoTeX delegates
Components | Version | Description |
---|---|---|
Golang | ≥ 1.11.5 | Go programming language |
- If you put the project code under your
$GOPATH/src
, you will need to set up an environment variable:
export GO111MODULE=on
set GO111MODULE=on (for windows)
- Specify distributor's account information by setting up the password for the keystore file and the IoTeX address for keystore verification:
export VAULT_PASSWORD=password_for_distributor's_keystore_file
export VAULT_ADDRESS=distributor's_IoTeX_address
Note that you need to set up a distributor account and generate the corresponding keystore file beforehand.
- Specify IoTeX Public API address:
export IO_ENDPOINT=Full_Node_IP:API_Port
If the distrbution happens on IoTeX mainnet, you can use the MainNet secure endpoint:
api.iotex.one:443
If the distribution happens on IoTeX testnet, you can use the TestNet secure endpoint:
api.testnet.iotex.one:443
- Specify smart contract addresses:
export MULTISEND_CONTRACT_ADDRESS=multisend_contract_address
export HERMES_CONTRACT_ADDRESS=hermes_contract_address
Note that it is required that you have deployed both contracts before starting the distribution service. Please refer to the instruction if you want to know how to deploy a smart contract with ioctl command line tool.
- You may need to distribute rewards in batches due to the gas limit constraint. To set how many distributions in a batch:
export CHUNK_SIZE=distribution_batch_size
- Build service:
make build
- Before distributing rewards, you may need to claim rewards first by executing the following command:
./bin/hermes claim DELEGATE
- Distribute rewards to voters by executing the following command:
./bin/hermes distribute DELEGATE