hyperledger / caliper

A blockchain benchmark framework to measure performance of multiple blockchain solutions https://wiki.hyperledger.org/display/caliper
https://hyperledger.github.io/caliper/
Apache License 2.0
651 stars 404 forks source link

Adding option to specify constructor arguments for contract deployment on Ethereum Connector #1581

Open rmarede opened 4 months ago

rmarede commented 4 months ago

Please share the technical limitation of Caliper that you encountered.

I am no expert here but from what I see it seams that there's no option to specify constructor arguments for the contracts to be deployed by the Ethereum Connector. I don't understand why this is not a thing.

Please detail your feature idea that could alleviate the limitation.

Allow specification of an 'arguments' key to the Contract Definition JSON file, and use it on contract deployment on the Ethereum Connector.

Please share some details about your use case if possible, and how the new feature would make Caliper a better performance benchmarking framework.

No response

Please share any suggestions about the new feature's code/configuration API (using formatted YAML segments or pseudo-code).

async deployContract(contractData) {
        const web3 = this.web3;
        const contractDeployerAddress = this.ethereumConfig.contractDeployerAddress;
        const contract = new web3.eth.Contract(contractData.abi);
        const contractDeploy = contract.deploy({
            data: contractData.bytecode,
            arguments: contractData.arguments
        });

        try {
            return contractDeploy.send({
                from: contractDeployerAddress,
                gas: contractData.gas
            });
        } catch (err) {
            throw(err);
        }
    }
davidkel commented 4 months ago

See #1586 which proposes the removal of the ability for caliper to install smart contracts.