[英]how to Import private key into geth ethereum using web3 client
I would like to import as well as delete the private key from go-ethereum ( geth
), using the web3.py client. 我想使用web3.py客户端从go-ethereum(
geth
)导入以及删除私钥。 Can you please suggest the appropriate functions? 您能否建议适当的功能? I have already generated the private key.
我已经生成了私钥。
Thanks, Raja K 谢谢,Raja K
The web3.py docs on using private keys has this example: 有关使用私钥的web3.py文档包含以下示例:
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
The process to "import as well as delete the private key from geth" is: “从geth导入和删除私钥”的过程是:
keystore
folder in the geth data directory keystore
文件夹 w3.eth.account.decrypt(...)
w3.eth.account.decrypt(...)
在本地解密
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.