## Repository https://github.com/holgern/beem
![beem-logo](https://cdn.steemitimages.com/DQmcRrwLPSywSYMierfP6um6mejeMNGjN9Rxw7audJqTDgb/beem-logo)
[beem](https://github.com/holgern/beem) is a python library and command line tool for HIVE. The current version is 0.24.18. There is also a discord channel for beem: https://discord.gg/4HM592V The newest beem version can be installed by: ``` pip install -U beem ``` Check that you are using hive nodes. The following command ``` beempy updatenodes --hive ``` updates the nodelist and uses only hive nodes. After setting hive as default_chain, `beempy updatenodes` can be used. The list of nodes can be checked with ``` beempy config ``` and ``` beempy currentnode ``` shows the currently connected node. ## Changelog for 0.24.18 * Adapt account history on api changes and fixes issue #267 * Speed up history call, when limit is below 1000 * Improve unit tests for account history * Fix estimate_virtual_op_num, when get_account_history returns an empty entry for an index * Implement _get_operation_filter and use filter operations in history and history_reverse on the https://api.hive.blog api node ## Changelog for 0.24.17 * Fixed a bug when using skip_account_check=True * Refactor code in Account * Add more unit tests ## Changelog for 0.24.16 * Fix bug in bytes representation of an Amount which prevents sending certain amounts (e.g. 8.19 HIVE) * Added unit tests to check if 8.190 is correctly working ## Fixing rounding errors in transfers In version 0.24.16, a rounding bug was fixed which prevents sending 8.19 HIVE. This bug leads to a wrong signature, which then prevents broadcasting the transfer op. This is now fixed. ## Improved error handling in account history The account history and history_reverse functions have now a better error handling. The returned index is now checked, which prevents that account history elements were added twice to the output. ## New filtered account history Currently the new filter parameter are only implemented at "https://api.hive.blog" API node. On this node, the get_account_history call has two more parameters: operation_filter_low and operation_filter_high. These parameters are a bitmask of all possible operation names. They can be obtained with the `_get_operation_filter` function: ``` operation_filter_low, operation_filter_high = account._get_operation_filter(only_ops=["transfer", "vote"]) ``` which results in operation_filter_low=5 and operation_filter_high=0. The `history` and `history_reverse` function from beem will now use the operation_filter when "https://api.hive.blog" is set as node. This speeds up receiving account history data up to 100 %. ### History reverse with operation_filter ``` from beem.account import Account from beem import Hive import time hive = Hive("https://api.hive.blog") acc = Account("holger80", blockchain_instance=hive) start_time = time.time() n_op = acc.virtual_op_count() transfer_ops = list(acc.history_reverse(only_ops=["transfer"])) print("Time needed to search all transfers in %d history elements: %.2f s" % (n_op, (time.time() - start_time))) print("%d transfer op have been found" % (len(transfer_ops))) ``` returns ``` Time needed to search all transfers in 283514 history elements: 145.66 s 4666 transfer op have been found ``` ### History with operation_filter ``` from beem.account import Account from beem import Hive import time hive = Hive("https://api.hive.blog") acc = Account("holger80", blockchain_instance=hive) start_time = time.time() n_op = acc.virtual_op_count() transfer_ops = list(acc.history(only_ops=["transfer"])) print("Time needed to search all transfers in %d history elements: %.2f s" % (n_op, (time.time() - start_time))) print("%d transfer op have been found" % (len(transfer_ops))) ``` returns ``` Time needed to search all transfers in 283517 history elements: 144.55 s 4666 transfer op have been found ``` ### History without operation filter Now we do the same without filtering: ``` from beem.account import Account from beem import Hive import time hive = Hive("https://api.hive.blog") acc = Account("holger80", blockchain_instance=hive) start_time = time.time() n_op = acc.virtual_op_count() transfer_ops = [] for op in acc.history(): if op["type"] == "transfer": transfer_ops.append(op) print("Time needed to search all transfers in %d history elements: %.2f s" % (n_op, (time.time() - start_time))) print("%d transfer op have been found" % (len(transfer_ops))) ``` returns ``` Time needed to search all transfers in 283518 history elements: 261.63 s 4666 transfer op have been found ``` ___ *If you like what I do, consider casting a vote for me as witness on [Hivesigner](https://hivesigner.com/sign/account-witness-vote?witness=holger80&approve=1) or on [PeakD](https://peakd.com/witnesses)*

See: Update for beem: improved account history handling by @holger80