Getting Started¶
Client class is the primary class you will work with.
from lightsteem.client import Client
client = Client()
Appbase nodes support different api namespaces.
Client class uses condenser_api as default. Follow the official developer portal’s api definitions to explore available methods.
Examples¶
Get Dynamic Global Properties
props = client.get_dynamic_global_properties()
print(props)
Get Current Reserve Ratio
ratio = c('witness_api').get_reserve_ratio()
print(ratio)
Get @emrebeyler’s account history
history = c.get_account_history("emrebeyler", 1000, 10)
for op in history:
print(op)
Get top 100 witness list
witness_list = client.get_witnesses_by_vote(None, 100)
print(witness_list)
It’s the same convention for every api type and every call on appbase nodes.
Important
Since, api_type is set when the client instance is called, it is not thread-safe to share Client instances between threads.
Optional parameters of Client¶
Even though, you don’t need to pass any parameters to the Client
, you have some options
to choose.
-
__init__(self, nodes=None, keys=None, connect_timeout=3,
-
read_timeout=30, loglevel=logging.ERROR, chain=None)
Parameters: - nodes – A list of appbase nodes. (Defaults:
api.steemit.com
,appbase.buildteam.io
.) - keys – A list of private keys.
- connect_timeout – Integer. Connect timeout for nodes. (Default:3 seconds.)
- read_timeout – Integer. Read timeout for nodes. (Default: 30 seconds.)
- loglevel – Integer. (Ex: logging.DEBUG)
- chain – String. The blockhain we’re working with. (Default: STEEM)
- nodes – A list of appbase nodes. (Defaults:
See Broadcasting Transactions to find out how to broadcast transactions into the blockchain.