Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Support Channel-Specific Chaincode Directories to Prevent Duplicate Docker Mounts #457

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions fablo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,21 @@ executeOnFabloDocker() {

fablo_config="$(cd "$(dirname "$fablo_config")" && pwd)/$(basename "$fablo_config")"
local chaincodes_base_dir="$(dirname "$fablo_config")"

# Extract chaincodes information from the config file
local chaincodes=$(jq -r '.chaincodes[] | "\(.channel)/\(.name)"' "$fablo_config")

fablo_config_params=(
-v "$fablo_config":/network/fablo-config.json
--env "FABLO_CONFIG=$fablo_config"
--env "CHAINCODES_BASE_DIR=$chaincodes_base_dir"
)

# Create volume mounts for each chaincode based on channel-name/chaincode-name
for chaincode in $chaincodes; do
local chaincode_dir="$chaincodes_base_dir/chaincodes/$chaincode"
fablo_config_params+=(-v "$chaincode_dir":"/opt/gopath/src/github.com/chaincode/$chaincode")
done
fi

docker run -i --rm \
Expand All @@ -150,6 +160,7 @@ executeOnFabloDocker() {
2>&1
}


useVersion() {
printSplash
local version="$1"
Expand Down
Loading