Skip to content

Instantly share code, notes, and snippets.

@emre
Created September 18, 2018 07:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emre/318391ac7fde62e1eda2a5bff3c6cf01 to your computer and use it in GitHub Desktop.
Save emre/318391ac7fde62e1eda2a5bff3c6cf01 to your computer and use it in GitHub Desktop.
Witness enable/disable via Lightsteem
import argparse
import os
from lightsteem.client import Client
from lightsteem.datastructures import Operation
ACCOUNT = "emrebeyler"
WITNESS_URL = "https://steemit.com/@emrebeyler"
PROPS = {
"account_creation_fee": "0.100 STEEM",
"maximum_block_size": 65536,
"sbd_interest_rate": 0,
}
SIGNING_KEY = "STM5ShFW6UPxDRyjG4mVWYiwVWTzkmfL2k7zYoamWz2yJLpEkycju"
def broadcast_update(signing_key):
client = Client(keys=[os.getenv("ACTIVE_KEY")])
op = Operation('witness_update', {
"owner": ACCOUNT,
"url": WITNESS_URL,
"props": PROPS,
"block_signing_key": signing_key,
})
client.broadcast(op)
def disable():
return broadcast_update(
"STM1111111111111111111111111111111114T1Anm",
)
def enable():
return broadcast_update(SIGNING_KEY)
def main():
parser = argparse.ArgumentParser(description='Witness Enable/Disable')
parser.add_argument('action', metavar='A', type=str,
help='action (enable or disable)')
args = parser.parse_args()
if args.action == "disable":
return disable()
elif args.action == "enable":
return enable()
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment