Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Blockchain by (12.7k points)

When trying to use https://github.com/web3j/sample-project-gradle I encounter this code:

 // We then need to load our Ethereum wallet file

    // FIXME: Generate a new wallet file using the web3j command line tools https://docs.web3j.io/command_line.html

    Credentials credentials =

            WalletUtils.loadCredentials(

                    "<password>",

                    "/path/to/<walletfile>");

    log.info("Credentials loaded");

I wanted to use a network created by ganache-cli. I did successfully connect to the network but I can't find the wallet files. Is there a way to use here accounts generated by ganache-cli?

1 Answer

0 votes
by (29.5k points)
edited by

ganache-cli is a personal blockchain. It does not create wallet file, rather provides private key to load credentials.

Credentials credentials = Credentials.create("0x78c0cf2c035dda3c46953fb7b926f8ece0aa8bfed6c012e33d5e289e6e0c1ebc");

Want to make a career in Blockchain? Then enroll now in Blockchain Training by Intellipaat to get the perfect guidance.

Browse Categories

...