hyperledger/caliper-benchmarks

Configure Problem

JhinQaQ opened this issue · 3 comments

what should I configure here when using Ethereum?

--caliper-workspace
--caliper-benchconfig
--caliper-networkconfig

Error: Benchmark configuration file path is not set
I always get this error.
Thanks

It looks as though the ethereum setup in caliper-benchmarks is broken. The setup of the docker image is broken and the following changes need to be made

File: networks/ethereum/1node-clique/caliper-ethereum-clique.Dockerfile
change

FROM ethereum/client-go:stable

to

FROM ethereum/client-go:v1.10.12

File: networks/ethereum/1node-clique/docker-compose.yml
delete the command: line and replace with

    command:
      - --unlock=0xc0A8e4D217eB85b812aeb1226fAb6F588943C2C2
      - --password=/root/.ethereum/keystore/password
      - --mine
      - --miner.threads=2
      - --miner.etherbase=0xc0A8e4D217eB85b812aeb1226fAb6F588943C2C2
      - --miner.gasprice=1
      - --ws
      - --ws.addr=0.0.0.0
      - --ws.origins='*'
      - --ws.api=admin,eth,miner,personal,web3
      - --allow-insecure-unlock
      - --nodiscover

file: networks/ethereum/1node-clique/networkconfig.json
I removed some stuff so it now looks like

{
    "caliper": {
        "blockchain": "ethereum",
        "command" : {
            "start": "docker-compose -f ./networks/ethereum/1node-clique/docker-compose.yml up -d && sleep 10s",
            "end" : "docker-compose -f ./networks/ethereum/1node-clique/docker-compose.yml down"
          }
    },
    "ethereum": {
        "url": "ws://localhost:8546",
        "contractDeployerAddress": "0xc0A8e4D217eB85b812aeb1226fAb6F588943C2C2",
        "contractDeployerAddressPassword": "password",
        "fromAddress": "0xc0A8e4D217eB85b812aeb1226fAb6F588943C2C2",
        "fromAddressPassword": "password",
        "transactionConfirmationBlocks": 2,
        "contracts": {
            "simple": {
                "path": "src/ethereum/simple/simple.json"
            }
        }
    }
}

To run is also not trivial and I get unexpected errors unless I perform the steps exactly, so in your caliper-benchmarks directory

  • npm install --only=prod @hyperledger/caliper-cli
  • npx caliper bind --caliper-bind-sut ethereum
  • npx caliper launch manager --caliper-workspace ./ --caliper-networkconfig networks/ethereum/1node-clique/networkconfig.json --caliper-benchconfig benchmarks/scenario/simple/config.yaml --caliper-flow-only-start
  • npx caliper launch manager --caliper-workspace ./ --caliper-networkconfig networks/ethereum/1node-clique/networkconfig.json --caliper-benchconfig benchmarks/scenario/simple/config.yaml --caliper-flow-skip-start --caliper-flow-skip-end

And then to bring down the docker container

  • npx caliper launch manager --caliper-workspace ./ --caliper-networkconfig networks/ethereum/1node-clique/networkconfig.json --caliper-benchconfig benchmarks/scenario/simple/config.yaml --caliper-flow-only-end

It works. Thank u!

Screenshot from 2022-08-30 17-00-59
Hi I switched to Linux and followed exactly the steps you have mentioned but I am getting this error from the launch maanger.js