1

I am using the following code to deploy my contract:

@RequestMapping("/")
public String index() throws Exception {
    Web3j web3j = Web3j.build(new HttpService("https://rinkeby.infura.io/v3/2a42af3ce74e407cae9e20a7e7001ddb"));

    String walletId = "97a0987c270cd6cfa77972b83026eb56524857c5";
    String walletSource = "~/testnet-keystore/UTC--2018-09-26T00-58-36.238000000Z--" + walletId + ".json";
    Credentials credentials = WalletUtils.loadCredentials("admin1234", walletSource);

    ProofOfExistence contract = ProofOfExistence.deploy(web3j, credentials, Contract.GAS_PRICE, Contract.GAS_LIMIT).send();;
       String contractAddress = contract.getContractAddress();
       return "Contract is deployed at address: " + contractAddress;
}

But i am getting this error: "java.io.FileNotFoundException: ~/testnet-keystore/UTC--2018-09-26T00-58-36.238000000Z--97a0987c270cd6cfa77972b83026eb56524857c5.json"

Can anyone tell me what am i doing wrong??

0

Found the solution: I had to add json file in my resource folder of spring boot application.

|improve this answer|||||

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.