Skip to content

Commit

Permalink
[FABG-881] Update to test target to 1.4.2 and Go 1.12
Browse files Browse the repository at this point in the history
This change updates the docker environment target to Fabric 1.4.2.
The Go version is also updated to 1.12.
golangci-lint is also updated to 1.17.1 and lint warnings are resolved.

Change-Id: I42206dce5315791619922d94400eda69f8f5730e
Signed-off-by: Troy Ronda <troy@troyronda.com>
  • Loading branch information
troyronda committed Jul 18, 2019
1 parent f264087 commit 4db5c82
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 21 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ DOCKER_CMD ?= docker
DOCKER_COMPOSE_CMD ?= docker-compose

# Fabric versions used in the Makefile
FABRIC_STABLE_VERSION := 1.4.1
FABRIC_STABLE_VERSION := 1.4.2
FABRIC_STABLE_VERSION_MINOR := 1.4
FABRIC_STABLE_VERSION_MAJOR := 1

Expand All @@ -48,7 +48,7 @@ FABRIC_SDKGO_TEST_CHANGED ?= false
FABRIC_SDKGO_TESTRUN_ID ?= $(shell date +'%Y%m%d%H%M%S')

# Dev tool versions (overridable)
GOLANGCI_LINT_VER ?= v1.16.0
GOLANGCI_LINT_VER ?= v1.17.1

# Fabric tool versions (overridable)
FABRIC_TOOLS_VERSION ?= $(FABRIC_STABLE_VERSION)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ You're good to go, happy coding! Check out the examples for usage demonstrations
### Current Compatibility
The SDK's integration tests run against three tagged Fabric versions:
- prev (currently v1.3.0)
- stable (currently v1.4.0)
- stable (currently v1.4.2)
- prerelease (currently disabled)

Additionally for development purposes integration tests also run against the devstable Fabric version as needed.
Expand Down Expand Up @@ -94,7 +94,7 @@ If you want to contribute to the Go SDK, please run the test suite and submit pa

You need:

- Go 1.11
- Go 1.12
- Make
- Docker
- Docker Compose
Expand Down
6 changes: 3 additions & 3 deletions ci.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
# SPDX-License-Identifier: Apache-2.0
#

GO_VER=1.11.5
GO_MIN_VER=1.11
GO_MAX_VER=1.12.3
GO_VER=1.12.5
GO_MIN_VER=1.12
GO_MAX_VER=1.12.7
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/hyperledger/fabric-lib-go v1.0.0 h1:UL1w7c9LvHZUSkIvHTDGklxFv2kTeva1QI2emOVc324=
github.com/hyperledger/fabric-lib-go v1.0.0/go.mod h1:H362nMlunurmHwkYqR5uHL2UDWbQdbfz74n8kbCFsqc=
github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric v0.0.0-20190524192706-bfae339c63bf h1:ETZhEsVon+yTYk2N3Imw4ItPonDoiWXEb2i0kdOl4OU=
github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric v0.0.0-20190524192706-bfae339c63bf/go.mod h1:yzDA0nf/SiINYnTVcFKQvPM212O1BVriPF2XZLZybbg=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
Expand Down
2 changes: 1 addition & 1 deletion pkg/fab/resource/configtx.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func CreateGenesisBlock(config *genesisconfig.Profile, channelID string) ([]byte
return protoutil.Marshal(genesisBlock)
}

