Today, I have updated our RPC-client for the Steem blockchain. This was born out of requirements for other projects of @blockbrothers (Steemify, SteemTurbine, and VoteBot), to have a more stable and low-level RPC-client for the steemd nodes of the Steem network.
Feel free to use it for your own projects.
A total of three issues were fixed, two of them were still open until today;
nodes property from RPCClient causes infinite loop.Issue #1 was fixed by creating a copy of the nodes list by iterating the itertools.cycle.
Issue #2 was fixed by changing the constant STEEMIT_BLOCK_INTERVAL to STEEM_BLOCK_INTERVAL, as it seems to have changed on the RPC-nodes.
Issue #3 was fixed by refactoring the while-loop in SteemdClient.stream_blocks() method.
I've added a few high-level methods to nozzle.client.SteemdClient to get accounts, get account reputation, get witness accounts by id, and get witness accounts by accountname:
from nozzle import Steem
s = Steem(nodes=['https://api.steemit.com'])
s.get_accounts(['blockbrothers', 'bennierex', 'eqko', 'exyle', 's3rg3'])
s.get_account_reputation('blockbrothers')
s.get_witnesses_by_account(['blockbrothers', 'aggroed'])
s.get_witnesses_by_id([14639, 14503])
SteemdClient.get_blocks() and SteemdClient.stream_blocks() now always yield a block, even if it is None. It's up to the consumer to decide what to do when that happens.
The new version, v0.1.2, is available on pypi.
To install, simply run pip install steem-nozzle.
To upgrade, run pip install --upgrade steem-nozzle.