Skip to content

Instantly share code, notes, and snippets.

@danielporto
Created August 13, 2020 16:38
Show Gist options
  • Save danielporto/fa751761afafe9329b668667d16c7466 to your computer and use it in GitHub Desktop.
Save danielporto/fa751761afafe9329b668667d16c7466 to your computer and use it in GitHub Desktop.
Running caliper benchmark
#preparations:
#install asdf (https://asdf-vm.com/)
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.7.8
#enable asdf:
echo ". $HOME/.asdf/asdf.sh" >> ~/.profile
#install nodejs plugin for asdf:
asdf plugin list all
asdf plugin add nodejs
#import the nodejs release team open pgp keys:
bash -c '${ASDF_DATA_DIR:=$HOME/.asdf}/plugins/nodejs/bin/import-release-team-keyring'
#install the nodejs version to match the same version of node used in fabric
asdf install nodejs 8.9.4
# start by configuring the benchmark using the examples from aother repository
git clone https://github.com/hyperledger/caliper-benchmarks.git
cd caliper-benchmarks
# ASSUMING PREPARATIONS ARE DONE and next commands are run from the checkout folder:
# user@ubuntu:~/caliper-benchmarks$
git checkout v0.3.2
#if you did not set the nodejs asdf plugin, do it now:
asdf local nodejs 8.9.4
npm init -y
npm install --only=prod @hyperledger/caliper-cli@0.3.2
# at this point, the command npx should be available.
#Before running the benchmark prepare the crypto configuration as in https://github.com/hyperledger/caliper-benchmarks
cd networks/fabric/config_solo
./generate.sh
# BUGFIX - download the corresponding CCENV and re-tag
docker pull hyperledger/fabric-ccenv:1.4.1
docker image tag d7433c4b2a1c hyperledger/fabric-ccenv:latest
# next, go back to the caliper-benchmarks (ex user@ubuntu:~/caliper-benchmarks) dir and run
npx caliper bind --caliper-bind-sut fabric:1.4.1
# finally from caliper-benchmarks (ex user@ubuntu:~/caliper-benchmarks) dir, run caliper
npx caliper launch master \
--caliper-workspace . \
--caliper-benchconfig benchmarks/scenario/simple/config.yaml \
--caliper-networkconfig networks/fabric/v1/v1.4.1/2org1peergoleveldb/fabric-go.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment