3

I am using the readme guide https://github.com/web3j/web3j. What I am interested is developing smart contracts from my host with java + web3j to private ethereum network which runs on my virtual machine. There are such lines:

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

So the question is - how should I create this wallet? Should I generate account on my VM and then copy wallet.json file to my host?

1

The wallet file is your encrypted private key file. you have the choice to :

1-use the private key file from the web3js or ethereum keystore.

AppData/Ethereum/keystore (geth)
AppData/Web3/keys (eth)

you will find something like :

Ethereum\keystore\UTC--2017-1-20T11-51-50.069518500Z--637f383c240g512be19d3ffa3b45d7f03babf091

use it a second parameter in WalletUtils.loadCredentials

2- creating the wallet fine using web3j

String fileName = WalletUtils.generateNewWalletFile(
        "your password",
        new File("/path/to/destination"));

3-use Myetherwallet to export your 'wallet' as a json file.

0

you can create it using https://www.myetherwallet.com/ and then add staticly you account address in the genesis file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.