- Title: regult.rb - Proxy Sentinel
- Tags: radiator ruby steem steemdev witness-category
- Notes:
Regult (regult.rb) is a proxy sentinel that streams the blockchain, looking for proxy/unproxy operations to update a local text file with a list of accounts that proxy their witness vote to a particular account you're interested in tracking.
In addition to streaming the blockchain, in order to save time and resources, this script will also initialize the list from data on Steem SQL. Since Steem SQL is paid service, I figure using Steem SQL should be optional. If you can manually initialize the proxy-list.txt
file using some other method, using Steem SQL should not be required.
It's also possible to just let Regult build the proxy-list.txt
file from the Genesis block, but that's a bad idea if you're using a public node. Don't do that.
To use this Radiator script:
$ sudo apt-get update
$ sudo apt-get install ruby-full git openssl libssl1.0.0 libssl-dev
$ sudo apt-get upgrade
$ gem install bundler
$ gem install bundler
I've tested it on various versions of ruby. The oldest one I got it to work was:
ruby 2.2.5p319 (2016-04-26 revision 54774) [x86_64-darwin17]
First, clone this gist and install the dependencies:
$ git clone https://gist.github.com/cfce5b47fa0f5b1eae0c6dd9c653ca7d.git regult
$ cd regult
$ bundle install
You should edit regult.yml
and point it at the correct account (proxy_target_account
).
If you intend to use Steem SQL, you can provide the credentials in authorize-steem-sql.sh
, then use this terminal command to enable Steem SQL just before running this script:
source authorize-steem-sql.sh
Now you can skip to ruby regult.rb
.
Otherwise, if you do not intend to use Steem SQL, in order to avoid long replays, get a list of accounts that currently proxy to proxy_target_account
and create a file called proxy-list.txt
with the entire list of account names only, one account name per line (you can typically get this list from steemdb.com, for example: https://steemdb.com/@jesta/proxied is a list of accounts that proxy to jesta).
Then create a file called last-block-num.txt
and add a single line with the latest block number, or whatever number you'd like to begin streaming from.
Once those two files exist, you can run this script and the proxy-list.txt
file will be kept current whenever a relevant proxy/unproxy operation is seen.
Then run it:
$ ruby regult.rb
Regult will now do it's thing. Check here to see an updated version of this script:
https://gist.github.com/inertia186/cfce5b47fa0f5b1eae0c6dd9c653ca7d
Typically, you can upgrade to the latest version by this command, from the original directory you cloned into:
$ git pull
Usually, this works fine as long as you haven't modified anything. If you get an error, try this:
$ git stash --all
$ git pull --rebase
$ git stash pop
If you're still having problems, I suggest starting a new clone.
regult.yml:1: syntax error, unexpected ':', expecting end-of-input
Is there a list of nodes?
art by randychen
See my previous Ruby How To posts in: #radiator #ruby
If you're using Regult, I'd love to hear from you. Drop me a line and tell me what you think! I'm @inertia on STEEM and SteemSpeak.
I don't believe in intellectual "property". If you do, consider Regult as licensed under a Creative Commons License.