A revenue distribution tool for Acryl nodes
First of all, you need to install Node.js (https://nodejs.org/en/) and NPM. Afterwards the installation of the dependencies could be done via:
mkdir node_modules
npm installOnce the dependencies are installed, the script that generates the payouts need to be configured. In order to do so, change the config.json:
{
"address": "3ETdcKsJk1amXniruGQe1QMednw8z44UxBK",
"alias": "",
"firstBlockWithLeases": 721600,
"filename": "payments.json",
"node": "http://127.0.0.1:6868",
"percentageOfFeesToDistribute": 70,
"blockStorage": "blocks.json",
"apiKey": "atom",
"feeAssetId": null,
"fee": 10000,
"remoteNode": "https://nodes.acrylplatform.com"
}Put your settings here:
address: the address of your node that you want to distribute fromalias: the alias of the node addressfirstBlockWithLeases: the block where you received the first leasefilename: file to which the payments for the mass payment tool are writtennode: address of your node in the form http://:percentageOfFeesToDistribute: the percentage of Acryl fees that you want to distributeblockStorage: file for storing block historyapiKey: the API key of the node that is used for distributionfeeAssetId: id of the asset used to pay the fee, null for Acrylfee: amount of fee to spend for the txremoteNode: node for check tx
After a successful configuration of the tool, it could be started with:
npm run generateAfter the script is finished, the payments that should be distributed to the leasers are written to the file configured by the config.filename setting in the configuration section.
For the actual payout, the masspayment tool needs to be run.
npm run paymentWe decided to use two seperate tools since this allows for additional tests of the payments before the payments are actually executed. On the other hand, it does not provide any drawback since both scripts could also be called directly one after the other with:
npm run generate && npm run paymentWe strongly recommend to check the payments file before the actual payments are done.
npm run checkThe output of the tool should provide an information about how man tokens of each asset will be paid by the payment script. After checking this information, you should be ready to execute the payments.
Payments for airdrops could be calculated by using the airdrop.js script. Configuration works pretty much the same way as for the other scripts:
/**
* Put your settings here:
* - address: the address of your node that you want to distribute from
* - block: the block for which you want to calculate your richlist
* - total: amount of supply for the reference asset
* - amountToDistribute: amount of tokens that you want to distribute (have decimals in mind here...)
* - assetId: id of the reference asset
* - assetToDistributeId: id of the asset you want to airdrop
* - filename: name of the file the payments are written to
* - node: address of your node in the form http://<ip>:<port
* - excludeList: a list of addresses that should not receive the airdrop, e.g., exchanges...
*/
var config = {
address: '',
block: 500859,
amountToDistribute: 35000000,
assetId: '',
assetToDistributeId: '',
filename: '',
node: '',
excludeList: []
};Afterwards, the script could be started with:
node airdrop.jsPlease always test your resulting payment scripts, e.g., with the checkPaymentsFile.js script!