export keys from local beempy Wallet

avatar
(Edited)

Since entering the Internet era, there are so many keys in our life that we can't avoid forgetting. I forgot my password (key file lost) recently.

How to do it?

If we happen to use the beempy command-line tool of steem's Python and import the key into the local beempy wallet, then now we can export all the keys in the wallet for backup.

python.jpeg
Demo for export all keys in beempy wallet (get_private_keys_in_wallet_beem.py):


#!/usr/bin/env python
# -*- coding: UTF-8 -*-

# Export all keys in the local Wallet
# python get_private_keys_in_wallet_beem.py

import sys
import json
from beem import Steem
from beem.instance import shared_steem_instance

# Enter the local wallet password or set value directly in the code
# password = "walletkey"
password = input('local wallet password : ')

stm = shared_steem_instance()
stm.wallet.unlock(password)
accounts = stm.wallet.getAccounts()
account_list = []
for account in accounts:
    if account["name"] not in account_list:
        account_list.append(account["name"])
print("account_list:", account_list)

for account in account_list:
    private_key = {}
    for role in ["owner", "active", "posting", "memo"]:
        try:
            private_key[role] = stm.wallet.getKeyForAccount(account, role)
        except Exception as e:
            print('no', role, ' key in local wallet for', account)

    print(account, ' private_key:', json.dumps(private_key, indent=4))

Run it:python get_private_keys_in_wallet_beem
Results consistent with expectations.

中文版:《从本地beempy钱包提取密码》



0
0
0.000
1 comments
avatar

According to the Bible, Charity Means Love (4 of 5)

(Sorry for sending this comment. We are not looking for our self profit, our intentions is to preach the words of God in any means possible.)


Comment what you understand of our Youtube Video to receive our full votes. We have 30,000 #SteemPower. It's our little way to Thank you, our beloved friend.
Check our Discord Chat
Join our Official Community: https://beta.steemit.com/trending/hive-182074

0
0
0.000