0 votes
1 view
in Blockchain by (7k points)

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.jsonfile to my host?

1 Answer

0 votes
by (14.5k points)

WalletUtils.loadCredentials is resplendent with bugs. Therefore, my recommendation would be to create accounts beforehand. After that, you can extract the private key and use the following line of code: 

Credentials.create(privateKey)

For viewing your private key, you can use the key store file and then use myetherwallet.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Jul 17, 2019 in Blockchain by Abhishek_31 (12.1k points)
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...