Skip to content

Commit

Permalink
Bump go version to 1.21
Browse files Browse the repository at this point in the history
Signed-off-by: André Macedo <[email protected]>
  • Loading branch information
andremacedopv committed May 8, 2024
1 parent 5ceb371 commit cffdb4f
Show file tree
Hide file tree
Showing 9 changed files with 270 additions and 96 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

## Directory Structure

- `/fabric`: Fabric network v2.2 used as a test environment
- `/fabric`: Fabric network v2.5 used as a test environment
- `/chaincode`: chaincode-related files
- `/ccapi`: chaincode REST API in Golang project

## Development

The `cc-tools` library has been tested in Fabric v1.4, v2.2 and v2.4 networks.
The `cc-tools` library has been tested in Fabric v2.2, v2.4 and v2.5 networks.

Dependencies for chaincode and chaincode API:

- Go 1.14 or higher
- Go 1.21 or higher

Dependencies for test environment:

Expand Down
35 changes: 28 additions & 7 deletions chaincode/go.mod
Original file line number Diff line number Diff line change
@@ -1,23 +1,44 @@
module github.com/hyperledger-labs/cc-tools-demo/chaincode

go 1.13
go 1.21

// replace github.com/hyperledger-labs/cc-tools => ../../cc-tools

require (
github.com/cucumber/godog v0.12.5
github.com/hyperledger-labs/cc-tools v0.0.0-20230925122447-436e77d66dc5
github.com/hyperledger-labs/cc-tools v0.0.0-20240508203056-b7274bf62395
github.com/hyperledger/fabric-chaincode-go v0.0.0-20210603161043-af0e3898842a
github.com/hyperledger/fabric-protos-go v0.0.0-20210528200356-82833ecdac31
)

require (
github.com/cucumber/gherkin-go/v19 v19.0.3 // indirect
github.com/cucumber/messages-go/v16 v16.0.1 // indirect
github.com/gofrs/uuid v4.0.0+incompatible // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.0 // indirect
github.com/hashicorp/go-memdb v1.3.0 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hyperledger/fabric v2.1.1+incompatible // indirect
github.com/miekg/pkcs11 v1.0.3 // indirect
github.com/mitchellh/mapstructure v1.3.2 // indirect
github.com/pelletier/go-toml v1.8.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/spf13/afero v1.3.1 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/testify v1.8.0 // indirect
golang.org/x/crypto v0.0.0-20210920023735-84f357641f63 // indirect
golang.org/x/net v0.0.0-20210917221730-978cfadd31cf // indirect
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/protobuf v1.28.0 // indirect
github.com/sykesm/zap-logfmt v0.0.4 // indirect
go.uber.org/atomic v1.6.0 // indirect
go.uber.org/multierr v1.5.0 // indirect
go.uber.org/zap v1.16.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/grpc v1.56.3 // indirect
google.golang.org/protobuf v1.33.0 // indirect
)
104 changes: 25 additions & 79 deletions chaincode/go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion fabric/scripts/deployCC.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ if [ "$CC_SRC_LANGUAGE" = "go" ]; then

infoln "Vendoring Go dependencies at $CC_SRC_PATH"
pushd $CC_SRC_PATH
GO111MODULE=on go mod vendor
GO111MODULE=on GOWORK=off go mod vendor
popd
successln "Finished vendoring Go dependencies"

Expand Down
2 changes: 1 addition & 1 deletion generateTar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ fi
rm -f ${FLAG_NAME}.tar.gz

# Make sure go mod is up to date
cd chaincode && go mod vendor && cd ..
cd chaincode && GOWORK=off go mod vendor && cd ..

# Pack chaincode
export FABRIC_CFG_PATH=fabric/config
Expand Down
2 changes: 1 addition & 1 deletion generateTemplateTar2.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

# Make sure go mod is up to date
cd chaincode && go mod vendor && cd ..
cd chaincode && GOWORK=off go mod vendor && cd ..

mkdir src
cp -r chaincode/* src
Expand Down
2 changes: 1 addition & 1 deletion go.work
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
go 1.19
go 1.21

use (
./ccapi
Expand Down
211 changes: 209 additions & 2 deletions go.work.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion startDev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ docker volume rm $(docker volume ls -qf dangling=true)

# Script used to start the development environment.
if [ ! -d "chaincode/vendor" ]; then
cd ./chaincode; go mod vendor; cd ..
cd ./chaincode; GOWORK=off go mod vendor; cd ..
fi
cd ./chaincode; go fmt ./...; cd ..
cd ./fabric; ./startDev.sh -n $ORG_QNTY; cd ..
Expand Down

0 comments on commit cffdb4f

Please sign in to comment.