LightHive - A light Python client for HIVE blockchain

in HiveDevs15 days ago (edited)

lighthive is a light python client to interact with the HIVE blockchain. It’s simple and stupid. It doesn’t interfere with the process between the developer and the HIVE node.

It's forked from the Lightsteem project. You can just install w/ the traditional PIP: (Requires Python3.6+)

$ (sudo) pip install lighthive


Get Dynamic Global Properties

props = client.get_dynamic_global_properties()


Get Current Reserve Ratio

ratio = c('witness_api').get_reserve_ratio()


Get @emrebeyler’s account history

history = c.get_account_history("emrebeyler", 1000, 10)

for op in history:
Get top 100 witness list

witness_list = client.get_witnesses_by_vote(None, 100)


Broadcasting transactions

Account Witness Vote

from lighthive.client import Client
from lighthive.datastructures import Operation

c = Client(

op = Operation('account_witness_vote', {
        'account': '<your_account>',
        'witness': 'emrebeyler',
        'approve': True,



This will vote with a %1. Percent / 100 = Weight. If you want to downvote, use negative weight.

from lighthive.client import Client
from lighthive.datastructures import Operation

client = Client(

op = Operation('vote', {
    "voter": "emrebeyler",
    "author": "emrebeyler",
    "permlink": "re-hitenkmr-actifit-ios-app-development-contribution-20180816t105311829z",
    "weight": 100,


More examples can be found at the documentation.


Vote for my witness

If you didn't vote for my witness already, consider casting a witness vote.


Cool, thanks for that... nice little port.

i love it ! :DDDD imma try this out

deleted because i found my question was stupid

Nice! There are still some "STEEM" words in documentation and more important in project description on GitHub.


Yeah, this will be addressed later. The first priority is having the library functional.

i see in the preview that some multiplying asterix dont show up, but they are there

global client
def sellop(steem,exp):
op=Operation("limit_order_create",{"owner":"maxsieg","orderid":str(randint(0,10000)),"amount_to_sell":json.dumps({"amount":str(int(steem1000)),"precision":"3","nai":"@@000000021"}),"amount_to_recieve":json.dumps({"amount":str(int(steem1000*sellrate())),"precision":"3","nai":"@@000000013"}),"fill_or_kill": "false","expiration":(datetime.utcnow()+timedelta(seconds=exp)).strftime("%Y-%m-%dT%H:%M:%S")})

I was not sure about boolean values i tried both "false" and False. Because of the following error message i tried converting all integers into string but it still gives me this message.

RPCNodeException: Parse Error:Couldn't parse int64_t

I converted it to string so should be no integer in there? do strings have to be encoded in a certain way? python3 should be utf-8...

First question: why do you use json.dumps in the fields? I'll try to check broadcasting a limit_order_create, today.

For boolean values, use Python's false. False. with no "" or ''.

usin json.dumps cuz u use json.dumps to solve dictionaries in dictionaries when you write a "post" or "comment on none" operation in the docs. i would not know how to deal with dictionaries in dictionaries otherwise.