SteemNodeRPC

Warning

This is a low level class that can be used in combination with SteemClient. Do not use this class unless you know what you are doing!

This class allows to call API methods exposed by the witness node via websockets.

Defintion

class pistonapi.steemnoderpc.SteemNodeRPC(urls, user='', password='', **kwargs)

This class deals with the connection to the API. Either it is a websocket connection straight to the backend, or to a jussi proxy.

Parameters:
  • urls (str) – Either a single Websocket URL, or a list of URLs
  • user (str) – Username for Authentication
  • password (str) – Password for Authentication

Usage:

ws = SteemNodeRPC("ws://10.0.0.16:8090")
print(ws.get_account_count())
__getattr__(name)

Map all methods to RPC calls and pass through the arguments. It makes use of the GrapheneRPC library.

rpcexec(payload)

Execute a call by sending the payload. It makes use of the GrapheneRPC library. In here, we mostly deal with Steem specific error handling

Parameters:

payload (json) – Payload data

Raises:
  • ValueError – if the server does not respond in proper JSON format
  • RPCError – if the server returns an error