简体   繁体   English

如何在 Web3j 中的 infura 上使用凭证钱包路径和元掩码帐户

[英]how to use Credential wallet path with metamask account on infura in Web3j

Web3j web3 = Web3j.build(new HttpService()); Web3j web3 = Web3j.build(new HttpService()); // defaults to http://localhost:8545/ Credentials credentials = WalletUtils.loadCredentials("password", "/path/to/walletfile"); // 默认为http://localhost:8545/ Credentials credentials = WalletUtils.loadCredentials("password", "/path/to/walletfile");

  1. How to connect rinkeby network using Web3j.如何使用 Web3j 连接 rinkeby 网络。

  2. I try to change "/path/to/walletfile" by a private key of metamask account.我尝试通过元掩码帐户的私钥更改"/path/to/walletfile" Without success.没有成功。

How can I make it works?我怎样才能让它工作? Thx.谢谢。

An easy way to do this is using your private key.一个简单的方法是使用您的私钥。 In metamask click "account details" and "export private key".在元掩码中单击“帐户详细信息”和“导出私钥”。

Then use Credentials.create("YourPrivateKey")然后使用Credentials.create("YourPrivateKey")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM