Skip to content
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
15 changes: 10 additions & 5 deletions e2e-network/docker/test-04-v3-snapshot-ccaas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ waitForContainer "ca.org1.example.com" "Listening on https://0.0.0.0:7054"
waitForContainer "couchdb.peer0.org1.example.com" "Apache CouchDB has started. Time to relax."
waitForContainer "peer0.org1.example.com" "Joining gossip network of channel my-channel1 with 1 organizations"
waitForChaincode "peer0.org1.example.com" "my-channel1" "chaincode1" "0.0.1"
waitForContainer "ccaas_peer0.org1.example.com_my-channel1_chaincode1_0.0.1" "Bootstrap process completed"
waitForContainer "ccaas_peer0.org1.example.com_my-channel2_chaincode1_0.0.1" "Bootstrap process completed"

fablo_rest_org1="localhost:8801"
snapshot_name="fablo-snapshot-$(date -u +"%Y%m%d%H%M%S")"
Expand Down Expand Up @@ -109,21 +111,24 @@ hook_command="perl -i -pe 's/FABRIC_VERSION=2\.3\.3/FABRIC_VERSION=2\.4\.2/g' ./
cd "$TEST_TMP" &&
"$FABLO_HOME/fablo.sh" prune &&
"$FABLO_HOME/fablo.sh" restore "$snapshot_name" "$hook_command" &&
"$FABLO_HOME/fablo.sh" start
"$FABLO_HOME/fablo.sh" start &&
"$FABLO_HOME/fablo.sh" chaincodes install
)

waitForChaincode "peer0.org1.example.com" "my-channel1" "chaincode1" "0.0.1"

sleep 10
# wait for CCAAS container to finish bootstrapping
waitForContainer "ccaas_peer0.org1.example.com_my-channel1_chaincode1_0.0.1" "Bootstrap process completed"
waitForContainer "ccaas_peer0.org1.example.com_my-channel2_chaincode1_0.0.1" "Bootstrap process completed"

# sleep one second to ensure the CCAAS container is ready
sleep 1

# check if state is kept after restoration
user_token_response="$(expectCARest "$fablo_rest_org1/user/enroll" '' '{"id": "gordon", "secret": "gordonpw"}' 'token')"
echo "$user_token_response"
user_token="$(echo "$user_token_response" | jq -r '.token')"

# check if state is kept after restoration
sleep 2

expectInvokeRest "$fablo_rest_org1 $user_token" "my-channel1" "chaincode1" \
"KVContract:get" '["name"]' \
'{"response":{"success":"Mr Freeze"}}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2115,8 +2115,6 @@ services:
- ../fabric-config/crypto-config/peerOrganizations/orderer.example.com/peers/orderer0.group1.orderer.example.com/msp/tlscacerts/tlsca.orderer.example.com-cert.pem:/var/hyperledger/cli/crypto-orderer/tlsca.orderer.example.com-cert.pem:ro
- ../fabric-config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt:/var/hyperledger/cli/crypto-peer/peer0.org1.example.com/tls/ca.crt:ro
- ../fabric-config/chaincode-packages:/var/hyperledger/cli/chaincode-packages/
- "$CHAINCODES_BASE_DIR//:/var/hyperledger/cli/chaincode1/"
- "$CHAINCODES_BASE_DIR//:/var/hyperledger/cli/chaincode1/"
networks:
- basic

Expand Down Expand Up @@ -2236,8 +2234,6 @@ services:
- ../fabric-config/crypto-config/peerOrganizations/orderer.example.com/peers/orderer0.group1.orderer.example.com/msp/tlscacerts/tlsca.orderer.example.com-cert.pem:/var/hyperledger/cli/crypto-orderer/tlsca.orderer.example.com-cert.pem:ro
- ../fabric-config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt:/var/hyperledger/cli/crypto-peer/peer0.org1.example.com/tls/ca.crt:ro
- ../fabric-config/chaincode-packages:/var/hyperledger/cli/chaincode-packages/
- "$CHAINCODES_BASE_DIR//:/var/hyperledger/cli/chaincode1/"
- "$CHAINCODES_BASE_DIR//:/var/hyperledger/cli/chaincode1/"
networks:
- basic

Expand Down
2 changes: 2 additions & 0 deletions src/setup-docker/templates/fabric-docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ services:
<%_ } _%>
- ../fabric-config/chaincode-packages:/var/hyperledger/cli/chaincode-packages/
<%_ chaincodes.forEach(function(chaincode) { _%>
<%_ if(chaincode.lang !== 'ccaas' && chaincode.directory) { _%>
- "$CHAINCODES_BASE_DIR/<%= chaincode.directory %>/:/var/hyperledger/cli/<%= chaincode.name %>/"
<%_ } _%>
<%_ if(chaincode.privateDataConfigFile) { _%>
- "../fabric-config/<%= chaincode.privateDataConfigFile %>:/var/hyperledger/cli/<%= chaincode.privateDataConfigFile %>"
<%_ } _%>
Expand Down
Loading