New payment script release for TRX tokens!

Sep 11, 2018 · 4 min read
Image for post
Image for post

Dear community,

Last month we made a step-by-step tutorial for everyone to learn how to use our TRX payment script for distributing rewards among their voters!

In this new release of payment script we implemented the distribution of TRX tokens feature for candidates and SRs that issued their own tokens and want to share them to their voters!

And no, we didn’t issue any token so far and we don’t plan to do it for the moment, but NEVER say never! Meanwhile, with a lot of passion we developed this new release of the script for the TRON community! Feel free to use it and contact us on our telegram group if you need assistance in configuring or running it!

Our TRX tokens script is fully open-source for everyone to use, change or personalize! It was successfully tested by several people from the community including SRs and SR candidates like Tron Europe and Tronstronics!

How does the script work?

The script takes snapshots of the voters’ data every 6 hours, calculates the distribution of a configured amount of tokens and saves pending amounts for every voter based on his weight in the total votes cast for that SR. After 3 complete cycles of calculating and adding pending amounts for each voter, at the end of the 4th cycle of the day the script prepares a file with payments commands and broadcast the payments to the network.

Server Configuration

Install the dependencies

Install python

sudo apt install python3-pip
sudo pip3 install python-dateutil
sudo pip3 install python-dateutil --upgrade

Clone the repo

git clone
cd trx-token-pool

Install nodejs

sudo apt install nodejs
sudo apt install npm
npm install axios
curl -sL | sudo -E bash -
sudo apt-get install -y nodejs

Install docker containers

apt install docker docker-compose
git clone

In docker-compose.yml file put your SR IP in full and solidity IPs

ENABLE_SYNC: "false"
SECRET_KEY: "aSLtAkzrIY9pTPyboOih"

Run the docker in screen or when making the payments:

Set configurations for your SR

nano config.json

- token: the token name to distribute
sraddress: your SR address — this address will be used when getting voters’ data from the API
owneraddress: The address from where the token payments will be broadcasted
nodepay: node used for payments. It’s recommended to install the docker containers and to change nodepay to
amount: total amount of tokens to distribute for the current cycle
minpayout: the minimum amount for a payment (NOTICE: in config_snapshot.json DO NOT modify minpayout)
pk: the private key of the wallet from which the payments will be broadcasted
skip: a list of addresses to skip (example: [“address1”,”address2”])

nano config_snapshot.json

- make the same configurations as above, except the minpayout. DO NOT modify the minpayout field in this file.

nano poollogs.json

- lastpayout: the unixtimestamp of your last payments or the unixtimestamp of pool starting

nano votes.js

- put your SR address in the following line


Run it

node votes.js
  • At the end of each round — 3 times a day (the script will calculate pending amounts)
python3 -c config_snapshot.json
  • At the end of the 4th round — once a day (the script will create file and will broadcast the payments)

The payments will be broadcasted every second.

Run it in crontab

  • give rights to execute
chmod +x
chmod +x
chmod +x
  • set separate crontab jobs for the following scripts

Any feedback or ideas of improvements are very welcomed!

Thank you,


Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store