SteemStream¶
This module allows to stream blocks and individual operations from the blockchain and run bots with a minimum of code.
Example¶
This example code shows all comments starting at block 1893850.
from steemapi.steemnoderpc import SteemNodeRPC
from pprint import pprint
rpc = SteemNodeRPC("wss://steemit.com/ws")
for a in rpc.stream("comment", start=1893850):
pprint(a)
Definition¶
-
class
steemapi.steemnoderpc.
SteemNodeRPC
(url, user='', password='', **kwargs)¶ This class allows to call API methods synchronously, without callbacks. It logs in and registers to the APIs:
- database
- history
Parameters: - url (str) – Websocket URL
- user (str) – Username for Authentication
- password (str) – Password for Authentication
- apis (Array) – List of APIs to register to (default: [“database”, “network_broadcast”])
Available APIs
- database
- network_node
- network_broadcast
- history
Usage:
ws = SteemNodeRPC("ws://10.0.0.16:8090") print(ws.get_account_count())
-
stream
(opNames, *args, **kwargs)¶ Yield specific operations (e.g. comments) only
Parameters: - opNames (array) – List of operations to filter for, e.g. vote, comment, transfer, transfer_to_vesting, withdraw_vesting, limit_order_create, limit_order_cancel, feed_publish, convert, account_create, account_update, witness_update, account_witness_vote, account_witness_proxy, pow, custom, report_over_production, fill_convert_request, comment_reward, curate_reward, liquidity_reward, interest, fill_vesting_withdraw, fill_order,
- start (int) – Begin at this block