2

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

  1. How to connect rinkeby network using Web3j.

  2. I try to change "/path/to/walletfile" by a private key of metamask account. Without success.

How can I make it works? Thx.

Antony Denyer
  • 1,541
  • 1
  • 15
  • 31

1 Answers1

3

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")

Antony Denyer
  • 1,541
  • 1
  • 15
  • 31