Created
March 2, 2018 07:05
-
-
Save emre/1b1d819f8a369fc3b48893432813f207 to your computer and use it in GitHub Desktop.
account_creator.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from steem import Steem | |
from steembase.account import PasswordKey | |
def create_account(steemd_instance, new_account, new_account_master_key, creator): | |
steemd_instance.create_account( | |
new_account, | |
delegation_fee_steem="1 STEEM", | |
password=new_account_master_key, | |
creator=creator, | |
) | |
keys = {} | |
for key_type in ['posting','active','owner','memo']: | |
private_key = PasswordKey( | |
new_account, new_account_master_key, key_type).get_private_key() | |
keys[key_type] = { | |
"public": str(private_key.pubkey), | |
"private": str(private_key), | |
} | |
return keys | |
if __name__ == '__main__': | |
s = Steem(nodes=["https://api.steemit.com"], | |
keys=["creator_account_active_wif"]) | |
keys = create_account( | |
s, | |
"new_account_username", | |
"new_account_master_key", | |
"creator_account_username" | |
) | |
for key, subkeys in keys.items(): | |
print("Key Type: %s" % key) | |
print("Public: %s\nPrivate: %s\n--" % ( | |
subkeys["public"], subkeys["private"])) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment