From 13fafddd276365b3af80df2d7723766da71a2556 Mon Sep 17 00:00:00 2001 From: Sandeep Nishad Date: Wed, 14 Aug 2024 17:34:58 +0530 Subject: [PATCH] chore: updating golang version in docs, and proto-grpc dependencies Signed-off-by: Sandeep Nishad --- .../test-network/setup-local-docker.md | 13 +++++++------ .../getting-started/test-network/setup-local.md | 13 +++++++------ .../test-network/setup-packages-docker.md | 2 +- .../getting-started/test-network/setup-packages.md | 2 +- weaver/core/network/fabric-interop-cc/Dockerfile | 2 +- weaver/core/network/fabric-interop-cc/makefile | 2 +- 6 files changed, 18 insertions(+), 16 deletions(-) diff --git a/docs/docs/weaver/getting-started/test-network/setup-local-docker.md b/docs/docs/weaver/getting-started/test-network/setup-local-docker.md index 1c64a9462b..9874b96b37 100644 --- a/docs/docs/weaver/getting-started/test-network/setup-local-docker.md +++ b/docs/docs/weaver/getting-started/test-network/setup-local-docker.md @@ -28,7 +28,7 @@ Before starting, make sure you have the following software installed on your hos - Git: [sample instructions](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) - Docker: [sample instructions](https://docs.docker.com/engine/install/) (Latest version) - Docker-Compose: [sample instructions](https://docs.docker.com/compose/install/) (Version 2 or higher) -- Golang: [sample instructions](https://golang.org/dl/) (Version 1.16 or higher) +- Golang: [sample instructions](https://golang.org/dl/) (Version 1.20 or higher) - Java (JDK and JRE): [sample instructions](https://openjdk.java.net/install/) (Version 8) - Node.js and NPM: [sample instructions](https://nodejs.org/en/download/package-manager/) (Version 16 Supported) - Yarn: [sample instructions](https://classic.yarnpkg.com/en/docs/install/) @@ -36,8 +36,8 @@ Before starting, make sure you have the following software installed on your hos * Default method: Run the following with `sudo` if necessary. This will install both the protobuf compiler and the Go code generator plugins. ``` apt-get install protobuf-compiler - go install google.golang.org/protobuf/cmd/protoc-gen-go - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc + go install google.golang.org/protobuf/cmd/protoc-gen-go@latest + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.4.0 ``` * If the above method installs an older version of `protoc` (check using `protoc --version`), say below 3.12.x, you should download pre-compiled binaries instead. (With an older version, you may see errors while attempting to launch and setup the Fabric networks). ``` @@ -46,13 +46,14 @@ Before starting, make sure you have the following software installed on your hos sudo apt-get install unzip unzip protoc-3.15.6-linux-x86_64.zip -d export PATH="$PATH:/bin" - go install google.golang.org/protobuf/cmd/protoc-gen-go - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc + go install google.golang.org/protobuf/cmd/protoc-gen-go@latest + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.4.0 ``` | Notes | |:------| | The latest version at present is `3.15.6`, but you should check the above link to find the most current version before running the above steps. | + | The latest version of `protoc-gen-go-grpc` that works with the Fabric test networks we will run below is `v1.4.0`, which is why that version is hardcoded here. | ### Credentials Make sure you have an SSH or GPG key registered in https://github.com to allow seamless cloning of repositories (at present, various setup scripts clone repositories using the `https://` prefix but this may change to `git@` in the future). @@ -172,7 +173,7 @@ For more information, refer to the associated [README](https://github.com/hyperl **Troubleshooting Tips**: - If you see any errors during the launches, re-check the prerequisites (software installations and credentials). Ensure your network connection is working. As a safe bet, you can retry after cleanup: kill and remove all Docker containers and associated volumes. -- If `protoc` or `protoc-gen-go` throws an error, reinstall `protoc` and `protoc-gen-go` using suggestions made in the Prerequisites section above. +- If `protoc` or `protoc-gen-go` throws an error, reinstall `protoc`, `protoc-gen-go`, and `protoc-gen-go-grpc` using suggestions made in the Prerequisites section above. ### Fabric Relay diff --git a/docs/docs/weaver/getting-started/test-network/setup-local.md b/docs/docs/weaver/getting-started/test-network/setup-local.md index 3c47740f35..bb3d02eacd 100644 --- a/docs/docs/weaver/getting-started/test-network/setup-local.md +++ b/docs/docs/weaver/getting-started/test-network/setup-local.md @@ -29,7 +29,7 @@ Before starting, make sure you have the following software installed on your hos - Git: [sample instructions](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) - Docker: [sample instructions](https://docs.docker.com/engine/install/) (Latest version) - Docker-Compose: [sample instructions](https://docs.docker.com/compose/install/) (Version 2 or higher) -- Golang: [sample instructions](https://golang.org/dl/) (Version 1.16 or higher) +- Golang: [sample instructions](https://golang.org/dl/) (Version 1.20 or higher) - Java (JDK and JRE): [sample instructions](https://openjdk.java.net/install/) (Version 8) - Node.js and NPM: [sample instructions](https://nodejs.org/en/download/package-manager/) (Version 16 Supported) - Yarn: [sample instructions](https://classic.yarnpkg.com/en/docs/install/) @@ -38,8 +38,8 @@ Before starting, make sure you have the following software installed on your hos * Default method: Run the following with `sudo` if necessary. This will install both the protobuf compiler and the Go code generator plugins. ``` apt-get install protobuf-compiler - go install google.golang.org/protobuf/cmd/protoc-gen-go - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc + go install google.golang.org/protobuf/cmd/protoc-gen-go@latest + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.4.0 ``` * If the above method installs an older version of `protoc` (check using `protoc --version`), say below 3.12.x, you should download pre-compiled binaries instead. (With an older version, you may see errors while attempting to launch and setup the Fabric networks). ``` @@ -48,8 +48,8 @@ Before starting, make sure you have the following software installed on your hos sudo apt-get install unzip unzip protoc-3.15.6-linux-x86_64.zip -d export PATH="$PATH:/bin" - go install google.golang.org/protobuf/cmd/protoc-gen-go - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc + go install google.golang.org/protobuf/cmd/protoc-gen-go@latest + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.4.0 ``` - SQLite3 Library: * Sample instruction for Ubuntu: @@ -60,6 +60,7 @@ Before starting, make sure you have the following software installed on your hos | Notes | |:------| | The latest version at present is `3.15.6`, but you should check the above link to find the most current version before running the above steps. | + | The latest version of `protoc-gen-go-grpc` that works with the Fabric test networks we will run below is `v1.4.0`, which is why that version is hardcoded here. | ### Credentials Make sure you have an SSH or GPG key registered in https://github.com to allow seamless cloning of repositories (at present, various setup scripts clone repositories using the `https://` prefix but this may change to `git@` in the future). @@ -179,7 +180,7 @@ For more information, refer to the associated [README](https://github.com/hyperl **Troubleshooting Tips**: - If you see any errors during the launches, re-check the prerequisites (software installations and credentials). Ensure your network connection is working. As a safe bet, you can retry after cleanup: kill and remove all Docker containers and associated volumes. -- If `protoc` or `protoc-gen-go` throws an error, reinstall `protoc` and `protoc-gen-go` using suggestions made in the Prerequisites section above. +- If `protoc` or `protoc-gen-go` throws an error, reinstall `protoc`, `protoc-gen-go`, and `protoc-gen-go-grpc` using suggestions made in the Prerequisites section above. ### Fabric Client (fabric-cli) diff --git a/docs/docs/weaver/getting-started/test-network/setup-packages-docker.md b/docs/docs/weaver/getting-started/test-network/setup-packages-docker.md index c86db008cf..a0539e83bb 100644 --- a/docs/docs/weaver/getting-started/test-network/setup-packages-docker.md +++ b/docs/docs/weaver/getting-started/test-network/setup-packages-docker.md @@ -28,7 +28,7 @@ Before starting, make sure you have the following software installed on your hos - Git: [sample instructions](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) - Docker: [sample instructions](https://docs.docker.com/engine/install/) (Latest version) - Docker-Compose: [sample instructions](https://docs.docker.com/compose/install/) (Version 2 or higher) -- Golang: [sample instructions](https://golang.org/dl/) (Version 1.16 or higher) +- Golang: [sample instructions](https://golang.org/dl/) (Version 1.20 or higher) - Java (JDK and JRE): [sample instructions](https://openjdk.java.net/install/) (Version 8) - Node.js and NPM: [sample instructions](https://nodejs.org/en/download/package-manager/) (Version 11 to Version 16 Supported) - Yarn: [sample instructions](https://classic.yarnpkg.com/en/docs/install/) diff --git a/docs/docs/weaver/getting-started/test-network/setup-packages.md b/docs/docs/weaver/getting-started/test-network/setup-packages.md index f175034e49..e38f06f76b 100644 --- a/docs/docs/weaver/getting-started/test-network/setup-packages.md +++ b/docs/docs/weaver/getting-started/test-network/setup-packages.md @@ -28,7 +28,7 @@ Before starting, make sure you have the following software installed on your hos - Git: [sample instructions](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) - Docker: [sample instructions](https://docs.docker.com/engine/install/) (Latest version) - Docker-Compose: [sample instructions](https://docs.docker.com/compose/install/) (Version 2 or higher) -- Golang: [sample instructions](https://golang.org/dl/) (Version 1.16 or higher) +- Golang: [sample instructions](https://golang.org/dl/) (Version 1.20 or higher) - Java (JDK and JRE): [sample instructions](https://openjdk.java.net/install/) (Version 8) - Node.js and NPM: [sample instructions](https://nodejs.org/en/download/package-manager/) (Version 16 Supported) - Yarn: [sample instructions](https://classic.yarnpkg.com/en/docs/install/) diff --git a/weaver/core/network/fabric-interop-cc/Dockerfile b/weaver/core/network/fabric-interop-cc/Dockerfile index ce10e7aec5..755b3bab8c 100644 --- a/weaver/core/network/fabric-interop-cc/Dockerfile +++ b/weaver/core/network/fabric-interop-cc/Dockerfile @@ -9,7 +9,7 @@ RUN cd /fabric-interop-cc/contracts/interop && CC=musl-gcc go build -o interop # Production ready image # Pass the binary to the prod image -FROM alpine:3.11 as prod +FROM alpine:3.11 AS prod RUN apk add libc6-compat libstdc++ zlib>1.2.11-r4 zlib-dev>1.2.11-r4 COPY --from=build /fabric-interop-cc/contracts/interop/interop /app/interop diff --git a/weaver/core/network/fabric-interop-cc/makefile b/weaver/core/network/fabric-interop-cc/makefile index f9072c22b5..9a754919bd 100644 --- a/weaver/core/network/fabric-interop-cc/makefile +++ b/weaver/core/network/fabric-interop-cc/makefile @@ -15,7 +15,7 @@ list-names: echo ${DOCKER_IMAGE_NAME}:$(DOCKER_TAG) image: - (cd contracts/interop && make run-vendor) + (cd contracts/interop && make run-vendor && go mod tidy) docker build --build-arg GIT_URL=$(GIT_URL) -t ${DOCKER_IMAGE_NAME}:$(DOCKER_TAG) . check-if-tag-exists: