Created
August 8, 2018 09:38
-
-
Save MaHu6/c183aedd5b1de9697eaaab644129949b to your computer and use it in GitHub Desktop.
according privatekey export keystore
This file contains hidden or 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
# pip3 install web3 | |
from web3 import Web3 | |
import json | |
# network = "https://ropsten.infura.io/your_key" | |
network = "http://127.0.0.1:8545" | |
web3 = Web3(Web3.HTTPProvider(network)) | |
private_key = "55dcb09dc6afc5c34ec6b4879ede6c08b20bcf129d4fc158b820983c369d3536" | |
passwd = "" | |
try: | |
keystore = web3.eth.account.encrypt(private_key, passwd) | |
print(json.dumps(keystore)) | |
except Exception as e: | |
print(e) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment