mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-21 09:05:10 +00:00
Update README and ci
Signed-off-by: Stanislav Jakuschevskij <stas@two-giants.com>
This commit is contained in:
parent
06c7445e91
commit
40e627dcf5
3 changed files with 33 additions and 3 deletions
|
|
@ -41,11 +41,22 @@ print "Initializing Typescript off-chain data application"
|
||||||
pushd ../off_chain_data/application-typescript
|
pushd ../off_chain_data/application-typescript
|
||||||
rm -f checkpoint.json store.log
|
rm -f checkpoint.json store.log
|
||||||
npm install
|
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 getAllAssets transact getAllAssets listen
|
||||||
SIMULATED_FAILURE_COUNT=1 npm start listen
|
SIMULATED_FAILURE_COUNT=1 npm start listen
|
||||||
popd
|
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
|
# Run off-chain data Java application
|
||||||
#createNetwork
|
#createNetwork
|
||||||
export CHAINCODE_NAME=off_chain_data
|
export CHAINCODE_NAME=off_chain_data
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,10 @@ The Fabric test network is used to deploy and run this sample. Follow these step
|
||||||
npm install
|
npm install
|
||||||
npm start transact listen
|
npm start transact listen
|
||||||
|
|
||||||
|
# To run the Go sample application
|
||||||
|
cd application-go
|
||||||
|
go run . transact listen
|
||||||
|
|
||||||
# To run the Java sample application
|
# To run the Java sample application
|
||||||
cd application-java
|
cd application-java
|
||||||
./gradlew run --quiet --args='transact listen'
|
./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
|
cd application-typescript
|
||||||
npm --silent start getAllAssets
|
npm --silent start getAllAssets
|
||||||
|
|
||||||
|
# To run the Go sample application
|
||||||
|
cd application-go
|
||||||
|
go run . getAllAssets
|
||||||
|
|
||||||
# To run the Java sample application
|
# To run the Java sample application
|
||||||
cd application-java
|
cd application-java
|
||||||
./gradlew run --quiet --args=getAllAssets
|
./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
|
SIMULATED_FAILURE_COUNT=5 npm start listen
|
||||||
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
|
# To run the Java sample application
|
||||||
cd application-java
|
cd application-java
|
||||||
./gradlew run --quiet --args=transact
|
./gradlew run --quiet --args=transact
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ func getAllAssets(clientConnection *grpc.ClientConn) {
|
||||||
id, options := newConnectOptions(clientConnection)
|
id, options := newConnectOptions(clientConnection)
|
||||||
gateway, err := client.Connect(id, options...)
|
gateway, err := client.Connect(id, options...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic((err))
|
panic(err)
|
||||||
}
|
}
|
||||||
defer gateway.Close()
|
defer gateway.Close()
|
||||||
|
|
||||||
|
|
@ -28,7 +28,12 @@ func getAllAssets(clientConnection *grpc.ClientConn) {
|
||||||
smartContract := atb.NewAssetTransferBasic(contract)
|
smartContract := atb.NewAssetTransferBasic(contract)
|
||||||
assets, err := smartContract.GetAllAssets()
|
assets, err := smartContract.GetAllAssets()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic((err))
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(assets) == 0 {
|
||||||
|
fmt.Println("no assets")
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println(formatJSON(assets))
|
fmt.Println(formatJSON(assets))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue