__init__

Api.__init__(nodes: Union[List[str], str] = None, **kwargs)[source]

Constructor for Privex’s GOLOS wrapper class. No arguments are required, unless you want to override defaults.

Basic Usage:

Use default nodes list and settings:

>>> golos = Api()

Use only this specific node:

>>> golos = Api(nodes='wss://golosd.privex.io')

Use a list of nodes, and enable more verbose logging from WsClient

>>> nodes = ['wss://golosd.privex.io', 'wss://api.golos.blckchnd.com/ws']
>>> golos = Api(nodes=nodes, report=True)

Making basic API calls:

>>> acc = golos.get_accounts(['someguy123'])
>>> acc[0]['owner']
'someguy123'
>>> wit = golos.get_witness_by_account('someguy123')
>>> wit['url']
'https://golos.io/ru--delegaty/@someguy123/delegat-someguy123'
Parameters
  • nodes (list|str) – A list / singular str GOLOS node(s) formatted like such: wss://golosd.privex.io

  • report (bool) – (KWARG) If True - enables more verbose logging from WsClient

  • kwargs – Any additional keyword arguments (will be forwarded to WsClient’s constructor)