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

Initial step to implementing support for invoke command #403

Merged
merged 16 commits into from
Aug 22, 2023

Conversation

jnjerin
Copy link
Contributor

@jnjerin jnjerin commented Aug 13, 2023

This PR fixes a few issues caused by npm and implements support for invoke command for the simplest use case in issue #390:

  1. Fixes errors caused by npm when running tests:

  2. Created a new script chaincode-scripts.sh to handle docker exec

  3. Created the invoke command for its simplest use case

  4. Update CHANGELOG.md with the new changes

@jnjerin jnjerin changed the title This is the first solution to implementing support for invoke command Initial step to implementing support for invoke command Aug 13, 2023
Comment on lines 3 to 4
echo "FABLO_HOME: $FABLO_HOME"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think those two lines can be removed

--waitForEventTimeout 90s \
2>&1

echo "Executing chaincode invoke command..."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant log message

Comment on lines 5 to 16
local channel="$1"
local chaincode="$2"
local peers="$3"
local command="$4"
local transient="$5"

echo "-> Chaincode invoke:"
echo "Channel: $channel"
echo "Chaincode: $chaincode"
echo "Peers: $peers"
echo "Command: $command"
echo "Transient: $transient"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should use a consistent convention, like the one we use for instance here:

chaincodePackage() {
  local CLI_NAME=$1
  local PEER_ADDRESS=$2
  local CHAINCODE_NAME=$3
  local CHAINCODE_VERSION=$4
  local CHAINCODE_LABEL="${CHAINCODE_NAME}_$CHAINCODE_VERSION"
  local CHAINCODE_LANG=$5

  echo "Packaging chaincode $CHAINCODE_NAME..."
  inputLog "CHAINCODE_VERSION: $CHAINCODE_VERSION"
  inputLog "CHAINCODE_LANG: $CHAINCODE_LANG"
  inputLog "PEER_ADDRESS: $PEER_ADDRESS"
  inputLog "CLI_NAME: $CLI_NAME"

So:

  • snake case with capital letters for variable names
  • and inputLog instead of echo

@dzikowski dzikowski merged commit f653b64 into hyperledger-labs:main Aug 22, 2023
5 of 7 checks passed
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

Successfully merging this pull request may close these issues.

2 participants