// CreateGenesisBlock creates a genesis block for a channel
// CreateGenesisBlockForOrderer creates a genesis block for a channel
func CreateGenesisBlockForOrderer(config *genesisconfig.Profile, channelID string) ([]byte, error) {
if config.Consortiums == nil {
return nil, errors.Errorf("Genesis block does not contain a consortiums group definition. This block cannot be used for orderer bootstrap.")
Expand Down
13 changes: 5 additions & 8 deletions pkg/fab/resource/configtxmsp.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ import (
const (
cacerts = "cacerts"
admincerts = "admincerts"
signcerts = "signcerts"
keystore = "keystore"
intermediatecerts = "intermediatecerts"
crlsfolder = "crls"
configfilename = "config.yaml"
tlscacerts = "tlscacerts"
tlsintermediatecerts = "tlsintermediatecerts"
)
Expand Down Expand Up @@ -58,17 +55,17 @@ func GenerateMspDir(mspDir string, config *msp.MSPConfig) error {
{crlsfolder, cfg.RevocationList},
}
for _, d := range defs {
err := generateCertDir(filepath.Join(mspDir, d.dir), d.certs)
if err != nil {
return err
errGen := generateCertDir(filepath.Join(mspDir, d.dir), d.certs)
if errGen != nil {
return errGen
}
}

return err
}

func generateCertDir(certDir string, certs [][]byte) error {
err := os.MkdirAll(certDir, 0755)
err := os.MkdirAll(certDir, 0750)
if err != nil {
return err
}
Expand All @@ -77,7 +74,7 @@ func generateCertDir(certDir string, certs [][]byte) error {
}
for counter, certBytes := range certs {
fileName := filepath.Join(certDir, "cert"+fmt.Sprintf("%d", counter)+".pem")
err = ioutil.WriteFile(fileName, certBytes, 0644)
err = ioutil.WriteFile(fileName, certBytes, 0640)
if err != nil {
return err
}
Expand Down
10 changes: 5 additions & 5 deletions test/fixtures/dockerenv/.env
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ FABRIC_BASE_DOCKER_REGISTRY=
FABRIC_FIXTURE_VERSION=v1.4
FABRIC_CRYPTOCONFIG_VERSION=v1

FABRIC_CA_FIXTURE_TAG=1.4.1
FABRIC_ORDERER_FIXTURE_TAG=1.4.1
FABRIC_PEER_FIXTURE_TAG=1.4.1
FABRIC_BUILDER_FIXTURE_TAG=1.4.1
FABRIC_CA_FIXTURE_TAG=1.4.2
FABRIC_ORDERER_FIXTURE_TAG=1.4.2
FABRIC_PEER_FIXTURE_TAG=1.4.2
FABRIC_BUILDER_FIXTURE_TAG=1.4.2
FABRIC_COUCHDB_FIXTURE_TAG=0.4.15
FABRIC_BASEOS_FIXTURE_TAG=0.4.15
FABRIC_BASEIMAGE_FIXTURE_TAG=0.4.15
Expand All @@ -51,4 +51,4 @@ ORDERER_GENERAL_TLS_CLIENTROOTCAS=[/etc/hyperledger/tls/orderer/ca.crt,/etc/hype

# set by crypto-config env.sh
ORG1CA1_FABRIC_CA_SERVER_CA_KEYFILE=
ORG2CA1_FABRIC_CA_SERVER_CA_KEYFILE=
ORG2CA1_FABRIC_CA_SERVER_CA_KEYFILE=
1 change: 1 addition & 0 deletions test/fixtures/testdata/src/github.com/example_cc/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/golang/protobuf v1.3.1 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 // indirect
github.com/hyperledger/fabric v1.4.0
github.com/hyperledger/fabric-amcl v0.0.0-20181230093703-5ccba6eab8d6 // indirect
github.com/miekg/pkcs11 v0.0.0-20190401114359-553cfdd26aaa // indirect
github.com/onsi/gomega v1.5.0 // indirect
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 // indirect
Expand Down
4 changes: 4 additions & 0 deletions test/fixtures/testdata/src/github.com/example_cc/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/hyperledger/fabric v1.4.0 h1:AiOUXysOwh4BmSLZaNzw6ZocZl0uByekPcc+g3PiXH4=
github.com/hyperledger/fabric v1.4.0/go.mod h1:tGFAOCT696D3rG0Vofd2dyWYLySHlh0aQjf7Q1HAju0=
github.com/hyperledger/fabric-amcl v0.0.0-20181230093703-5ccba6eab8d6 h1:URjjUy3G6zNoODRpSy7FFzJyXh3J4+O5NJPgLY9lWT8=
github.com/hyperledger/fabric-amcl v0.0.0-20181230093703-5ccba6eab8d6/go.mod h1:X+DIyUsaTmalOpmpQfIvFZjKHQedrURQ5t4YqquX7lE=
github.com/ijc/Gotty v0.0.0-20170406111628-a8b993ba6abd h1:anPrsicrIi2ColgWTVPk+TrN42hJIWlfPHSBP9S0ZkM=
github.com/ijc/Gotty v0.0.0-20170406111628-a8b993ba6abd/go.mod h1:3LVOLeyx9XVvwPgrt2be44XgSqndprz1G18rSk8KD84=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
Expand Down Expand Up @@ -101,9 +103,11 @@ go.uber.org/zap v1.9.1 h1:XCJQEf3W6eZaVwhRBof6ImoYGJSITeKWsyeh3HFu/5o=
go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190103213133-ff983b9c42bc h1:F5tKCVGp+MUAHhKp5MZtGqAlGX3+oCsiL1Q629FL90M=
golang.org/x/crypto v0.0.0-20190103213133-ff983b9c42bc/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/golang/protobuf v1.3.1 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 // indirect
github.com/hyperledger/fabric v1.4.0
github.com/hyperledger/fabric-amcl v0.0.0-20181230093703-5ccba6eab8d6 // indirect
github.com/miekg/pkcs11 v0.0.0-20190401114359-553cfdd26aaa // indirect
github.com/onsi/gomega v1.5.0 // indirect
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 // indirect
Expand Down
4 changes: 4 additions & 0 deletions test/fixtures/testdata/src/github.com/example_pvt_cc/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/hyperledger/fabric v1.4.0 h1:AiOUXysOwh4BmSLZaNzw6ZocZl0uByekPcc+g3PiXH4=
github.com/hyperledger/fabric v1.4.0/go.mod h1:tGFAOCT696D3rG0Vofd2dyWYLySHlh0aQjf7Q1HAju0=
github.com/hyperledger/fabric-amcl v0.0.0-20181230093703-5ccba6eab8d6 h1:URjjUy3G6zNoODRpSy7FFzJyXh3J4+O5NJPgLY9lWT8=
github.com/hyperledger/fabric-amcl v0.0.0-20181230093703-5ccba6eab8d6/go.mod h1:X+DIyUsaTmalOpmpQfIvFZjKHQedrURQ5t4YqquX7lE=
github.com/ijc/Gotty v0.0.0-20170406111628-a8b993ba6abd h1:anPrsicrIi2ColgWTVPk+TrN42hJIWlfPHSBP9S0ZkM=
github.com/ijc/Gotty v0.0.0-20170406111628-a8b993ba6abd/go.mod h1:3LVOLeyx9XVvwPgrt2be44XgSqndprz1G18rSk8KD84=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
Expand Down Expand Up @@ -101,9 +103,11 @@ go.uber.org/zap v1.9.1 h1:XCJQEf3W6eZaVwhRBof6ImoYGJSITeKWsyeh3HFu/5o=
go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190103213133-ff983b9c42bc h1:F5tKCVGp+MUAHhKp5MZtGqAlGX3+oCsiL1Q629FL90M=
golang.org/x/crypto v0.0.0-20190103213133-ff983b9c42bc/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down

1 comment on commit 4db5c82

@cuismin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you do
I reported an error while using fabric-sdk-go to create the channel
create channel failed: SendEnvelope failed: calling orderer 'localhost:7050' failed: Orderer Server Status Code: (403) FORBIDDEN. Description: implicit policy evaluated - 0 sub-policies were satisfied, but this policy requires 1 of the 'Writers' sub-policies to be satisfied: permission denied
This problem has been bothering me for two weeks.I haven't found a solution yet.Could this be a bug?I am not the only one who encountered the same problem. I found that many people in the communication group were directly stuck with this problem

Please sign in to comment.