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

Support chaincode list command #406

Open
dzikowski opened this issue Aug 23, 2023 · 1 comment
Open

Support chaincode list command #406

dzikowski opened this issue Aug 23, 2023 · 1 comment

Comments

@dzikowski
Copy link
Contributor

Right now we use some scripts in e2e-network directory to determine chaincode list, like in wait-for-chaincode.sh. The goal of this issue is to support the following command for Docker engine:

fablo chaincode list <peer> <channel>

Implementation details

Add to fabric-docker.sh:

elif [ "$1" = "chaincodes" ] && [ "$2" = "list" ]; then
  chaincodeList "$3" "$4"

Use the syntax known from channel query scripts for chaincode-scripts.sh; something similar to:

chaincodeList() {
if [ "$#" -ne 3 ]; then
  echo "Expected 3 parameters for chaincode list, but got: $@"
  exit 1
<% orgs.forEach((org) => { org.peers.forEach((peer) => { %>
elif [ "$1" = "<%= org.name.toLowerCase(); %>" ] && [ "$2" = "<%= peer.name %>" ]; then
  <% if(!global.tls) { %>
    peerChaincodeList "<%= org.cli.address %>" "<%= peer.fullAddress %>" "$3" # $3 is channel name
  <% } else { %>
    peerChaincodeListTls "<%= org.cli.address %>" "<%= peer.fullAddress %>" "#3" # ??? maybe a TLS file path will be required inside target function
  <% } %>
<% })}) %>
}

Inside wait-for-chaincode.sh use:

listChaincodes() {
  "$FABLO_HOME/fablo.sh" chaincode list "$peer" "$channel"
  # instead of previous:
  #  docker exec -e CORE_PEER_ADDRESS="$peer" "$cli" peer lifecycle chaincode querycommitted \
  #    --channelID "$channel"
}

Add peerChaincodeList, and peerChaincodeListTls functions to chaincode-functions-v2.sh file.

Steps

  1. Support non-TLS flow (test-01)
  2. Support TLS (test-02)
  3. Update README with docs + update CHANGELOG

Can be implemented in separate PRs

@Hejwo
Copy link
Contributor

Hejwo commented Aug 30, 2023

@jnjerin current work - For some reason we cannot assign her

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants