Nozzle v0.1.2 - Update and bugfixes

Words
243
Reading
2 min
Listen
Play
8y

Today, I have updated our RPC-client for the Steem blockchain. This was born out of requirements for other projects of blockbrothers@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.

Bug Fixes

A total of three issues were fixed, two of them were still open until today;

  • Issue #1 - Getting nodes property from RPCClient causes infinite loop.
  • Issue #2 - Unable to stream blocks.
  • Issue #3 - Possible infinite loop in call-method of RPCClient.

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.

New Features

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])

Enhancement

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.

Installation / upgrade

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.

Planned future enhancements

  • Add more high-level functions.
  • Make nozzle compatible with Appbase.
  • Performance improvements.
  • Communities/Hivemind/SMT compatibility (when available)



Posted on Utopian.io - Rewarding Open Source Contributors

Nozzle v0.1.2 - Update and bugfixes | Ecency