Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Blockchain by (4.1k 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.4k 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.7k points)
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...