hyperledger-archives / caliper

A blockchain benchmark framework to measure performance of multiple blockchain solutions
Apache License 2.0
74 stars 24 forks source link

Make GOPATH configurable in a backward compatible way #58

Closed aklenik closed 6 years ago

aklenik commented 6 years ago

Currently, Caliper temporarily sets GOPATH to the Caliper root directory during benchmark execution. This makes it impossible to install Golang chaincodes from outside the caliper/src directory structure.

However, this would be desirable when, for example, we want to store our chaincodes for benchmarking in a different repository, outside of Caliper (and do not want to copy them to caliper/src before benchmarking).

Related issue: #53

To fix this issue, I added the option to leave GOPATH unchanged if the user sets the OVERWRITE_GOPATHenvironment variable to FALSE. If this environment variable is undefined or explicitly set to TRUE, then Caliper will use its root directory as GOPATH for backward compatibility reason.

This behaviour is also documented in the Fabric configuration document.

haojun commented 6 years ago

That's reasonable, thanks for your contribution!