create account

update for beem: preperation for HF24 (eclipse) by holger80

View this thread on: hive.blogpeakd.comecency.com
· @holger80 ·
$137.77
update for beem: preperation for HF24 (eclipse)
## Repository

https://github.com/holgern/beem<center>
![beem-logo](https://cdn.steemitimages.com/DQmcRrwLPSywSYMierfP6um6mejeMNGjN9Rxw7audJqTDgb/beem-logo)
</center>

[beem](https://github.com/holgern/beem) is a python library and command line tool for HIVE.  The current version is 0.24.4.

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 versions 0.24.4
* add get_replace_hive_by_steem() to Hive(), for transition from HF23 to HF24 on HIVE
* Replace HIVE by STEEM and SBD by HBD only when Hive HF < 24
* Replace steem and sbd parameter names for Hive HF >= 24 by hive and hbd
* Add get follow list to Account (only for HIVE and HF >= 24)
* Add BLURT, SMOKE and VIZ chain_id
* Remove not used STEEM chains (STEEMZERO and STEEMAPPBASE)
* Improve chain detection
* rshares_to_token_backed_dollar, get_token_per_mvest, token_power_to_vests, token_power_to_token_backed_dollar
  and vests_to_token_power have been added for chain independent usage
* New beempy command followlist, which can be used on HIVE to receive info about follow lists
* Fix beempy info on Hive
* Use Hive() on beempy when default_chain is set to "hive"

* Fix more Token symbols in beempy
* Fix unittest and add more unit tests

## Prepare beem for HF 24 (eclipse)
Currently, `STEEM` and `SBD` are internally used to broadcasting operations on Hive which including an amount as parameter. There are also some parameter names in operations that include `steem` or `sbd`. 

In the next HF 24 (ecplise), all will be renamed to `HIVE`/`HBD` and `hive`/`hbd`. 

Beem does now support Hive HF23 and Hive HF24. There is a temporary function call `get_replace_hive_by_steem()` is is True on HF23 and False on HF24. I'm using this as test when to replacing all steem/sbd with hive/hbd.

When HF24 took place, I will remove this check and make the replacement with hive/hbd permanent.

A node running HF24 can be set with
```
beempy set nodes https://beta.openhive.network
```

A first test:
```
beempy transfer -a holger80 beembot 0.001 HIVE test
```
looks good:
```
{
    "expiration": "2020-06-29T19:56:04",
    "ref_block_num": 28926,
    "ref_block_prefix": 826483934,
    "operations": [
        [
            "transfer",
            {
                "from": "holger80",
                "to": "beembot",
                "amount": "0.001 HIVE",
                "memo": "test"
            }
        ]
    ],
    "extensions": [],
    "signatures": [
        "1f427f44eee5f0abe1602854dc66175922417330bd12ba1cd4653b53a7658e5fff09d41fc49e0079ff084a0b11392cd290a5667cf95795c31f59cc92df1ea6280b"
    ],
    "trx_id": "991b773129b0b04fe56c6b89a6ceb23971d89701"
}
```

Broadcasting a post was not yet possible on https://beta.openhive.network, I will investigate and fix this.



### Tags to replace
The following list shows all parameter that will be replaced:
```
  "STEEM_"                            : "HIVE_",
  "SBD_"                              : "HBD_",
  "steem"                             : "hive",
  "sbd"                               : "hbd",
  "reblogged_on"                      : "reblog_on",
  "sbd_interest_rate"                 : "hbd_interest_rate",
  "percent_steem_dollars"             : "percent_hbd",
  "current_sbd_supply"                : "current_hbd_supply",
  "init_sbd_supply"                   : "init_hbd_supply",
  "sbd_print_rate"                    : "hbd_print_rate",
  "sbd_start_percent"                 : "hbd_start_percent",
  "sbd_stop_percent"                  : "hbd_stop_percent",
  "sbd_volume"                        : "hbd_volume",
  "steem_volume"                      : "hbd_volume",
  "steem_revision"                    : "hive_revision",
  "sbd_exchange_rate"                 : "hbd_exchange_rate",
  "last_sbd_exchange_update"          : "last_hbd_exchange_update",
  "reward_sbd_balance"                : "reward_hbd_balance",
  "reward_steem_balance"              : "reward_hive_balance",
  "reward_vesting_steem"              : "reward_vesting_hive",
  "savings_sbd_balance"               : "savings_hbd_balance",
  "savings_sbd_last_interest_payment" : "savings_hbd_last_interest_payment",
  "savings_sbd_seconds"               : "savings_hbd_seconds",
  "savings_sbd_seconds_last_update"   : "savings_hbd_seconds_last_update",
  "sbd_balance"                       : "hbd_balance",
  "sbd_last_interest_payment"         : "hbd_last_interest_payment",
  "sbd_seconds"                       : "hbd_seconds",
  "sbd_seconds_last_update"           : "hbd_seconds_last_update",
  "pending_rewarded_vesting_steem"    : "pending_rewarded_vesting_hive",
  "total_reward_fund_steem"           : "total_reward_fund_hive",
  "total_vesting_fund_steem"          : "total_vesting_fund_hive",
  "percent_hive_dollars"              : "percent_hbd"
```

## Replace more SP, steem and sbd related functions
I created blockchain independent function at  the BlockchainInstance class, which are then implemented in Hive() and Steem().
The following functions  are now available on Hive() and Steem() objects:

* rshares_to_token_backed_dollar()
* get_token_per_mvest()
* token_power_to_vests()
* token_power_to_token_backed_dollar()
* vests_to_token_power()

E.g. `token_power_to_token_backed_dollar` is using `hp_to_hbd()` on Hive and `sp_to_sbd()` on Steem.

## Preparation for Hivemind API changes
It is now possible to provide account name lists as array or as comma-separated string in follow():

```
from beem.account import Account
acc = Account("holger80")
acc.follow("user_a,user_b")
acc.follow(["user_c","user_d"])
```
As the changes or not live, broadcasting a list is not yet working.

There is already a `get_follow_list()` which can then be used to return `blacklisted`, `follow_blacklist` `muted`, or `follow_muted` lists.
```
from beem.account import Account
acc = Account("holger80")
print(acc.get_follow_list("muted"))
```

You can find more about the upcoming api changes [in this post](/@blocktrades/hivemind-api-being-updated-to-allow-following-mute-lists)

## Support for different chains
I improved the correct identification for other graphene blockchains. Use the Steem() class for connecting to the API node from a Graphene based blockchain.

My focus is on the usage of beem together with Hive, but I'm open to PRs that improve the usage of beem on other chains (as long as they do not impact the usage on Hive).

Example for connecting to a graphene blockchain:
```
from beem import Steem
blt = Steem("https://test.blurt.world/rpc")
print(blt.chain_params)
```
returns
```
{'chain_id': 'afa547e2e0adef898219d7f74abf36e6e957460a70120db21a03fed76cc0e8b6', 'min_version': '0.0.0', 'prefix': 'BLT', 'chain_assets': [{'asset': '@@000000021', 'symbol': 'BLURT', 'precision': 3, 'id': 1}, {'asset': '@@000000037', 'symbol': 'VESTS', 'precision': 6, 'id': 2}]}
```


___

*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)*
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 544 others
👎  
properties (23)
authorholger80
permlinkupdate-for-beem-preperation-for-hf24-eclipse
categoryhive-139531
json_metadata"{"canonical_url": "https://hive.blog/hive-139531/@holger80/update-for-beem-preperation-for-hf24-eclipse", "community": "hive-139531", "app": "beempy/0.24.4", "links": ["https://cdn.steemitimages.com/DQmcRrwLPSywSYMierfP6um6mejeMNGjN9Rxw7audJqTDgb/beem-logo", "https://discord.gg/4HM592V", "https://hivesigner.com/sign/account-witness-vote?witness=holger80&approve=1", "https://github.com/holgern/beem", "https://beta.openhive.network,", "https://beta.openhive.network", "https://test.blurt.world/rpc", "https://peakd.com/witnesses"], "tags": ["development", "beem", "python"]}"
created2020-06-29 22:51:21
last_update2020-06-29 22:51:21
depth0
children13
last_payout2020-07-06 22:51:21
cashout_time1969-12-31 23:59:59
total_payout_value76.479 HBD
curator_payout_value61.289 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length7,456
author_reputation358,857,509,568,825
root_title"update for beem: preperation for HF24 (eclipse)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id98,250,687
net_rshares375,191,347,034,214
author_curate_reward""
vote details (609)
@chitty ·
I have picked your post for my daily hive voting initiative, Keep it up and Hive On!!
properties (22)
authorchitty
permlinkre-update-for-beem-preperation-for-hf24-eclipse-20200630t000549
categoryhive-139531
json_metadata""
created2020-06-30 00:05:51
last_update2020-06-30 00:05:51
depth1
children0
last_payout2020-07-07 00:05:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length86
author_reputation86,901,300,608,582
root_title"update for beem: preperation for HF24 (eclipse)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id98,251,546
net_rshares0
@cloris ·
Hello @ holger80, quite interesting thanks for the links.

Hola @ holger80, bastante interesante gracias por los enlaces.
properties (22)
authorcloris
permlinkqcsyuy
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2020-07-01 17:33:54
last_update2020-07-01 17:33:54
depth1
children0
last_payout2020-07-08 17:33:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length121
author_reputation2,039,725,080,527
root_title"update for beem: preperation for HF24 (eclipse)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id98,284,313
net_rshares0
@elmundodexao ·
<center><sup><h2>Hola @holger80… He elegido tu post para mi iniciativa diaria de reblogear. Este es mi aporte para Hive…
Sigamos trabajando y aportando ideas para crecer en Hive!...
![alegria.jpg](https://images.hive.blog/DQmTpiD9JGb5W2gbBmxeCo1hy4tHcGASgo64MW1NZyV1Wxj/alegria.jpg)
Hello @holger80... I have chosen your post for my daily reblogging initiative. This is my contribution to Hive...
Let's keep working and giving ideas to grow in Hive!</h2></sup></center>
properties (22)
authorelmundodexao
permlinkqcros3
categoryhive-139531
json_metadata{"users":["holger80"],"image":["https://images.hive.blog/DQmTpiD9JGb5W2gbBmxeCo1hy4tHcGASgo64MW1NZyV1Wxj/alegria.jpg"],"app":"hiveblog/0.1"}
created2020-07-01 00:58:39
last_update2020-07-01 00:58:39
depth1
children0
last_payout2020-07-08 00:58:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length469
author_reputation52,508,564,661,796
root_title"update for beem: preperation for HF24 (eclipse)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id98,270,545
net_rshares0
@gitplait-mod1 ·
Another great tutorial on Beem library application for HIVE. Thanks for sharing your publication
<sub> Your post has been submitted to be curated with @gitplait community account because this is the kind of publications we like to see in our community. </sub>

Join our [Community on Hive](https://hive.blog/trending/hive-103590) and Chat with us on [Discord](https://discord.gg/CWCj3rw).

[[Gitplait-Team]](https://gitplait.tech
properties (22)
authorgitplait-mod1
permlinkqcpxkv
categoryhive-139531
json_metadata{"users":["gitplait"],"links":["https://hive.blog/trending/hive-103590","https://discord.gg/CWCj3rw","https://gitplait.tech"],"app":"hiveblog/0.1"}
created2020-06-30 02:58:09
last_update2020-06-30 02:58:09
depth1
children0
last_payout2020-07-07 02:58:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length429
author_reputation64,455,719,431
root_title"update for beem: preperation for HF24 (eclipse)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id98,253,200
net_rshares0
@hivebuzz ·
Congratulations @holger80! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s) :

<table><tr><td><img src="https://images.hive.blog/60x60/http://hivebuzz.me/badges/toppayoutday.png"></td><td>Your post got the highest payout of the day</td></tr>
</table>

<sub>_You can view [your badges on your board](https://hivebuzz.me/@holger80) And compare to others on the [Ranking](https://hivebuzz.me/ranking)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>



###### Support the HiveBuzz project. [Vote](https://hivesigner.com/sign/update_proposal_votes?proposal_ids=%5B%22109%22%5D&approve=true) for [our proposal](https://peakd.com/me/proposals/109)!
properties (22)
authorhivebuzz
permlinkhivebuzz-notify-holger80-20200701t012402000z
categoryhive-139531
json_metadata{"image":["http://hivebuzz.me/notify.t6.png"]}
created2020-07-01 01:24:00
last_update2020-07-01 01:24:00
depth1
children2
last_payout2020-07-08 01:24:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length764
author_reputation370,686,178,038,855
root_title"update for beem: preperation for HF24 (eclipse)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id98,270,813
net_rshares0
@x6oc5 · (edited)
**Cool** !
👍  
properties (23)
authorx6oc5
permlinkre-hivebuzz-hivebuzz-notify-holger80-20200701t135508015z
categoryhive-139531
json_metadata{"community":"waiviodev","app":"waiviodev/1.0.0","format":"markdown","timeOfPostCreation":1593611779159,"tags":["hive-139531"],"users":[],"links":[],"image":[]}
created2020-07-01 13:55:06
last_update2020-07-01 13:56:15
depth2
children1
last_payout2020-07-08 13:55:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length11
author_reputation2,980,501,696,052
root_title"update for beem: preperation for HF24 (eclipse)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id98,280,855
net_rshares3,046,409,376
author_curate_reward""
vote details (1)
@hivebuzz ·
Awesome achievement @x6oc5! I am super jealouse haha! Well done!
cheers to you!
lizanomadsoul<div class="pull-right"><a href="/@hive.engage">![](https://i.imgur.com/XsrNmcl.png)</a></div>
properties (22)
authorhivebuzz
permlinkre-re-hivebuzz-hivebuzz-notify-holger80-20200701t135508015z
categoryhive-139531
json_metadata{"app":"engage"}
created2020-07-06 18:10:39
last_update2020-07-06 18:10:39
depth3
children0
last_payout2020-07-13 18:10:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length187
author_reputation370,686,178,038,855
root_title"update for beem: preperation for HF24 (eclipse)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id98,376,607
net_rshares0
@jexus77 ·
Excelente trabajo, espero todo se actualice sin mayores inconvenientes…
properties (22)
authorjexus77
permlinkqcufpv
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2020-07-02 12:35:42
last_update2020-07-02 12:35:42
depth1
children0
last_payout2020-07-09 12:35:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length71
author_reputation4,068,736,270,980
root_title"update for beem: preperation for HF24 (eclipse)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id98,299,082
net_rshares0
@maxuvv ·
Hi @holger80, you have received a small bonus upvote from MAXUV.
This is to inform you that you now have [new MPATH tokens](https://hive-engine.com/?p=market&t=MPATH) in your Hive-Engine wallet.
Please [read this post](https://peakd.com/hive-167922/@mpath/mpath-weekly-report-and-token-distribution-26-april-2020) for more information.
Thanks for being a member of both MAXUV *and* MPATH!
properties (22)
authormaxuvv
permlinkre-update-for-beem-preperation-for-hf24-eclipse-20200629t225331z
categoryhive-139531
json_metadata"{"app": "rewarding/0.1.0"}"
created2020-06-29 22:53:30
last_update2020-06-29 22:53:30
depth1
children0
last_payout2020-07-06 22:53:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length393
author_reputation32,074,948,443
root_title"update for beem: preperation for HF24 (eclipse)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id98,250,713
net_rshares0
@sc-steemit ·
Thanks for including Smoke.io as one of the auto detected chains. 👍
properties (22)
authorsc-steemit
permlinkre-holger80-qcs3m4
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2020.06.2"}
created2020-07-01 07:03:39
last_update2020-07-01 07:03:39
depth1
children0
last_payout2020-07-08 07:03:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length67
author_reputation28,448,644,499,713
root_title"update for beem: preperation for HF24 (eclipse)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id98,275,669
net_rshares0
@simplegame ·
I find the addition of other chains interesting.
properties (22)
authorsimplegame
permlinkre-holger80-qcpyov
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2020.06.2"}
created2020-06-30 03:22:06
last_update2020-06-30 03:22:06
depth1
children1
last_payout2020-07-07 03:22:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length48
author_reputation132,735,509,659,408
root_title"update for beem: preperation for HF24 (eclipse)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id98,253,475
net_rshares0
@jeffrey345s ·
I am now making more than 355 dollars per day by working online from home without investing any money. Join this link posting job now and start earning without investing or selling anything.
Follow Instructions Here.............. http://jobnews3.com
👍  
👎  , , , ,
properties (23)
authorjeffrey345s
permlinkqcq9ak
categoryhive-139531
json_metadata{"links":["http://jobnews3.com"],"app":"hiveblog/0.1"}
created2020-06-30 07:09:57
last_update2020-06-30 07:09:57
depth2
children0
last_payout2020-07-07 07:09:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length249
author_reputation-57,658,897,896
root_title"update for beem: preperation for HF24 (eclipse)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id98,255,971
net_rshares-1,466,049,599,016
author_curate_reward""
vote details (6)
@tazi ·
Great work!!!
Thanks.
properties (22)
authortazi
permlinkre-holger80-202071t193051486z
categoryhive-139531
json_metadata{"tags":["development","beem","python"],"app":"esteem/2.2.5-mobile","format":"markdown+html","community":"hive-125125"}
created2020-07-01 17:30:51
last_update2020-07-01 17:30:51
depth1
children0
last_payout2020-07-08 17:30:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length21
author_reputation80,165,082,529,896
root_title"update for beem: preperation for HF24 (eclipse)"
beneficiaries
0.
accountesteemapp
weight300
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id98,284,286
net_rshares0