grapheneapi.rpc module

class grapheneapi.rpc.Rpc(url, **kwargs)

Bases: object

This class allows to call API methods synchronously, without callbacks.

Parameters:
  • url (str) – A single REST endpoint URL
  • num_retries (int) – Try x times to num_retries to a node on disconnect, -1 for indefinitely
  • proxy (str) – Proxy URL (e.g. socks5://localhost:9050), None by default.

Usage:

ws = GrapheneHTTPRPC("https://api.node.com")
print(ws.get_account_count())
connect()
disconnect()
get_proxy_url()
get_request_id()
parse_response(query, log_on_debug=True)
rpcexec(**kwargs)
setup_proxy(options)