我想使用web3.py客户端从go-ethereum(geth
)导入和删除私钥。您能否建议适当的功能?我已经生成了私钥。
谢谢, 拉贾K
答案 0 :(得分:0)
web3.py docs on using private keys的示例:
with open('~/.ethereum/keystore/UTC--...--5ce9454909639D2D17A3F753ce7d93fa0b9aB12E') as keyfile: encrypted_key = keyfile.read() private_key = w3.eth.account.decrypt(encrypted_key, 'correcthorsebatterystaple') # tip: do not save the key or password anywhere, especially into a shared source file
“从geth导入和删除私钥”的过程是:
keystore
文件夹中查找w3.eth.account.decrypt(...)
在本地解密