You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 22, 2021. It is now read-only.
I am looking for Java chaincode remote debugging setup/configuration
Expectation:
Able to do hit breakpoint/ line debug java chaincode on my local machine.
connect local code to remote chaincode via 'java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000'
Environment:
Fabric networking running on local machine via docker compose (Fabcar) network
Two Peer / each Org (Two Org), raft ordered, cli, couchdb
Java chaincode deployment on peer.
Able to call query on chaindode
Configuration:
Peer compose yaml property set to : 'command: peer node start --peer-chaincodedev=true'
Peer compose yaml property set to: CORE_CHAINCODE_LOGGING_LEVEL=DEBUG
Observation: on chaincode container 'dev-peer0.org1.example.com-fabcarv1-99a85fb372cb80ca5efcc11f7dc3debe3bcec4fd8b22b81cae9273ca43332265'
Files under location: /root/chaincode-java
build.sh chaincode lib start
Below is the script in above mentioned 'start' script
#!/usr/bin/env bash
set -ex
if [ -f ${CHAINCODE_DIR}/.uberjar ]; then
if [ ${NUM_CHAINCODE_JARS} -ne 1 ]; then
>&2 echo "Cannot start uber JAR as more than one JAR file was found in the chaincode directory"
exit 255
fi exec java -jar ${CHAINCODE_JARS} "$@"
else
exec java -cp ${CHAINCODE_JARS}:${LIB_JARS} org.hyperledger.fabric.contract.ContractRouter "$@"
fi
How to perform the below steps:
how to add jvm argument xdebug in start scrip? so that it will open debug port
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I am looking for Java chaincode remote debugging setup/configuration
Expectation:
Environment:
Configuration:
Observation: on chaincode container 'dev-peer0.org1.example.com-fabcarv1-99a85fb372cb80ca5efcc11f7dc3debe3bcec4fd8b22b81cae9273ca43332265'
Files under location: /root/chaincode-java
#!/usr/bin/env bash
set -ex
ROOT_DIR=/root/chaincode-java
LIB_DIR=${ROOT_DIR}/lib
CHAINCODE_DIR=${ROOT_DIR}/chaincode
LIB_JARS=$(find ${LIB_DIR} -name ".jar" | paste -s -d ":" -)
CHAINCODE_JARS=$(find ${CHAINCODE_DIR} -name ".jar" | paste -s -d ":" -)
NUM_CHAINCODE_JARS=$(find ${CHAINCODE_DIR} -name "*.jar" | wc -l)
if [ -f ${CHAINCODE_DIR}/.uberjar ]; then${CHAINCODE_JARS} "$ @"
if [ ${NUM_CHAINCODE_JARS} -ne 1 ]; then
>&2 echo "Cannot start uber JAR as more than one JAR file was found in the chaincode directory"
exit 255
fi
exec java -jar
else
exec java -cp ${CHAINCODE_JARS}:${LIB_JARS} org.hyperledger.fabric.contract.ContractRouter "$@"
fi
How to perform the below steps:
The text was updated successfully, but these errors were encountered: