0

I am using hyperledger-caliper for the benchmarking of my private ethereum network. I followed their official source for the setting it up and get into work with ethereum. But I'm getting error shown here:

Error: You must provide the json interface of the contract when instantiating a contract object.

Here is the networkconfig.json file

    {
    "caliper": {
        "blockchain": "ethereum",
        "command" : {}
    },
    "ethereum": {
        "url": "ws://localhost:7545",
        "contractDeployerAddress": "0x5B14D7452573edB2ABe4941286618Fc09F1Ae085",
        "contractDeployerAddressPassword": "a0969bdb33adfb905d0d94cf4d6b1f63ebee447a17b80972f16e178bd0b219df",
        "fromAddress": "0x5B14D7452573edB2ABe4941286618Fc09F1Ae085",
        "fromAddressPassword": "a0969bdb33adfb905d0d94cf4d6b1f63ebee447a17b80972f16e178bd0b219df",
        "transactionConfirmationBlocks": 2,
        "contracts": {
            "simple": {
                "path": "/home/madddii/Documents/caliper-benchmarks/src/ethereum/simple/simple.json",
                "estimateGas": true,
                "gas": {
                    "query": 100000,
                    "transfer": 70000
                }
            }
        }
    }
}

The command which I am using for running it up is:

caliper launch manager --caliper-workspace . --caliper-networkconfig ./networks/ethereum/1node-clique/networkconfig.json --caliper-benchconfig benchmarks/scenario/simple/config.yaml --caliper-flow-only-test --caliper-fabric-gateway-enabled -v

Can you please help me out in figuring the solution of this problem.

2

1 Answer 1

0

I've faced the same issue in caliper 0.4.2, it seems that documentation is not updated accordingly. I dig a bit into the code and found that an invalid reference is used. To resolve your issue just add ABI and deployed ADDRESS of the contract to the network configuration file.

{
    "caliper": {
        "blockchain": "ethereum",
        "command" : {}
    },
    "ethereum": {
        "url": "ws://localhost:7545",
        "contractDeployerAddress": "0x5B14D7452573edB2ABe4941286618Fc09F1Ae085",
        "contractDeployerAddressPassword": "a0969bdb33adfb905d0d94cf4d6b1f63ebee447a17b...",
        "fromAddress": "0x5B14D7452573edB2ABe4941286618Fc09F1Ae085",
        "fromAddressPassword": "a0969bdb33adfb905d0d94cf4d6b1f63ebee447a17b...",
        "transactionConfirmationBlocks": 2,
        "contracts": {
            "simple": {
                "path": "/home/madddii/Documents/caliper-benchmarks/src/ethereum/simple/simple.json",
                "estimateGas": true,
                "gas": {
                    "query": 100000,
                    "transfer": 70000
                },
                "abi": [{ < here comes your abi > }],
                "address": "< here comes your contract address with 0x>"
            }
        }
    }
}

I hope this helps, it worked for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.