Update README and ci

Signed-off-by: Stanislav Jakuschevskij <stas@two-giants.com>
This commit is contained in:
Stanislav Jakuschevskij 2025-01-09 09:27:48 +01:00
parent 06c7445e91
commit 40e627dcf5
No known key found for this signature in database
GPG key ID: 78195D2E6998E2EB
3 changed files with 33 additions and 3 deletions

View file

@ -41,11 +41,22 @@ print "Initializing Typescript off-chain data application"
pushd ../off_chain_data/application-typescript
rm -f checkpoint.json store.log
npm install
print "Running the output app"
print "Running the Typescript app"
SIMULATED_FAILURE_COUNT=1 npm start getAllAssets transact getAllAssets listen
SIMULATED_FAILURE_COUNT=1 npm start listen
popd
# Run off-chain data Go application
export CHAINCODE_NAME=go_off_chain_data
deployChaincode
print "Initializing Go off-chain data application"
pushd ../off_chain_data/application-go
rm -f checkpoint.json store.log
print "Running the Go app"
SIMULATED_FAILURE_COUNT=1 go run . getAllAssets transact getAllAssets listen
SIMULATED_FAILURE_COUNT=1 go run . listen
popd
# Run off-chain data Java application
#createNetwork
export CHAINCODE_NAME=off_chain_data

View file

@ -65,6 +65,10 @@ The Fabric test network is used to deploy and run this sample. Follow these step
npm install
npm start transact listen
# To run the Go sample application
cd application-go
go run . transact listen
# To run the Java sample application
cd application-java
./gradlew run --quiet --args='transact listen'
@ -79,6 +83,10 @@ The Fabric test network is used to deploy and run this sample. Follow these step
cd application-typescript
npm --silent start getAllAssets
# To run the Go sample application
cd application-go
go run . getAllAssets
# To run the Java sample application
cd application-java
./gradlew run --quiet --args=getAllAssets
@ -93,6 +101,12 @@ The Fabric test network is used to deploy and run this sample. Follow these step
SIMULATED_FAILURE_COUNT=5 npm start listen
npm start listen
# To run the Go sample application
cd application-go
go run . transact
SIMULATED_FAILURE_COUNT=5 go run . listen
go run . listen
# To run the Java sample application
cd application-java
./gradlew run --quiet --args=transact

View file

@ -20,7 +20,7 @@ func getAllAssets(clientConnection *grpc.ClientConn) {
id, options := newConnectOptions(clientConnection)
gateway, err := client.Connect(id, options...)
if err != nil {
panic((err))
panic(err)
}
defer gateway.Close()
@ -28,7 +28,12 @@ func getAllAssets(clientConnection *grpc.ClientConn) {
smartContract := atb.NewAssetTransferBasic(contract)
assets, err := smartContract.GetAllAssets()
if err != nil {
panic((err))
panic(err)
}
if len(assets) == 0 {
fmt.Println("no assets")
return
}
fmt.Println(formatJSON(assets))