create account

Updating your witness with Python by furion

View this thread on: hive.blogpeakd.comecency.com
· @furion · (edited)
$46.95
Updating your witness with Python
![](http://i.imgur.com/jVLWgAY.png)

It is now trivially easy to update your witness with a few lines Python:
```
from steemtools.experimental import Transactions

t = Transactions()
props = {
    "account_creation_fee": "15.000 STEEM",
    "maximum_block_size": 65536,
    "sbd_interest_rate": 500,
}
tx = t.witness_update("furion", "<PUBLIC_POSTING_KEY>", "https://steemdb.com/@furion/witness", props, "<PRIVATE_ACTIVE_KEY>", sim_mode=False)
pprint(tx)
```

**Outputs:**
```
{'expiration': '2016-09-21T19:50:27',
 'extensions': [],
 'operations': [['witness_update',
                 {'block_signing_key': 'STM7WDG2QpThdkRa3G2PYXM7gH9UksoGm4xqoFBrNet6GH7ToNUYx',
                  'fee': '0.000 STEEM',
                  'owner': 'furion',
                  'props': {'account_creation_fee': '15.000 STEEM',
                            'maximum_block_size': 65536,
                            'sbd_interest_rate': 500},
                  'url': 'https://steemdb.com/@furion/witness'}]],
 'ref_block_num': 59959,
 'ref_block_prefix': 4091806926,
 'signatures': ['205afd9f3ac04...1bb0459320894e']}
```

![](http://i.imgur.com/QT6T4PD.png)

**Why would you want to update your witness programmatically?**
1.) If you would like to stop minting blocks while your witness is offline, or being upgraded, then you should update your witness with an empty signing key `""` to avoid missing blocks.

2.) If you would like to do an automated failover to another server, you should change your signing key to avoid forking (very bad).

3.) Because its easier and more fun than cli_wallet.

**Source**
[> steemtools on GitHub](https://github.com/Netherdrake/steemtools)

Big thanks to @jesta for the challenge. 

-------------------

<center>[![](http://i.imgur.com/5MaAhy7.png)](https://steemit.com/@furion)
Don't miss out on the next post - follow me.
[steemtools](https://github.com/Netherdrake/steemtools) | [steem.li](https://steem.li)  | [witness](https://steemdb.com/@furion/witness)
</center>

-------------------
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 96 others
properties (23)
authorfurion
permlinkupdating-you-witness-with-python
categorywitness-category
json_metadata{"tags":["witness-category","steemtools"],"users":["jesta"],"image":["http://i.imgur.com/jVLWgAY.png","http://i.imgur.com/QT6T4PD.png","http://i.imgur.com/5MaAhy7.png"],"links":["https://github.com/Netherdrake/steemtools","https://steemit.com/@furion","https://steem.li","https://steemdb.com/@furion/witness"]}
created2016-09-21 20:01:18
last_update2016-09-21 20:04:27
depth0
children4
last_payout2016-10-22 20:35:24
cashout_time1969-12-31 23:59:59
total_payout_value44.035 HBD
curator_payout_value2.916 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,010
author_reputation116,503,940,714,958
root_title"Updating your witness with Python"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,320,399
net_rshares31,923,236,014,489
author_curate_reward""
vote details (160)
@aizensou ·
It is actually always easier with the cli_wallet, assuming u know what to do. :D
properties (22)
authoraizensou
permlinkre-furion-updating-you-witness-with-python-20160921t201319900z
categorywitness-category
json_metadata{"tags":["witness-category"]}
created2016-09-21 20:13:18
last_update2016-09-21 20:13:18
depth1
children2
last_payout2016-10-22 20:35:24
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_length80
author_reputation31,620,973,634,639
root_title"Updating your witness with Python"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,320,496
net_rshares0
@furion ·
Perhaps I should elaborate what I meant by easier. With a Python script, you can re-run it at anytime, as well as have it be part of the automated system. To be fair, you could also do this with the wallet RPC, so now that I think of it, its not a super valid point anymore :) The more fun part subjectively still stands :)
properties (22)
authorfurion
permlinkre-aizensou-re-furion-updating-you-witness-with-python-20160921t203319029z
categorywitness-category
json_metadata{"tags":["witness-category"]}
created2016-09-21 20:33:18
last_update2016-09-21 20:33:18
depth2
children0
last_payout2016-10-22 20:35:24
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_length323
author_reputation116,503,940,714,958
root_title"Updating your witness with Python"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,320,643
net_rshares0
@jesta ·
$0.03
But you can't automate failover as securely with the cli_wallet ;)
👍  , ,
properties (23)
authorjesta
permlinkre-aizensou-re-furion-updating-you-witness-with-python-20160921t202134687z
categorywitness-category
json_metadata{"tags":["witness-category"]}
created2016-09-21 20:21:33
last_update2016-09-21 20:21:33
depth2
children0
last_payout2016-10-22 20:35:24
cashout_time1969-12-31 23:59:59
total_payout_value0.026 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length66
author_reputation140,605,453,893,072
root_title"Updating your witness with Python"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,320,576
net_rshares159,346,256,360
author_curate_reward""
vote details (3)
@jesta ·
$0.03
So awesome, thank you for toiling away on this. I've been fighting with the same issues you initially encountered while I've been experimenting with this. Big kudos to putting your effort into it and getting it done. 

I'll be using this for my witness nodes now to assist in automatic failover!
👍  , ,
properties (23)
authorjesta
permlinkre-furion-updating-you-witness-with-python-20160921t202249233z
categorywitness-category
json_metadata{"tags":["witness-category"]}
created2016-09-21 20:22:48
last_update2016-09-21 20:22:48
depth1
children0
last_payout2016-10-22 20:35:24
cashout_time1969-12-31 23:59:59
total_payout_value0.027 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length295
author_reputation140,605,453,893,072
root_title"Updating your witness with Python"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,320,580
net_rshares161,393,610,298
author_curate_reward""
vote details (3)