我正在使用自述式指南https://github.com/web3j/web3j。我感兴趣的是用java + web3j从我的主机开发智能合同到运行在我的虚拟机上的私有ethereum网络。有这样的路线:
Web3j web3 = Web3j.build(new HttpService()); // defaults to http://localhost:8545/
Credentials credentials = WalletUtils.loadCredentials("password", "/path/to/walletfile");
所以问题是-我该怎么做这个钱包?我应该在VM上生成帐户,然后将wallet.json文件复制到主机上吗?
发布于 2017-06-22 09:17:18
钱包文件是加密的私钥文件。你可以选择:
1-使用来自web3js或的私钥文件。
AppData/Ethereum/keystore (geth)
AppData/Web3/keys (eth)
你会发现这样的情况:
Ethereum\keystore\UTC--2017-1-20T11-51-50.069518500Z--637f383c240g512be19d3ffa3b45d7f03babf091
在WalletUtils.loadCredentials
中使用它的第二个参数
2-使用web3j创建钱包。
String fileName = WalletUtils.generateNewWalletFile(
"your password",
new File("/path/to/destination"));
3-使用Myether钱包作为json文件导出您的“钱包”。
发布于 2017-06-21 14:19:37
您可以使用https://www.myetherwallet.com/创建它,然后在成因文件中添加静态帐户地址。
https://ethereum.stackexchange.com/questions/16905
复制相似问题