From 5edae7c4448e02e2ba7ac86640c966431cd77c74 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Thu, 3 Feb 2022 17:15:29 +0000 Subject: [PATCH] Update samples to use published fabric-rest-sample (#626) Signed-off-by: James Taylor --- asset-transfer-basic/rest-api-typescript/README.md | 8 ++------ .../rest-api-typescript/docker-compose.yaml | 2 +- test-network-k8s/README.md | 2 +- test-network-k8s/docs/APPLICATIONS.md | 4 ++-- test-network-k8s/kube/fabric-rest-sample.yaml | 2 +- test-network-k8s/scripts/rest_sample.sh | 2 +- 6 files changed, 8 insertions(+), 12 deletions(-) diff --git a/asset-transfer-basic/rest-api-typescript/README.md b/asset-transfer-basic/rest-api-typescript/README.md index e2314dc5..2677b6db 100644 --- a/asset-transfer-basic/rest-api-typescript/README.md +++ b/asset-transfer-basic/rest-api-typescript/README.md @@ -132,13 +132,9 @@ npm run start:dev ### Docker image -Alternatively, run the following commands in the `fabric-rest-sample/asset-transfer-basic/rest-api-typescript` directory to start the sample in a Docker container +It's also possible to use the [published docker image](https://github.com/hyperledger/fabric-samples/pkgs/container/fabric-rest-sample) to run the sample -Build the Docker image - -```shell -docker build -t fabric-rest-sample . -``` +Clone the `fabric-samples` repository and change to the `fabric-samples/asset-transfer-basic/rest-api-typescript` directory before running the following commands Create a `.env` file to configure the server for the test network (make sure `TEST_NETWORK_HOME` is set to the fully qualified `test-network` directory and `AS_LOCAL_HOST` is set to `false` so that the server works inside the Docker Compose network) diff --git a/asset-transfer-basic/rest-api-typescript/docker-compose.yaml b/asset-transfer-basic/rest-api-typescript/docker-compose.yaml index b7c4b0b3..0ef763dc 100644 --- a/asset-transfer-basic/rest-api-typescript/docker-compose.yaml +++ b/asset-transfer-basic/rest-api-typescript/docker-compose.yaml @@ -9,7 +9,7 @@ services: - fabric_test nodeapp: - image: 'fabric-rest-sample' + image: 'ghcr.io/hyperledger/fabric-rest-sample:latest' command: ['start:dotenv'] ports: - 3000:3000 diff --git a/test-network-k8s/README.md b/test-network-k8s/README.md index 85f46adf..94d2103e 100644 --- a/test-network-k8s/README.md +++ b/test-network-k8s/README.md @@ -42,7 +42,7 @@ Invoke and query chaincode: ./network chaincode query '{"Args":["ReadAsset","1"]}' ``` -Access the blockchain with a [REST API](https://github.com/hyperledgendary/fabric-rest-sample/tree/main/asset-transfer-basic/rest-api-typescript#rest-api): +Access the blockchain with a [REST API](https://github.com/hyperledger/fabric-samples/tree/main/asset-transfer-basic/rest-api-typescript): ``` ./network rest-easy ``` diff --git a/test-network-k8s/docs/APPLICATIONS.md b/test-network-k8s/docs/APPLICATIONS.md index 2758f463..dd1f1d7d 100644 --- a/test-network-k8s/docs/APPLICATIONS.md +++ b/test-network-k8s/docs/APPLICATIONS.md @@ -9,7 +9,7 @@ Launching fabric-rest-sample application: ✅ - Constructing fabric-rest-sample connection profiles ... ✅ - Starting fabric-rest-sample ... -The fabric-rest-sample has started. See https://github.com/hyperledgendary/fabric-rest-sample/tree/main/asset-transfer-basic/rest-api-typescript#rest-api for additional usage. +The fabric-rest-sample has started. See https://github.com/hyperledger/fabric-samples/tree/main/asset-transfer-basic/rest-api-typescript for additional usage. To access the endpoint: export SAMPLE_APIKEY=97834158-3224-4CE7-95F9-A148C886653E @@ -37,7 +37,7 @@ $ curl -s --header "X-Api-Key: ${SAMPLE_APIKEY}" http://localhost/api/assets | j } ] -$ open https://github.com/hyperledgendary/fabric-rest-sample/tree/main/asset-transfer-basic/rest-api-typescript#rest-api +$ open https://github.com/hyperledger/fabric-samples/tree/main/asset-transfer-basic/rest-api-typescript ``` ## Guide for Gateway Client Applications diff --git a/test-network-k8s/kube/fabric-rest-sample.yaml b/test-network-k8s/kube/fabric-rest-sample.yaml index 2bf99d7f..9254c5e6 100644 --- a/test-network-k8s/kube/fabric-rest-sample.yaml +++ b/test-network-k8s/kube/fabric-rest-sample.yaml @@ -179,7 +179,7 @@ spec: spec: containers: - name: main - image: ghcr.io/hyperledgendary/fabric-rest-sample + image: ghcr.io/hyperledger/fabric-rest-sample imagePullPolicy: IfNotPresent env: - name: LOG_LEVEL diff --git a/test-network-k8s/scripts/rest_sample.sh b/test-network-k8s/scripts/rest_sample.sh index fe397164..52b0af8c 100755 --- a/test-network-k8s/scripts/rest_sample.sh +++ b/test-network-k8s/scripts/rest_sample.sh @@ -82,7 +82,7 @@ function launch_rest_sample() { rollout_rest_sample log "" - log "The fabric-rest-sample has started. See https://github.com/hyperledgendary/fabric-rest-sample/tree/main/asset-transfer-basic/rest-api-typescript#rest-api for additional usage." + log "The fabric-rest-sample has started. See https://github.com/hyperledger/fabric-samples/tree/main/asset-transfer-basic/rest-api-typescript for additional usage." log "To access the endpoint:" log "" log "export SAMPLE_APIKEY=97834158-3224-4CE7-95F9-A148C886653E"