Blockchain 在web3j中使用ganache帐户

Blockchain 在web3j中使用ganache帐户,blockchain,ethereum,truffle,web3-java,Blockchain,Ethereum,Truffle,Web3 Java,尝试使用时,我遇到以下代码: // 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.loadCredenti

尝试使用时,我遇到以下代码:

    // 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");
//然后我们需要加载以太坊钱包文件
//FIXME:使用web3j命令行工具生成新的钱包文件https://docs.web3j.io/command_line.html
证书=
WalletUtils.loadCredentials(
"",
“/path/to/”;
log.info(“已加载凭据”);

我想使用由ganachecli创建的网络。我确实成功连接到网络,但找不到钱包文件。有没有办法在这里使用ganache cli生成的帐户?

ganache cli是一个个人区块链。它不创建钱包文件,而是提供私钥来加载凭据

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

是的,在多学了一点之后,我明白了其中的区别。谢谢你的帮助!