在 Caliper 中执行不同合约的方法
在 Caliper 中执行不同的智能合约需要通过正确配置工作负载(workload)和测试轮次(rounds),下面我将详细介绍如何执行不同的合约。
1. 通过 config.yaml 配置不同测试轮次
你可以在 config.yaml
中为不同的合约定义不同的测试轮次:
rounds:- label: test-helloworlddescription: "测试 HelloWorld 合约"txNumber: 1000rateControl:type: fixed-rateopts:tps: 50workload:module: "benchmarks/helloworld/workload.js"arguments:contractId: "helloworld" # 对应fisco-bcos.json中的合约IDfunction: "set" # 要调用的合约函数- label: test-parallelokdescription: "测试 ParallelOk 合约"txNumber: 2000rateControl:type: fixed-rateopts:tps: 100workload:module: "benchmarks/parallelok/workl