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

test-network error message if jq not installed #1200

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion test-network/scripts/configUpdate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ fetchChannelConfig() {
set -x
configtxlator proto_decode --input ${TEST_NETWORK_HOME}/channel-artifacts/config_block.pb --type common.Block --output ${TEST_NETWORK_HOME}/channel-artifacts/config_block.json
jq .data.data[0].payload.data.config ${TEST_NETWORK_HOME}/channel-artifacts/config_block.json >"${OUTPUT}"
res=$?
{ set +x; } 2>/dev/null
verifyResult $res "Failed to parse channel configuration, make sure you have jq installed"
}

# createConfigUpdate <channel_id> <original_config.json> <modified_config.json> <output.pb>
# Takes an original and modified config, and produces the config update tx
# which transitions between the two
# NOTE: this requires configtxlator for execution.
# NOTE: this requires jq and configtxlator for execution.
createConfigUpdate() {
CHANNEL=$1
ORIGINAL=$2
Expand Down
3 changes: 3 additions & 0 deletions test-network/scripts/setAnchorPeer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ createAnchorPeerUpdate() {
set -x
# Modify the configuration to append the anchor peer
jq '.channel_group.groups.Application.groups.'${CORE_PEER_LOCALMSPID}'.values += {"AnchorPeers":{"mod_policy": "Admins","value":{"anchor_peers": [{"host": "'$HOST'","port": '$PORT'}]},"version": "0"}}' ${TEST_NETWORK_HOME}/channel-artifacts/${CORE_PEER_LOCALMSPID}config.json > ${TEST_NETWORK_HOME}/channel-artifacts/${CORE_PEER_LOCALMSPID}modified_config.json
res=$?
{ set +x; } 2>/dev/null
verifyResult $res "Channel configuration update for anchor peer failed, make sure you have jq installed"


# Compute a config update, based on the differences between
# {orgmsp}config.json and {orgmsp}modified_config.json, write
Expand Down
Loading