diff --git a/ci/azure-pipelines.yml b/ci/azure-pipelines.yml index 7f108ac1..c97b51ab 100644 --- a/ci/azure-pipelines.yml +++ b/ci/azure-pipelines.yml @@ -4,9 +4,9 @@ name: $(SourceBranchName)-$(Date:yyyyMMdd)$(Rev:.rrr) trigger: -- master +- main pr: -- master +- main variables: GOPATH: $(Agent.BuildDirectory)/go diff --git a/integration/e2e/e2e_test.go b/integration/e2e/e2e_test.go index dd56468a..eb1cfdaa 100644 --- a/integration/e2e/e2e_test.go +++ b/integration/e2e/e2e_test.go @@ -60,6 +60,7 @@ var _ = Describe("EndToEnd", func() { network = nwo.New(helpers.SimpleSoloNetwork(), testDir, client, 30000, components) network.GenerateConfigTree() network.Bootstrap() + network.EventuallyTimeout = 2 * time.Minute networkRunner := network.NetworkGroupRunner() process = ifrit.Invoke(networkRunner) diff --git a/integration/fab3/fab3_suite_test.go b/integration/fab3/fab3_suite_test.go index b2c1116b..7f30d1ee 100644 --- a/integration/fab3/fab3_suite_test.go +++ b/integration/fab3/fab3_suite_test.go @@ -73,6 +73,7 @@ var _ = SynchronizedBeforeSuite(func() []byte { By("setting up the channel") network.CreateAndJoinChannel(orderer, channelName) network.UpdateChannelAnchors(orderer, channelName) + network.EventuallyTimeout = 2 * time.Minute By("deploying the chaincode") chaincode := nwo.Chaincode{ diff --git a/integration/fab3/web3_test.go b/integration/fab3/web3_test.go index b44485c7..1d4b7c81 100644 --- a/integration/fab3/web3_test.go +++ b/integration/fab3/web3_test.go @@ -20,7 +20,7 @@ import ( . "github.com/onsi/gomega" ) -const Web3EventuallyTimeout = 5 * time.Minute +const Web3EventuallyTimeout = 7 * time.Minute const Web3EventuallyPollingInterval = 1 * time.Second var _ = Describe("Web3 Integration", func() { diff --git a/integration/go.mod b/integration/go.mod index 62f5dcb6..08135b47 100644 --- a/integration/go.mod +++ b/integration/go.mod @@ -22,3 +22,5 @@ replace github.com/go-kit/kit => github.com/go-kit/kit v0.7.0 replace github.com/hyperledger/burrow => github.com/hyperledger/burrow v0.24.4 replace github.com/fsouza/go-dockerclient => github.com/fsouza/go-dockerclient v1.3.0 + +replace github.com/hyperledger/fabric => github.com/hyperledger/fabric v1.4.4-0.20200211223613-5eaae3a9940d diff --git a/integration/go.sum b/integration/go.sum index f0204f9d..3f0da4e2 100644 --- a/integration/go.sum +++ b/integration/go.sum @@ -151,6 +151,8 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/hyperledger/burrow v0.24.4/go.mod h1:rTFvZkaFrD4uLqMmhmB4wBlXNu/MTuwNVAIkYwBp7t4= 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 v1.4.4-0.20200211223613-5eaae3a9940d h1:bUzlvQfQiZGXCwFMcgg/fZFKmy4YNbcZmPr6XJhqdNU= +github.com/hyperledger/fabric v1.4.4-0.20200211223613-5eaae3a9940d/go.mod h1:tGFAOCT696D3rG0Vofd2dyWYLySHlh0aQjf7Q1HAju0= github.com/hyperledger/fabric-amcl v0.0.0-20190902191507-f66264322317 h1:7BDH7PcKavbYYdH6Oo1rOAlftTbC4FuzRsvqAldw12w= github.com/hyperledger/fabric-amcl v0.0.0-20190902191507-f66264322317/go.mod h1:X+DIyUsaTmalOpmpQfIvFZjKHQedrURQ5t4YqquX7lE= github.com/hyperledger/fabric-lib-go v1.0.0 h1:UL1w7c9LvHZUSkIvHTDGklxFv2kTeva1QI2emOVc324= @@ -264,6 +266,7 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/sykesm/zap-logfmt v0.0.2 h1:czSzn+PIXCOAP/4NAIHTTziIKB8201PzoDkKTn+VR/8= github.com/sykesm/zap-logfmt v0.0.2/go.mod h1:TerDJT124HaO8UTpZ2wJCipJRAKQ9XONM1mzUabIh6M= github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965 h1:1oFLiOyVl+W7bnBzGhf7BbIv9loSFQcieWWYIjLqcAw= github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= diff --git a/integration/vendor/github.com/hyperledger/fabric/bccsp/factory/factory.go b/integration/vendor/github.com/hyperledger/fabric/bccsp/factory/factory.go index 824462e7..0075fa7b 100644 --- a/integration/vendor/github.com/hyperledger/fabric/bccsp/factory/factory.go +++ b/integration/vendor/github.com/hyperledger/fabric/bccsp/factory/factory.go @@ -58,7 +58,7 @@ type BCCSPFactory interface { // GetDefault returns a non-ephemeral (long-term) BCCSP func GetDefault() bccsp.BCCSP { if defaultBCCSP == nil { - logger.Warning("Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.") + logger.Debug("Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.") bootBCCSPInitOnce.Do(func() { var err error f := &SWFactory{} diff --git a/integration/vendor/github.com/hyperledger/fabric/bccsp/pkcs11/pkcs11.go b/integration/vendor/github.com/hyperledger/fabric/bccsp/pkcs11/pkcs11.go index 702bdc83..657f1f96 100644 --- a/integration/vendor/github.com/hyperledger/fabric/bccsp/pkcs11/pkcs11.go +++ b/integration/vendor/github.com/hyperledger/fabric/bccsp/pkcs11/pkcs11.go @@ -258,7 +258,10 @@ func (csp *impl) generateECKey(curve asn1.ObjectIdentifier, ephemeral bool) (ski return nil, nil, fmt.Errorf("P11: keypair generate failed [%s]", err) } - ecpt, _, _ := ecPoint(p11lib, session, pub) + ecpt, _, err := ecPoint(p11lib, session, pub) + if err != nil { + return nil, nil, fmt.Errorf("Error querying EC-point: [%s]", err) + } hash := sha256.Sum256(ecpt) ski = hash[:] diff --git a/integration/vendor/github.com/hyperledger/fabric/common/crypto/expiration.go b/integration/vendor/github.com/hyperledger/fabric/common/crypto/expiration.go index 2055ff13..d3d5d2b1 100644 --- a/integration/vendor/github.com/hyperledger/fabric/common/crypto/expiration.go +++ b/integration/vendor/github.com/hyperledger/fabric/common/crypto/expiration.go @@ -23,7 +23,11 @@ func ExpiresAt(identityBytes []byte) time.Time { if err := proto.Unmarshal(identityBytes, sId); err != nil { return time.Time{} } - bl, _ := pem.Decode(sId.IdBytes) + return certExpirationTime(sId.IdBytes) +} + +func certExpirationTime(pemBytes []byte) time.Time { + bl, _ := pem.Decode(pemBytes) if bl == nil { // If the identity isn't a PEM block, we make no decisions about the expiration time return time.Time{} @@ -34,3 +38,60 @@ func ExpiresAt(identityBytes []byte) time.Time { } return cert.NotAfter } + +// WarnFunc notifies a warning happened with the given format, and can be replaced with Warnf of a logger. +type WarnFunc func(format string, args ...interface{}) + +// Scheduler invokes f after d time, and can be replaced with time.AfterFunc. +type Scheduler func(d time.Duration, f func()) *time.Timer + +// TrackExpiration warns a week before one of the certificates expires +func TrackExpiration(tls bool, serverCert []byte, clientCertChain [][]byte, sIDBytes []byte, warn WarnFunc, now time.Time, s Scheduler) { + sID := &msp.SerializedIdentity{} + if err := proto.Unmarshal(sIDBytes, sID); err != nil { + return + } + + trackCertExpiration(sID.IdBytes, "enrollment", warn, now, s) + + if !tls { + return + } + + trackCertExpiration(serverCert, "server TLS", warn, now, s) + + if len(clientCertChain) == 0 || len(clientCertChain[0]) == 0 { + return + } + + trackCertExpiration(clientCertChain[0], "client TLS", warn, now, s) +} + +func trackCertExpiration(rawCert []byte, certRole string, warn WarnFunc, now time.Time, sched Scheduler) { + expirationTime := certExpirationTime(rawCert) + if expirationTime.IsZero() { + // If the certificate expiration time cannot be classified, return. + return + } + + timeLeftUntilExpiration := expirationTime.Sub(now) + oneWeek := time.Hour * 24 * 7 + + if timeLeftUntilExpiration < 0 { + warn("The %s certificate has expired", certRole) + return + } + + if timeLeftUntilExpiration < oneWeek { + days := timeLeftUntilExpiration / (time.Hour * 24) + hours := (timeLeftUntilExpiration - (days * time.Hour * 24)) / time.Hour + warn("The %s certificate expires within %d days and %d hours", certRole, days, hours) + return + } + + timeLeftUntilOneWeekBeforeExpiration := timeLeftUntilExpiration - oneWeek + + sched(timeLeftUntilOneWeekBeforeExpiration, func() { + warn("The %s certificate will expire within one week", certRole) + }) +} diff --git a/integration/vendor/github.com/hyperledger/fabric/common/flogging/core.go b/integration/vendor/github.com/hyperledger/fabric/common/flogging/core.go index c56d5b6a..2e031735 100644 --- a/integration/vendor/github.com/hyperledger/fabric/common/flogging/core.go +++ b/integration/vendor/github.com/hyperledger/fabric/common/flogging/core.go @@ -15,10 +15,11 @@ type Encoding int8 const ( CONSOLE = iota JSON + LOGFMT ) // EncodingSelector is used to determine whether log records are -// encoded as JSON or in a human readable CONSOLE format. +// encoded as JSON or in human readable CONSOLE or LOGFMT formats. type EncodingSelector interface { Encoding() Encoding } @@ -49,6 +50,14 @@ type Core struct { Encoders map[Encoding]zapcore.Encoder Selector EncodingSelector Output zapcore.WriteSyncer + Observer Observer +} + +//go:generate counterfeiter -o mock/observer.go -fake-name Observer . Observer + +type Observer interface { + Check(e zapcore.Entry, ce *zapcore.CheckedEntry) + WriteEntry(e zapcore.Entry, fields []zapcore.Field) } func (c *Core) With(fields []zapcore.Field) zapcore.Core { @@ -65,10 +74,15 @@ func (c *Core) With(fields []zapcore.Field) zapcore.Core { Encoders: clones, Selector: c.Selector, Output: c.Output, + Observer: c.Observer, } } func (c *Core) Check(e zapcore.Entry, ce *zapcore.CheckedEntry) *zapcore.CheckedEntry { + if c.Observer != nil { + c.Observer.Check(e, ce) + } + if c.Enabled(e.Level) && c.Levels.Level(e.LoggerName).Enabled(e.Level) { return ce.AddCore(e, c) } @@ -93,6 +107,10 @@ func (c *Core) Write(e zapcore.Entry, fields []zapcore.Field) error { c.Sync() } + if c.Observer != nil { + c.Observer.WriteEntry(e, fields) + } + return nil } diff --git a/integration/vendor/github.com/hyperledger/fabric/common/flogging/fabenc/encoder.go b/integration/vendor/github.com/hyperledger/fabric/common/flogging/fabenc/encoder.go index 79d918d8..4d19a098 100644 --- a/integration/vendor/github.com/hyperledger/fabric/common/flogging/fabenc/encoder.go +++ b/integration/vendor/github.com/hyperledger/fabric/common/flogging/fabenc/encoder.go @@ -10,6 +10,7 @@ import ( "io" "time" + zaplogfmt "github.com/sykesm/zap-logfmt" "go.uber.org/zap/buffer" "go.uber.org/zap/zapcore" ) @@ -29,7 +30,7 @@ type Formatter interface { func NewFormatEncoder(formatters ...Formatter) *FormatEncoder { return &FormatEncoder{ - Encoder: zapcore.NewConsoleEncoder(zapcore.EncoderConfig{ + Encoder: zaplogfmt.NewEncoder(zapcore.EncoderConfig{ MessageKey: "", // disable LevelKey: "", // disable TimeKey: "", // disable diff --git a/integration/vendor/github.com/hyperledger/fabric/common/flogging/loggerlevels.go b/integration/vendor/github.com/hyperledger/fabric/common/flogging/loggerlevels.go index 92b65f75..8af426f8 100644 --- a/integration/vendor/github.com/hyperledger/fabric/common/flogging/loggerlevels.go +++ b/integration/vendor/github.com/hyperledger/fabric/common/flogging/loggerlevels.go @@ -19,11 +19,11 @@ import ( // LoggerLevels tracks the logging level of named loggers. type LoggerLevels struct { + mutex sync.RWMutex + levelCache map[string]zapcore.Level + specs map[string]zapcore.Level defaultLevel zapcore.Level - - mutex sync.RWMutex - levelCache map[string]zapcore.Level - specs map[string]zapcore.Level + minLevel zapcore.Level } // DefaultLevel returns the default logging level for loggers that do not have @@ -80,6 +80,14 @@ func (l *LoggerLevels) ActivateSpec(spec string) error { } } + minLevel := defaultLevel + for _, lvl := range specs { + if lvl < minLevel { + minLevel = lvl + } + } + + l.minLevel = minLevel l.defaultLevel = defaultLevel l.specs = specs l.levelCache = map[string]zapcore.Level{} @@ -155,3 +163,12 @@ func (l *LoggerLevels) Spec() string { return strings.Join(fields, ":") } + +// Enabled function is an enabled check that evaluates the minimum active logging level. +// It serves as a fast check before the (relatively) expensive Check call in the core. +func (l *LoggerLevels) Enabled(lvl zapcore.Level) bool { + l.mutex.RLock() + enabled := l.minLevel.Enabled(lvl) + l.mutex.RUnlock() + return enabled +} diff --git a/integration/vendor/github.com/hyperledger/fabric/common/flogging/logging.go b/integration/vendor/github.com/hyperledger/fabric/common/flogging/logging.go index a2047408..92128cf8 100644 --- a/integration/vendor/github.com/hyperledger/fabric/common/flogging/logging.go +++ b/integration/vendor/github.com/hyperledger/fabric/common/flogging/logging.go @@ -14,6 +14,7 @@ import ( "github.com/hyperledger/fabric/common/flogging/fabenc" logging "github.com/op/go-logging" + zaplogfmt "github.com/sykesm/zap-logfmt" "go.uber.org/zap" "go.uber.org/zap/zapcore" ) @@ -52,6 +53,7 @@ type Logging struct { encoderConfig zapcore.EncoderConfig multiFormatter *fabenc.MultiFormatter writer zapcore.WriteSyncer + observer Observer } // New creates a new logging system and initializes it with the provided @@ -100,9 +102,10 @@ func (s *Logging) Apply(c Config) error { s.SetWriter(c.Writer) var formatter logging.Formatter - if s.Encoding() == JSON { + switch s.Encoding() { + case JSON, LOGFMT: formatter = SetFormat(defaultFormat) - } else { + default: formatter = SetFormat(c.Format) } @@ -127,6 +130,11 @@ func (s *Logging) SetFormat(format string) error { return nil } + if format == "logfmt" { + s.encoding = LOGFMT + return nil + } + formatters, err := fabenc.ParseFormat(format) if err != nil { return err @@ -156,6 +164,14 @@ func (s *Logging) SetWriter(w io.Writer) { s.mutex.Unlock() } +// SetObserver is used to provide a log observer that will be called as log +// levels are checked or written.. Only a single observer is supported. +func (s *Logging) SetObserver(observer Observer) { + s.mutex.Lock() + s.observer = observer + s.mutex.Unlock() +} + // Write satisfies the io.Write contract. It delegates to the writer argument // of SetWriter or the Writer field of Config. The Core uses this when encoding // log records. @@ -193,27 +209,44 @@ func (s *Logging) ZapLogger(name string) *zap.Logger { panic(fmt.Sprintf("invalid logger name: %s", name)) } - // always return true here because the core's Check() - // method computes the level for the logger name based - // on the active logging spec - levelEnabler := zap.LevelEnablerFunc(func(l zapcore.Level) bool { return true }) - s.mutex.RLock() core := &Core{ - LevelEnabler: levelEnabler, + LevelEnabler: s.LoggerLevels, Levels: s.LoggerLevels, Encoders: map[Encoding]zapcore.Encoder{ JSON: zapcore.NewJSONEncoder(s.encoderConfig), CONSOLE: fabenc.NewFormatEncoder(s.multiFormatter), + LOGFMT: zaplogfmt.NewEncoder(s.encoderConfig), }, Selector: s, Output: s, + Observer: s, } s.mutex.RUnlock() return NewZapLogger(core).Named(name) } +func (s *Logging) Check(e zapcore.Entry, ce *zapcore.CheckedEntry) { + s.mutex.RLock() + observer := s.observer + s.mutex.RUnlock() + + if observer != nil { + observer.Check(e, ce) + } +} + +func (s *Logging) WriteEntry(e zapcore.Entry, fields []zapcore.Field) { + s.mutex.RLock() + observer := s.observer + s.mutex.RUnlock() + + if observer != nil { + observer.WriteEntry(e, fields) + } +} + // Logger instantiates a new FabricLogger with the specified name. The name is // used to determine which log levels are enabled. func (s *Logging) Logger(name string) *FabricLogger { diff --git a/integration/vendor/github.com/hyperledger/fabric/common/metadata/metadata.go b/integration/vendor/github.com/hyperledger/fabric/common/metadata/metadata.go index 9ab19797..86b5e49c 100644 --- a/integration/vendor/github.com/hyperledger/fabric/common/metadata/metadata.go +++ b/integration/vendor/github.com/hyperledger/fabric/common/metadata/metadata.go @@ -9,7 +9,7 @@ package metadata // Variables defined by the Makefile and passed in with ldflags var Version string = "latest" var CommitSHA string = "development build" -var BaseVersion string = "0.4.14" +var BaseVersion string = "0.4.18" var BaseDockerLabel string = "org.hyperledger.fabric" var DockerNamespace string = "hyperledger" var BaseDockerNamespace string = "hyperledger" diff --git a/integration/vendor/github.com/hyperledger/fabric/core/container/util/writer.go b/integration/vendor/github.com/hyperledger/fabric/core/container/util/writer.go index cd10d2ac..b4893a6b 100644 --- a/integration/vendor/github.com/hyperledger/fabric/core/container/util/writer.go +++ b/integration/vendor/github.com/hyperledger/fabric/core/container/util/writer.go @@ -55,6 +55,10 @@ func WriteFolderToTarPackage(tw *tar.Writer, srcPath string, excludeDirs []strin rootDirLen := len(rootDirectory) walkFn := func(localpath string, info os.FileInfo, err error) error { + if err != nil { + vmLogger.Errorf("Visit %s failed: %s", localpath, err) + return err + } // If localpath includes .git, ignore if strings.Contains(localpath, ".git") { @@ -211,7 +215,15 @@ func WriteStreamToPackage(is io.Reader, localpath string, packagepath string, tw func WriteBytesToPackage(name string, payload []byte, tw *tar.Writer) error { //Make headers identical by using zero time var zeroTime time.Time - tw.WriteHeader(&tar.Header{Name: name, Size: int64(len(payload)), ModTime: zeroTime, AccessTime: zeroTime, ChangeTime: zeroTime}) + tw.WriteHeader( + &tar.Header{ + Name: name, + Size: int64(len(payload)), + ModTime: zeroTime, + AccessTime: zeroTime, + ChangeTime: zeroTime, + Mode: 0100644, + }) tw.Write(payload) return nil diff --git a/integration/vendor/github.com/hyperledger/fabric/integration/nwo/commands/configtxgen.go b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/commands/configtxgen.go index 116c67f8..33e29d8b 100644 --- a/integration/vendor/github.com/hyperledger/fabric/integration/nwo/commands/configtxgen.go +++ b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/commands/configtxgen.go @@ -31,6 +31,7 @@ type CreateChannelTx struct { Profile string ConfigPath string OutputCreateChannelTx string + BaseProfile string } func (c CreateChannelTx) SessionName() string { @@ -43,6 +44,7 @@ func (c CreateChannelTx) Args() []string { "-profile", c.Profile, "-configPath", c.ConfigPath, "-outputCreateChannelTx", c.OutputCreateChannelTx, + "-channelCreateTxBaseProfile", c.BaseProfile, } } diff --git a/integration/vendor/github.com/hyperledger/fabric/integration/nwo/commands/cryptogen.go b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/commands/cryptogen.go index 6fbd03d8..f36c166f 100644 --- a/integration/vendor/github.com/hyperledger/fabric/integration/nwo/commands/cryptogen.go +++ b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/commands/cryptogen.go @@ -22,3 +22,20 @@ func (c Generate) Args() []string { "--output", c.Output, } } + +type Extend struct { + Config string + Input string +} + +func (c Extend) SessionName() string { + return "cryptogen-extend" +} + +func (c Extend) Args() []string { + return []string{ + "extend", + "--config", c.Config, + "--input", c.Input, + } +} diff --git a/integration/vendor/github.com/hyperledger/fabric/integration/nwo/commands/peer.go b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/commands/peer.go index 6e8b2eb7..6da903c6 100644 --- a/integration/vendor/github.com/hyperledger/fabric/integration/nwo/commands/peer.go +++ b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/commands/peer.go @@ -6,25 +6,52 @@ SPDX-License-Identifier: Apache-2.0 package commands +import "strconv" + type NodeStart struct { PeerID string - Dir string } func (n NodeStart) SessionName() string { return n.PeerID } -func (n NodeStart) WorkingDir() string { - return n.Dir -} - func (n NodeStart) Args() []string { return []string{ "node", "start", } } +type NodeReset struct { +} + +func (n NodeReset) SessionName() string { + return "peer-node-reset" +} + +func (n NodeReset) Args() []string { + return []string{ + "node", "reset", + } +} + +type NodeRollback struct { + ChannelID string + BlockNumber int +} + +func (n NodeRollback) SessionName() string { + return "peer-node-rollback" +} + +func (n NodeRollback) Args() []string { + return []string{ + "node", "rollback", + "--channelID", n.ChannelID, + "--blockNumber", strconv.Itoa(n.BlockNumber), + } +} + type ChannelCreate struct { ChannelID string Orderer string @@ -43,6 +70,7 @@ func (c ChannelCreate) Args() []string { "--orderer", c.Orderer, "--file", c.File, "--outputBlock", c.OutputBlock, + "--timeout", "15s", } } diff --git a/integration/vendor/github.com/hyperledger/fabric/integration/nwo/configblock.go b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/configblock.go index cdf33fc6..91227c45 100644 --- a/integration/vendor/github.com/hyperledger/fabric/integration/nwo/configblock.go +++ b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/configblock.go @@ -7,30 +7,35 @@ SPDX-License-Identifier: Apache-2.0 package nwo import ( + "bytes" + "fmt" "io/ioutil" "os" "path/filepath" + "strings" "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric/common/tools/configtxlator/update" "github.com/hyperledger/fabric/integration/nwo/commands" "github.com/hyperledger/fabric/protos/common" + "github.com/hyperledger/fabric/protos/msp" + protosorderer "github.com/hyperledger/fabric/protos/orderer" + ectdraft_protos "github.com/hyperledger/fabric/protos/orderer/etcdraft" "github.com/hyperledger/fabric/protos/utils" . "github.com/onsi/gomega" "github.com/onsi/gomega/gbytes" "github.com/onsi/gomega/gexec" ) -// GetConfigBlock retrieves the current config block for a channel and -// unmarshals it. -func GetConfigBlock(n *Network, peer *Peer, orderer *Orderer, channel string) *common.Config { +// GetConfigBlock retrieves the current config block for a channel +func GetConfigBlock(n *Network, peer *Peer, orderer *Orderer, channel string) *common.Block { tempDir, err := ioutil.TempDir("", "getConfigBlock") Expect(err).NotTo(HaveOccurred()) defer os.RemoveAll(tempDir) // fetch the config block output := filepath.Join(tempDir, "config_block.pb") - sess, err := n.PeerAdminSession(peer, commands.ChannelFetch{ + sess, err := n.OrdererAdminSession(orderer, peer, commands.ChannelFetch{ ChannelID: channel, Block: "config", Orderer: n.OrdererAddress(orderer, ListenPort), @@ -42,7 +47,12 @@ func GetConfigBlock(n *Network, peer *Peer, orderer *Orderer, channel string) *c // unmarshal the config block bytes configBlock := UnmarshalBlockFromFile(output) + return configBlock +} +// GetConfig retrieves the last config of the given channel +func GetConfig(n *Network, peer *Peer, orderer *Orderer, channel string) *common.Config { + configBlock := GetConfigBlock(n, peer, orderer, channel) // unmarshal the envelope bytes envelope, err := utils.GetEnvelopeFromBlock(configBlock.Data.Data[0]) Expect(err).NotTo(HaveOccurred()) @@ -62,7 +72,7 @@ func GetConfigBlock(n *Network, peer *Peer, orderer *Orderer, channel string) *c // UpdateConfig computes, signs, and submits a configuration update and waits // for the update to complete. -func UpdateConfig(n *Network, orderer *Orderer, channel string, current, updated *common.Config, submitter *Peer, additionalSigners ...*Peer) { +func UpdateConfig(n *Network, orderer *Orderer, channel string, current, updated *common.Config, getConfigBlockFromOrderer bool, submitter *Peer, additionalSigners ...*Peer) { tempDir, err := ioutil.TempDir("", "updateConfig") Expect(err).NotTo(HaveOccurred()) defer os.RemoveAll(tempDir) @@ -93,8 +103,13 @@ func UpdateConfig(n *Network, orderer *Orderer, channel string, current, updated Eventually(sess, n.EventuallyTimeout).Should(gexec.Exit(0)) } + var currentBlockNumber uint64 // get current configuration block number - currentBlockNumber := CurrentConfigBlockNumber(n, submitter, orderer, channel) + if getConfigBlockFromOrderer { + currentBlockNumber = CurrentConfigBlockNumber(n, submitter, orderer, channel) + } else { + currentBlockNumber = CurrentConfigBlockNumber(n, submitter, nil, channel) + } sess, err := n.PeerAdminSession(submitter, commands.ChannelUpdate{ ChannelID: channel, @@ -105,9 +120,18 @@ func UpdateConfig(n *Network, orderer *Orderer, channel string, current, updated Eventually(sess, n.EventuallyTimeout).Should(gexec.Exit(0)) Expect(sess.Err).To(gbytes.Say("Successfully submitted channel update")) - // wait for the block to be committed - ccb := func() uint64 { return CurrentConfigBlockNumber(n, submitter, orderer, channel) } - Eventually(ccb, n.EventuallyTimeout).Should(BeNumerically(">", currentBlockNumber)) + if getConfigBlockFromOrderer { + ccb := func() uint64 { return CurrentConfigBlockNumber(n, submitter, orderer, channel) } + Eventually(ccb, n.EventuallyTimeout).Should(BeNumerically(">", currentBlockNumber)) + return + } + + // wait for the block to be committed to all peers that + // have joined the channel + for _, peer := range n.PeersWithChannel(channel) { + ccb := func() uint64 { return CurrentConfigBlockNumber(n, peer, nil, channel) } + Eventually(ccb, n.EventuallyTimeout).Should(BeNumerically(">", currentBlockNumber)) + } } // UpdateOrdererConfig computes, signs, and submits a configuration update which requires orderers signature and waits @@ -115,8 +139,118 @@ func UpdateConfig(n *Network, orderer *Orderer, channel string, current, updated func UpdateOrdererConfig(n *Network, orderer *Orderer, channel string, current, updated *common.Config, submitter *Peer, additionalSigners ...*Orderer) { tempDir, err := ioutil.TempDir("", "updateConfig") Expect(err).NotTo(HaveOccurred()) + updateFile := filepath.Join(tempDir, "update.pb") defer os.RemoveAll(tempDir) + ComputeUpdateOrdererConfig(updateFile, n, channel, current, updated, submitter, additionalSigners...) + + currentBlockNumber := CurrentConfigBlockNumber(n, submitter, orderer, channel) + + Eventually(func() string { + sess, err := n.OrdererAdminSession(orderer, submitter, commands.ChannelUpdate{ + ChannelID: channel, + Orderer: n.OrdererAddress(orderer, ListenPort), + File: updateFile, + }) + if err != nil { + return err.Error() + } + sess.Wait(n.EventuallyTimeout) + if sess.ExitCode() != 0 { + return fmt.Sprintf("exit code is %d", sess.ExitCode()) + } + if strings.Contains(string(sess.Err.Contents()), "Successfully submitted channel update") { + return "" + } + return fmt.Sprintf("channel update output: %s", string(sess.Err.Contents())) + }, n.EventuallyTimeout).Should(BeEmpty()) + + // wait for the block to be committed + ccb := func() uint64 { return CurrentConfigBlockNumber(n, submitter, orderer, channel) } + Eventually(ccb, n.EventuallyTimeout).Should(BeNumerically(">", currentBlockNumber)) +} + +// CurrentConfigBlockNumber retrieves the block number from the header of the +// current config block. This can be used to detect when configuration change +// has completed. If an orderer is not provided, the current config block will +// be fetched from the peer. +func CurrentConfigBlockNumber(n *Network, peer *Peer, orderer *Orderer, channel string) uint64 { + tempDir, err := ioutil.TempDir("", "currentConfigBlock") + Expect(err).NotTo(HaveOccurred()) + defer os.RemoveAll(tempDir) + + // fetch the config block + output := filepath.Join(tempDir, "config_block.pb") + if orderer == nil { + return CurrentConfigBlockNumberFromPeer(n, peer, channel, output) + } + + FetchConfigBlock(n, peer, orderer, channel, output) + + // unmarshal the config block bytes + configBlock := UnmarshalBlockFromFile(output) + + return configBlock.Header.Number +} + +// CurrentConfigBlockNumberFromPeer retrieves the block number from the header +// of the peer's current config block. +func CurrentConfigBlockNumberFromPeer(n *Network, peer *Peer, channel, output string) uint64 { + sess, err := n.PeerAdminSession(peer, commands.ChannelFetch{ + ChannelID: channel, + Block: "config", + OutputFile: output, + }) + Expect(err).NotTo(HaveOccurred()) + Eventually(sess, n.EventuallyTimeout).Should(gexec.Exit(0)) + Expect(sess.Err).To(gbytes.Say("Received block: ")) + + configBlock := UnmarshalBlockFromFile(output) + + return configBlock.Header.Number +} + +// FetchConfigBlock fetches latest config block. +func FetchConfigBlock(n *Network, peer *Peer, orderer *Orderer, channel string, output string) { + fetch := func() int { + sess, err := n.OrdererAdminSession(orderer, peer, commands.ChannelFetch{ + ChannelID: channel, + Block: "config", + Orderer: n.OrdererAddress(orderer, ListenPort), + OutputFile: output, + }) + Expect(err).NotTo(HaveOccurred()) + code := sess.Wait(n.EventuallyTimeout).ExitCode() + if code == 0 { + Expect(sess.Err).To(gbytes.Say("Received block: ")) + } + return code + } + Eventually(fetch, n.EventuallyTimeout).Should(Equal(0)) +} + +// UpdateOrdererConfigFail computes, signs, and submits a configuration update which requires orderers signature +// and waits for the update to FAIL. +func UpdateOrdererConfigFail(n *Network, orderer *Orderer, channel string, current, updated *common.Config, submitter *Peer, additionalSigners ...*Orderer) { + tempDir, err := ioutil.TempDir("", "updateConfig") + Expect(err).NotTo(HaveOccurred()) + updateFile := filepath.Join(tempDir, "update.pb") + defer os.RemoveAll(tempDir) + + ComputeUpdateOrdererConfig(updateFile, n, channel, current, updated, submitter, additionalSigners...) + + //session should not return with a zero exit code nor with a success response + sess, err := n.OrdererAdminSession(orderer, submitter, commands.ChannelUpdate{ + ChannelID: channel, + Orderer: n.OrdererAddress(orderer, ListenPort), + File: updateFile, + }) + Expect(err).NotTo(HaveOccurred()) + Eventually(sess, n.EventuallyTimeout).ShouldNot(gexec.Exit(0)) + Expect(sess.Err).NotTo(gbytes.Say("Successfully submitted channel update")) +} + +func ComputeUpdateOrdererConfig(updateFile string, n *Network, channel string, current, updated *common.Config, submitter *Peer, additionalSigners ...*Orderer) { // compute update configUpdate, err := update.Compute(current, updated) Expect(err).NotTo(HaveOccurred()) @@ -133,7 +267,6 @@ func UpdateOrdererConfig(n *Network, orderer *Orderer, channel string, current, Expect(err).NotTo(HaveOccurred()) Expect(signedEnvelope).NotTo(BeNil()) - updateFile := filepath.Join(tempDir, "update.pb") err = ioutil.WriteFile(updateFile, utils.MarshalOrPanic(signedEnvelope), 0600) Expect(err).NotTo(HaveOccurred()) @@ -142,56 +275,102 @@ func UpdateOrdererConfig(n *Network, orderer *Orderer, channel string, current, Expect(err).NotTo(HaveOccurred()) Eventually(sess, n.EventuallyTimeout).Should(gexec.Exit(0)) } +} - // get current configuration block number - currentBlockNumber := CurrentConfigBlockNumber(n, submitter, orderer, channel) +// UnmarshalBlockFromFile unmarshals a proto encoded block from a file. +func UnmarshalBlockFromFile(blockFile string) *common.Block { + blockBytes, err := ioutil.ReadFile(blockFile) + Expect(err).NotTo(HaveOccurred()) - sess, err := n.PeerAdminSession(submitter, commands.ChannelUpdate{ - ChannelID: channel, - Orderer: n.OrdererAddress(orderer, ListenPort), - File: updateFile, - }) + block, err := utils.UnmarshalBlock(blockBytes) Expect(err).NotTo(HaveOccurred()) - Eventually(sess, n.EventuallyTimeout).Should(gexec.Exit(0)) - Expect(sess.Err).To(gbytes.Say("Successfully submitted channel update")) - // wait for the block to be committed - ccb := func() uint64 { return CurrentConfigBlockNumber(n, submitter, orderer, channel) } - Eventually(ccb, n.EventuallyTimeout).Should(BeNumerically(">", currentBlockNumber)) + return block } -// CurrentConfigBlockNumber retrieves the block number from the header of the -// current config block. This can be used to detect whena configuration change -// has completed. -func CurrentConfigBlockNumber(n *Network, peer *Peer, orderer *Orderer, channel string) uint64 { - tempDir, err := ioutil.TempDir("", "currentConfigBlock") - Expect(err).NotTo(HaveOccurred()) - defer os.RemoveAll(tempDir) +// AddConsenter adds a new consenter to the given channel +func AddConsenter(n *Network, peer *Peer, orderer *Orderer, channel string, consenter ectdraft_protos.Consenter) { + UpdateEtcdRaftMetadata(n, peer, orderer, channel, func(metadata *ectdraft_protos.ConfigMetadata) { + metadata.Consenters = append(metadata.Consenters, &consenter) + }) +} - // fetch the config block - output := filepath.Join(tempDir, "config_block.pb") - sess, err := n.PeerAdminSession(peer, commands.ChannelFetch{ - ChannelID: channel, - Block: "config", - Orderer: n.OrdererAddress(orderer, ListenPort), - OutputFile: output, +// RemoveConsenter removes a consenter with the given certificate in PEM format from the given channel +func RemoveConsenter(n *Network, peer *Peer, orderer *Orderer, channel string, certificate []byte) { + UpdateEtcdRaftMetadata(n, peer, orderer, channel, func(metadata *ectdraft_protos.ConfigMetadata) { + var newConsenters []*ectdraft_protos.Consenter + for _, consenter := range metadata.Consenters { + if bytes.Equal(consenter.ClientTlsCert, certificate) || bytes.Equal(consenter.ServerTlsCert, certificate) { + continue + } + newConsenters = append(newConsenters, consenter) + } + + metadata.Consenters = newConsenters }) +} + +// ConsensusMetadataMutator receives ConsensusType.Metadata and mutates it +type ConsensusMetadataMutator func([]byte) []byte + +// MSPMutator receives FabricMSPConfig and mutates it. +type MSPMutator func(config msp.FabricMSPConfig) msp.FabricMSPConfig + +// UpdateConsensusMetadata executes a config update that updates the consensus metadata according to the given ConsensusMetadataMutator +func UpdateConsensusMetadata(network *Network, peer *Peer, orderer *Orderer, channel string, mutateMetadata ConsensusMetadataMutator) { + config := GetConfig(network, peer, orderer, channel) + updatedConfig := proto.Clone(config).(*common.Config) + + consensusTypeConfigValue := updatedConfig.ChannelGroup.Groups["Orderer"].Values["ConsensusType"] + consensusTypeValue := &protosorderer.ConsensusType{} + err := proto.Unmarshal(consensusTypeConfigValue.Value, consensusTypeValue) Expect(err).NotTo(HaveOccurred()) - Eventually(sess, n.EventuallyTimeout).Should(gexec.Exit(0)) - Expect(sess.Err).To(gbytes.Say("Received block: ")) - // unmarshal the config block bytes - configBlock := UnmarshalBlockFromFile(output) - return configBlock.Header.Number + consensusTypeValue.Metadata = mutateMetadata(consensusTypeValue.Metadata) + + updatedConfig.ChannelGroup.Groups["Orderer"].Values["ConsensusType"] = &common.ConfigValue{ + ModPolicy: "Admins", + Value: utils.MarshalOrPanic(consensusTypeValue), + } + + UpdateOrdererConfig(network, orderer, channel, config, updatedConfig, peer, orderer) } -// UnmarshalBlockFromFile unmarshals a proto encoded block from a file. -func UnmarshalBlockFromFile(blockFile string) *common.Block { - blockBytes, err := ioutil.ReadFile(blockFile) +// UpdateEtcdRaftMetadata executes a config update that updates the etcdraft metadata according to the given function f +func UpdateEtcdRaftMetadata(network *Network, peer *Peer, orderer *Orderer, channel string, f func(md *ectdraft_protos.ConfigMetadata)) { + UpdateConsensusMetadata(network, peer, orderer, channel, func(originalMetadata []byte) []byte { + metadata := &ectdraft_protos.ConfigMetadata{} + err := proto.Unmarshal(originalMetadata, metadata) + Expect(err).NotTo(HaveOccurred()) + + f(metadata) + + newMetadata, err := proto.Marshal(metadata) + Expect(err).NotTo(HaveOccurred()) + return newMetadata + }) +} + +func UpdateOrdererMSP(network *Network, peer *Peer, orderer *Orderer, channel, orgID string, mutateMSP MSPMutator) { + config := GetConfig(network, peer, orderer, channel) + updatedConfig := proto.Clone(config).(*common.Config) + + // Unpack the MSP config + rawMSPConfig := updatedConfig.ChannelGroup.Groups["Orderer"].Groups[orgID].Values["MSP"] + mspConfig := &msp.MSPConfig{} + err := proto.Unmarshal(rawMSPConfig.Value, mspConfig) Expect(err).NotTo(HaveOccurred()) - block, err := utils.UnmarshalBlock(blockBytes) + fabricConfig := &msp.FabricMSPConfig{} + err = proto.Unmarshal(mspConfig.Config, fabricConfig) Expect(err).NotTo(HaveOccurred()) - return block + // Mutate it as we are asked + *fabricConfig = mutateMSP(*fabricConfig) + + // Wrap it back into the config + mspConfig.Config = utils.MarshalOrPanic(fabricConfig) + rawMSPConfig.Value = utils.MarshalOrPanic(mspConfig) + + UpdateOrdererConfig(network, orderer, channel, config, updatedConfig, peer, orderer) } diff --git a/integration/vendor/github.com/hyperledger/fabric/integration/nwo/configtx_template.go b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/configtx_template.go index 68df4fdc..84adab07 100644 --- a/integration/vendor/github.com/hyperledger/fabric/integration/nwo/configtx_template.go +++ b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/configtx_template.go @@ -43,11 +43,14 @@ Organizations:{{ range .PeerOrgs }} Admins: Type: Signature Rule: OR('{{.MSPID}}.admin') + OrdererEndpoints:{{ range $w.OrderersInOrg .Name }} + - 127.0.0.1:{{ $w.OrdererPort . "Listen" }} + {{- end }} {{ end }} Channel: &ChannelDefaults Capabilities: - V1_3: true + V1_4_3: true Policies: Readers: Type: ImplicitMeta @@ -61,19 +64,10 @@ Channel: &ChannelDefaults Profiles:{{ range .Profiles }} {{ .Name }}: - {{- if .Orderers }} <<: *ChannelDefaults - Consortiums:{{ range $w.Consortiums }} - {{ .Name }}: - Organizations:{{ range .Organizations }} - - *{{ ($w.Organization .).MSPID }} - {{- end }} - {{- end }} + {{- if .Orderers }} Orderer: OrdererType: {{ $w.Consensus.Type }} - Addresses:{{ range .Orderers }}{{ with $w.Orderer . }} - - 127.0.0.1:{{ $w.OrdererPort . "Listen" }} - {{- end }}{{ end }} BatchTimeout: 1s BatchSize: MaxMessageCount: 1 @@ -81,6 +75,7 @@ Profiles:{{ range .Profiles }} PreferredMaxBytes: 512 KB Capabilities: V1_1: true + {{- if eq $w.Consensus.Type "kafka" }} Kafka: Brokers:{{ range $w.BrokerAddresses "HostPort" }} @@ -90,10 +85,11 @@ Profiles:{{ range .Profiles }} {{- if eq $w.Consensus.Type "etcdraft" }} EtcdRaft: Options: - SnapshotInterval: 5 + TickInterval: 500ms + SnapshotIntervalSize: 1 KB Consenters:{{ range .Orderers }}{{ with $w.Orderer . }} - Host: 127.0.0.1 - Port: {{ $w.OrdererPort . "Listen" }} + Port: {{ $w.OrdererPort . "Cluster" }} ClientTLSCert: {{ $w.OrdererLocalCryptoDir . "tls" }}/server.crt ServerTLSCert: {{ $w.OrdererLocalCryptoDir . "tls" }}/server.crt {{- end }}{{- end }} @@ -114,7 +110,9 @@ Profiles:{{ range .Profiles }} BlockValidation: Type: ImplicitMeta Rule: ANY Writers - {{- else }} + {{- end }} + {{- if .Consortium }} + Consortium: {{ .Consortium }} Application: Capabilities: V1_3: true @@ -132,7 +130,19 @@ Profiles:{{ range .Profiles }} Admins: Type: ImplicitMeta Rule: MAJORITY Admins - Consortium: {{ .Consortium }} + LifecycleEndorsement: + Type: ImplicitMeta + Rule: "MAJORITY Endorsement" + Endorsement: + Type: ImplicitMeta + Rule: "MAJORITY Endorsement" + {{- else }} + Consortiums:{{ range $w.Consortiums }} + {{ .Name }}: + Organizations:{{ range .Organizations }} + - *{{ ($w.Organization .).MSPID }} + {{- end }} + {{- end }} {{- end }} {{- end }} {{ end }} diff --git a/integration/vendor/github.com/hyperledger/fabric/integration/nwo/core_template.go b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/core_template.go index d59e22b3..f964b859 100644 --- a/integration/vendor/github.com/hyperledger/fabric/integration/nwo/core_template.go +++ b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/core_template.go @@ -103,6 +103,7 @@ peer: enabled: false listenAddress: 127.0.0.1:{{ .PeerPort Peer "ProfilePort" }} adminService: + listenAddress: 127.0.0.1:{{ .PeerPort Peer "AdminServicePort" }} handlers: authFilters: - name: DefaultAuth diff --git a/integration/vendor/github.com/hyperledger/fabric/integration/nwo/deploy.go b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/deploy.go index 30284d6b..dc45d6d2 100644 --- a/integration/vendor/github.com/hyperledger/fabric/integration/nwo/deploy.go +++ b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/deploy.go @@ -11,7 +11,10 @@ import ( "io/ioutil" "os" + "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric/integration/nwo/commands" + "github.com/hyperledger/fabric/protos/common" + "github.com/hyperledger/fabric/protos/utils" . "github.com/onsi/gomega" "github.com/onsi/gomega/gbytes" "github.com/onsi/gomega/gexec" @@ -155,3 +158,62 @@ func listInstantiated(n *Network, peer *Peer, channel string) func() *gbytes.Buf return sess.Buffer() } } + +// EnableCapabilities enables a specific capabilities flag for a running network. +// It generates the config update using the first peer, signs the configuration +// with the subsequent peers, and then submits the config update using the +// first peer. +func EnableCapabilities(network *Network, channel, capabilitiesGroup, capabilitiesVersion string, orderer *Orderer, peers ...*Peer) { + if len(peers) == 0 { + return + } + + config := GetConfig(network, peers[0], orderer, channel) + updatedConfig := proto.Clone(config).(*common.Config) + + updatedConfig.ChannelGroup.Groups[capabilitiesGroup].Values["Capabilities"] = &common.ConfigValue{ + ModPolicy: "Admins", + Value: utils.MarshalOrPanic( + &common.Capabilities{ + Capabilities: map[string]*common.Capability{ + capabilitiesVersion: {}, + }, + }, + ), + } + + UpdateConfig(network, orderer, channel, config, updatedConfig, false, peers[0], peers...) +} + +// EnableCapabilitiesOrdererAdmin enables a specific capabilities flag for a running network, +// using an Orderer Admin Session. This is required to make changes on the system channel, for example. +func EnableCapabilitiesOrdererAdmin(network *Network, channel, capabilitiesGroup, capabilitiesVersion string, orderer *Orderer, peer *Peer, additionalSigners ...*Orderer) { + config := GetConfig(network, peer, orderer, channel) + updatedConfig := proto.Clone(config).(*common.Config) + + if capabilitiesGroup == "Channel" { + updatedConfig.ChannelGroup.Values["Capabilities"] = &common.ConfigValue{ + ModPolicy: "Admins", + Value: utils.MarshalOrPanic( + &common.Capabilities{ + Capabilities: map[string]*common.Capability{ + capabilitiesVersion: {}, + }, + }, + ), + } + } else { + updatedConfig.ChannelGroup.Groups[capabilitiesGroup].Values["Capabilities"] = &common.ConfigValue{ + ModPolicy: "Admins", + Value: utils.MarshalOrPanic( + &common.Capabilities{ + Capabilities: map[string]*common.Capability{ + capabilitiesVersion: {}, + }, + }, + ), + } + } + + UpdateOrdererConfig(network, orderer, channel, config, updatedConfig, peer, additionalSigners...) +} diff --git a/integration/vendor/github.com/hyperledger/fabric/integration/nwo/fabricconfig/configtx.go b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/fabricconfig/configtx.go new file mode 100644 index 00000000..05d46732 --- /dev/null +++ b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/fabricconfig/configtx.go @@ -0,0 +1,132 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package fabricconfig + +import "time" + +type ConfigTx struct { + Organizations []*Organization `yaml:"Organizations,omitempty"` + Capabilities *Capabilities `yaml:"Capabilities,omitempty"` + Application *Application `yaml:"Application,omitempty"` + Orderer *ConfigTxOrderer `yaml:"Orderer,omitempty"` + Channel *Channel `yaml:"Channel,omitempty"` + Profiles map[string]*Channel `yaml:"Profiles,omitempty"` + + ExtraProperties map[string]interface{} `yaml:",inline,omitempty"` +} + +type Organization struct { + Name string `yaml:"Name,omitempty"` + SkipAsForeign bool `yaml:"SkipAsForeign,omitempty"` + ID string `yaml:"ID,omitempty"` + MSPDir string `yaml:"MSPDir,omitempty"` + Policies map[string]*Policy `yaml:"Policies,omitempty"` + OrdererEndpoints []string `yaml:"OrdererEndpoints,omitempty"` + AnchorPeers []*AnchorPeer `yaml:"AnchorPeers,omitempty"` + + ExtraProperties map[string]interface{} `yaml:",inline,omitempty"` +} + +type Policy struct { + Type string `yaml:"Type,omitempty"` + Rule string `yaml:"Rule,omitempty"` + + ExtraProperties map[string]interface{} `yaml:",inline,omitempty"` +} + +type Capabilities struct { + Channel map[string]bool `yaml:"Channel,omitempty"` + Orderer map[string]bool `yaml:"Orderer,omitempty"` + Application map[string]bool `yaml:"Application,omitempty"` + + ExtraProperties map[string]interface{} `yaml:",inline,omitempty"` +} + +type AnchorPeer struct { + Host string `yaml:"Host,omitempty"` + Port int `yaml:"Port,omitempty"` + + ExtraProperties map[string]interface{} `yaml:",inline,omitempty"` +} + +type Application struct { + ACLs map[string]string `yaml:"ACLs,omitempty"` + Organizations []*Organization `yaml:"Organizations,omitempty"` + Policies map[string]*Policy `yaml:"Policies,omitempty"` + Capabilities map[string]bool `yaml:"Capabilities,omitempty"` + + ExtraProperties map[string]interface{} `yaml:",inline,omitempty"` +} + +type ConfigTxOrderer struct { + OrdererType string `yaml:"OrdererType,omitempty"` + BatchTimeout time.Duration `yaml:"BatchTimeout,omitempty"` + BatchSize *BatchSize `yaml:"BatchSize,omitempty"` + Kafka *ConfigTxKafka `yaml:"Kafka,omitempty"` + EtcdRaft *ConfigTxEtcdRaft `yaml:"EtcdRaft,omitempty"` + Organizations []*Organization `yaml:"Organizations,omitempty"` + Policies map[string]*Policy `yaml:"Policies,omitempty"` + Capabilities map[string]bool `yaml:"Capabilities,omitempty"` + + ExtraProperties map[string]interface{} `yaml:",inline,omitempty"` +} + +type BatchSize struct { + MaxMessageCount string `yaml:"MaxMessageCount,omitempty"` + AbsoluteMaxBytes string `yaml:"AbsoluteMaxBytes,omitempty"` + PreferredMaxBytes string `yaml:"PreferredMaxBytes,omitempty"` + + ExtraProperties map[string]interface{} `yaml:",inline,omitempty"` +} + +type ConfigTxKafka struct { + Brokers []string `yaml:"Brokers,omitempty"` + + ExtraProperties map[string]interface{} `yaml:",inline,omitempty"` +} + +type ConfigTxEtcdRaft struct { + Consenters []*Consenter `yaml:"Consenters,omitempty"` + Options *EtcdRaftOptions `yaml:"EtcdRaftOptions,omitempty"` + + ExtraProperties map[string]interface{} `yaml:",inline,omitempty"` +} + +type Consenter struct { + Host string `yaml:"Host,omitempty"` + Port int `yaml:"Port,omitempty"` + ClientTLSCert string `yaml:"ClientTLSCert,omitempty"` + ServerTLSCert string `yaml:"ServerTLSCert,omitempty"` + + ExtraProperties map[string]interface{} `yaml:",inline,omitempty"` +} + +type EtcdRaftOptions struct { + TickInterval string `yaml:"TickInterval,omitempty"` + ElectionTick string `yaml:"ElectionTick,omitempty"` + HeartbeatTick string `yaml:"HeartbeatTick,omitempty"` + MaxInflightBlocks string `yaml:"MaxInflightBlocks,omitempty"` + SnapshotIntervalSize string `yaml:"SnapshotIntervalSize,omitempty"` + + ExtraProperties map[string]interface{} `yaml:",inline,omitempty"` +} + +type Channel struct { + Orderer *ConfigTxOrderer `yaml:"Orderer,omitempty"` + Application *Application `yaml:"Application,omitempty"` + Policies map[string]*Policy `yaml:"Policies,omitempty"` + Capabilities map[string]bool `yaml:"Capabilities,omitempty"` + Consortiums map[string]*Consortium `yaml:"Consortiums,omitempty"` + + ExtraProperties map[string]interface{} `yaml:",inline,omitempty"` +} + +type Consortium struct { + Organizations []*Organization `yaml:"Organizations,omitempty"` + + ExtraProperties map[string]interface{} `yaml:",inline,omitempty"` +} diff --git a/integration/vendor/github.com/hyperledger/fabric/integration/nwo/fabricconfig/core.go b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/fabricconfig/core.go index 048ab547..ad5a49f9 100644 --- a/integration/vendor/github.com/hyperledger/fabric/integration/nwo/fabricconfig/core.go +++ b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/fabricconfig/core.go @@ -152,7 +152,14 @@ type SoftwareProvider struct { } type DeliveryClient struct { - ReconnectTotalTimeThreshold time.Duration `yaml:"reconnectTotalTimeThreshold,omitempty"` + ReconnectTotalTimeThreshold time.Duration `yaml:"reconnectTotalTimeThreshold,omitempty"` + AddressOverrides []*AddressOverride `yaml:"addressOverrides,omitempty"` +} + +type AddressOverride struct { + From string `yaml:"from"` + To string `yaml:"to"` + CACertsFile string `yaml:"caCertsFile"` } type Service struct { diff --git a/integration/vendor/github.com/hyperledger/fabric/integration/nwo/network.go b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/network.go index 4fd9a98d..2d6d572b 100644 --- a/integration/vendor/github.com/hyperledger/fabric/integration/nwo/network.go +++ b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/network.go @@ -14,13 +14,14 @@ import ( "os" "os/exec" "path/filepath" + "sort" "strconv" "strings" "syscall" "text/template" "time" - "github.com/fsouza/go-dockerclient" + docker "github.com/fsouza/go-dockerclient" "github.com/hyperledger/fabric/integration/helpers" "github.com/hyperledger/fabric/integration/nwo/commands" "github.com/hyperledger/fabric/integration/nwo/fabricconfig" @@ -73,8 +74,9 @@ type SystemChannel struct { // Channel associates a channel name with a configtxgen profile name. type Channel struct { - Name string `yaml:"name,omitempty"` - Profile string `yaml:"profile,omitempty"` + Name string `yaml:"name,omitempty"` + Profile string `yaml:"profile,omitempty"` + BaseProfile string `yaml:"baseprofile,omitempty"` } // Orderer defines an orderer instance and its owning organization. @@ -88,6 +90,10 @@ func (o Orderer) ID() string { return fmt.Sprintf("%s.%s", o.Organization, o.Name) } +type OrdererCapabilities struct { + V2_0 bool `yaml:"v20,omitempty"` +} + // Peer defines a peer instance, it's owning organization, and the list of // channels that the peer shoudl be joined to. type Peer struct { @@ -144,6 +150,7 @@ type Network struct { SystemChannel *SystemChannel Channels []*Channel Consensus *Consensus + OrdererCap *OrdererCapabilities Orderers []*Orderer Peers []*Peer Profiles []*Profile @@ -276,6 +283,28 @@ func (n *Network) WriteOrdererConfig(o *Orderer, config *fabricconfig.Orderer) { Expect(err).NotTo(HaveOccurred()) } +// ReadConfigTxConfig unmarshals the configtx.yaml and returns an +// object approximating its contents. +func (n *Network) ReadConfigTxConfig() *fabricconfig.ConfigTx { + var configtx fabricconfig.ConfigTx + configtxBytes, err := ioutil.ReadFile(n.ConfigTxConfigPath()) + Expect(err).NotTo(HaveOccurred()) + + err = yaml.Unmarshal(configtxBytes, &configtx) + Expect(err).NotTo(HaveOccurred()) + + return &configtx +} + +// WriteConfigTxConfig serializes the provided configuration to configtx.yaml. +func (n *Network) WriteConfigTxConfig(config *fabricconfig.ConfigTx) { + configtxBytes, err := yaml.Marshal(config) + Expect(err).NotTo(HaveOccurred()) + + err = ioutil.WriteFile(n.ConfigTxConfigPath(), configtxBytes, 0644) + Expect(err).NotTo(HaveOccurred()) +} + // PeerDir returns the path to the configuration directory for the specified // Peer. func (n *Network) PeerDir(p *Peer) string { @@ -374,6 +403,19 @@ func (n *Network) PeerUserCert(p *Peer, user string) string { ) } +// OrdererUserCert returns the path to the certificate for the specified user in +// the orderer organization. +func (n *Network) OrdererUserCert(o *Orderer, user string) string { + org := n.Organization(o.Organization) + Expect(org).NotTo(BeNil()) + + return filepath.Join( + n.OrdererUserMSPDir(o, user), + "signcerts", + fmt.Sprintf("%s@%s-cert.pem", user, org.Domain), + ) +} + // PeerUserKey returns the path to the private key for the specified user in // the peer organization. func (n *Network) PeerUserKey(p *Peer, user string) string { @@ -393,6 +435,25 @@ func (n *Network) PeerUserKey(p *Peer, user string) string { return filepath.Join(keystore, keys[0].Name()) } +// OrdererUserKey returns the path to the private key for the specified user in +// the orderer organization. +func (n *Network) OrdererUserKey(o *Orderer, user string) string { + org := n.Organization(o.Organization) + Expect(org).NotTo(BeNil()) + + keystore := filepath.Join( + n.OrdererUserMSPDir(o, user), + "keystore", + ) + + // file names are the SKI and non-deterministic + keys, err := ioutil.ReadDir(keystore) + Expect(err).NotTo(HaveOccurred()) + Expect(keys).To(HaveLen(1)) + + return filepath.Join(keystore, keys[0].Name()) +} + // peerLocalCryptoDir returns the path to the local crypto directory for the peer. func (n *Network) peerLocalCryptoDir(p *Peer, cryptoType string) string { org := n.Organization(p.Organization) @@ -575,6 +636,7 @@ func (n *Network) Bootstrap() { sess, err := n.ConfigTxGen(commands.CreateChannelTx{ ChannelID: c.Name, Profile: c.Profile, + BaseProfile: c.BaseProfile, ConfigPath: n.RootDir, OutputCreateChannelTx: n.CreateChannelTxPath(c.Name), }) @@ -582,12 +644,12 @@ func (n *Network) Bootstrap() { Eventually(sess, n.EventuallyTimeout).Should(gexec.Exit(0)) } - n.concatenateTLSCACertificates() + n.ConcatenateTLSCACertificates() } // concatenateTLSCACertificates concatenates all TLS CA certificates into a // single file to be used by peer CLI. -func (n *Network) concatenateTLSCACertificates() { +func (n *Network) ConcatenateTLSCACertificates() { bundle := &bytes.Buffer{} for _, tlsCertPath := range n.listTLSCACertificates() { certBytes, err := ioutil.ReadFile(tlsCertPath) @@ -714,24 +776,87 @@ func (n *Network) UpdateChannelAnchors(o *Orderer, channelName string) { // CreateChannel will submit an existing create channel transaction to the // specified orderer. The channel transaction must exist at the location -// returned by CreateChannelTxPath. +// returned by CreateChannelTxPath. Optionally, additional signers may be +// included in the case where the channel creation tx modifies other +// aspects of the channel config for the new channel. // // The orderer must be running when this is called. -func (n *Network) CreateChannel(channelName string, o *Orderer, p *Peer) { +func (n *Network) CreateChannel(channelName string, o *Orderer, p *Peer, additionalSigners ...interface{}) { + channelCreateTxPath := n.CreateChannelTxPath(channelName) + + for _, signer := range additionalSigners { + switch t := signer.(type) { + case *Peer: + sess, err := n.PeerAdminSession(t, commands.SignConfigTx{ + File: channelCreateTxPath, + }) + Expect(err).NotTo(HaveOccurred()) + Eventually(sess, n.EventuallyTimeout).Should(gexec.Exit(0)) + case *Orderer: + sess, err := n.OrdererAdminSession(t, p, commands.SignConfigTx{ + File: channelCreateTxPath, + }) + Expect(err).NotTo(HaveOccurred()) + Eventually(sess, n.EventuallyTimeout).Should(gexec.Exit(0)) + default: + panic("unknown signer type, expect Peer or Orderer") + } + } + createChannel := func() int { sess, err := n.PeerAdminSession(p, commands.ChannelCreate{ ChannelID: channelName, Orderer: n.OrdererAddress(o, ListenPort), - File: n.CreateChannelTxPath(channelName), + File: channelCreateTxPath, OutputBlock: "/dev/null", }) Expect(err).NotTo(HaveOccurred()) return sess.Wait(n.EventuallyTimeout).ExitCode() } - Eventually(createChannel, n.EventuallyTimeout).Should(Equal(0)) } +// CreateChannelFail will submit an existing create channel transaction to the +// specified orderer, but expect to FAIL. The channel transaction must exist +// at the location returned by CreateChannelTxPath. +// +// The orderer must be running when this is called. +func (n *Network) CreateChannelFail(channelName string, o *Orderer, p *Peer, additionalSigners ...interface{}) { + channelCreateTxPath := n.CreateChannelTxPath(channelName) + + for _, signer := range additionalSigners { + switch t := signer.(type) { + case *Peer: + sess, err := n.PeerAdminSession(t, commands.SignConfigTx{ + File: channelCreateTxPath, + }) + Expect(err).NotTo(HaveOccurred()) + Eventually(sess, n.EventuallyTimeout).Should(gexec.Exit(0)) + case *Orderer: + sess, err := n.OrdererAdminSession(t, p, commands.SignConfigTx{ + File: channelCreateTxPath, + }) + Expect(err).NotTo(HaveOccurred()) + Eventually(sess, n.EventuallyTimeout).Should(gexec.Exit(0)) + default: + panic("unknown signer type, expect Peer or Orderer") + } + } + + createChannelFail := func() int { + sess, err := n.PeerAdminSession(p, commands.ChannelCreate{ + ChannelID: channelName, + Orderer: n.OrdererAddress(o, ListenPort), + File: channelCreateTxPath, + OutputBlock: "/dev/null", + }) + Expect(err).NotTo(HaveOccurred()) + return sess.Wait(n.EventuallyTimeout).ExitCode() + } + + Eventually(createChannelFail, n.EventuallyTimeout).ShouldNot(Equal(0)) +} + // JoinChannel will join peers to the specified channel. The orderer is used to // obtain the current configuration block for the channel. // @@ -879,7 +1004,8 @@ func (n *Network) OrdererRunner(o *Orderer) *ginkgomon.Runner { StartCheckTimeout: 15 * time.Second, } - if n.Consensus.Brokers != 0 { + //After consensus-type migration, the #brokers is >0, but the type is etcdraft + if n.Consensus.Type == "kafka" && n.Consensus.Brokers != 0 { config.StartCheck = "Start phase completed successfully" config.StartCheckTimeout = 30 * time.Second } @@ -1075,6 +1201,17 @@ func (n *Network) PeersWithChannel(chanName string) []*Peer { } } } + + // This is a bit of a hack to make the output of this function deterministic. + // When this function's output is supplied as input to functions such as ApproveChaincodeForMyOrg + // it causes a different subset of peers to be picked, which can create flakiness in tests. + sort.Slice(peers, func(i, j int) bool { + if peers[i].Organization < peers[j].Organization { + return true + } + + return peers[i].Organization == peers[j].Organization && peers[i].Name < peers[j].Name + }) return peers } @@ -1174,23 +1311,25 @@ type PortName string type Ports map[PortName]uint16 const ( - ChaincodePort PortName = "Chaincode" - EventsPort PortName = "Events" - HostPort PortName = "HostPort" - ListenPort PortName = "Listen" - ProfilePort PortName = "Profile" - OperationsPort PortName = "Operations" + ChaincodePort PortName = "Chaincode" + EventsPort PortName = "Events" + HostPort PortName = "HostPort" + ListenPort PortName = "Listen" + ProfilePort PortName = "Profile" + OperationsPort PortName = "Operations" + AdminServicePort PortName = "AdminService" + ClusterPort PortName = "Cluster" ) // PeerPortNames returns the list of ports that need to be reserved for a Peer. func PeerPortNames() []PortName { - return []PortName{ListenPort, ChaincodePort, EventsPort, ProfilePort, OperationsPort} + return []PortName{ListenPort, ChaincodePort, EventsPort, ProfilePort, OperationsPort, AdminServicePort} } // OrdererPortNames returns the list of ports that need to be reserved for an // Orderer. func OrdererPortNames() []PortName { - return []PortName{ListenPort, ProfilePort, OperationsPort} + return []PortName{ListenPort, ProfilePort, OperationsPort, ClusterPort} } // BrokerPortNames returns the list of ports that need to be reserved for a diff --git a/integration/vendor/github.com/hyperledger/fabric/integration/nwo/orderer_template.go b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/orderer_template.go index d1b1e5a8..a54dd710 100644 --- a/integration/vendor/github.com/hyperledger/fabric/integration/nwo/orderer_template.go +++ b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/orderer_template.go @@ -23,13 +23,15 @@ General: Cluster: ClientCertificate: {{ $w.OrdererLocalTLSDir Orderer }}/server.crt ClientPrivateKey: {{ $w.OrdererLocalTLSDir Orderer }}/server.key + ServerCertificate: {{ $w.OrdererLocalTLSDir Orderer }}/server.crt + ServerPrivateKey: {{ $w.OrdererLocalTLSDir Orderer }}/server.key DialTimeout: 5s RPCTimeout: 7s ReplicationBufferSize: 20971520 ReplicationPullTimeout: 5s ReplicationRetryTimeout: 5s - RootCAs: - - {{ $w.OrdererLocalTLSDir Orderer }}/ca.crt + ListenAddress: 127.0.0.1 + ListenPort: {{ .OrdererPort Orderer "Cluster" }} Keepalive: ServerMinInterval: 60s ServerInterval: 7200s @@ -95,6 +97,7 @@ Debug: Consensus: WALDir: {{ .OrdererDir Orderer }}/etcdraft/wal SnapDir: {{ .OrdererDir Orderer }}/etcdraft/snapshot + EvictionSuspicion: 10s Operations: ListenAddress: 127.0.0.1:{{ .OrdererPort Orderer "Operations" }} TLS: diff --git a/integration/vendor/github.com/hyperledger/fabric/integration/nwo/solo.yaml b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/solo.yaml index c9a5c213..0f9ac202 100644 --- a/integration/vendor/github.com/hyperledger/fabric/integration/nwo/solo.yaml +++ b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/solo.yaml @@ -42,6 +42,9 @@ orderers: - name: orderer0 organization: orderer-org +orderercapabilities: + v20: false + channels: - name: testchannel profile: TwoOrgsChannel diff --git a/integration/vendor/github.com/hyperledger/fabric/integration/nwo/standard_networks.go b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/standard_networks.go index 38c1c630..1fe30955 100644 --- a/integration/vendor/github.com/hyperledger/fabric/integration/nwo/standard_networks.go +++ b/integration/vendor/github.com/hyperledger/fabric/integration/nwo/standard_networks.go @@ -109,6 +109,15 @@ func BasicEtcdRaft() *Config { return config } +func MinimalRaft() *Config { + config := BasicEtcdRaft() + config.Peers[1].Channels = nil + config.Peers[2].Channels = nil + config.Peers[3].Channels = nil + config.Profiles[1].Organizations = []string{"Org1"} + return config +} + func MultiChannelEtcdRaft() *Config { config := BasicSolo() config.Consensus.Type = "etcdraft" diff --git a/integration/vendor/github.com/hyperledger/fabric/msp/configbuilder.go b/integration/vendor/github.com/hyperledger/fabric/msp/configbuilder.go index caaa4e4a..084b7f43 100644 --- a/integration/vendor/github.com/hyperledger/fabric/msp/configbuilder.go +++ b/integration/vendor/github.com/hyperledger/fabric/msp/configbuilder.go @@ -41,6 +41,10 @@ type NodeOUs struct { ClientOUIdentifier *OrganizationalUnitIdentifiersConfiguration `yaml:"ClientOUIdentifier,omitempty"` // PeerOUIdentifier specifies how to recognize peers by OU PeerOUIdentifier *OrganizationalUnitIdentifiersConfiguration `yaml:"PeerOUIdentifier,omitempty"` + // AdminOUIdentifier specifies how to recognize admins by OU + AdminOUIdentifier *OrganizationalUnitIdentifiersConfiguration `yaml:"AdminOUIdentifier,omitempty"` + // OrdererOUIdentifier specifies how to recognize admins by OU + OrdererOUIdentifier *OrganizationalUnitIdentifiersConfiguration `yaml:"OrdererOUIdentifier,omitempty"` } // Configuration represents the accessory configuration an MSP can be equipped with. @@ -217,7 +221,7 @@ func getMspConfig(dir string, ID string, sigid *msp.SigningIdentityInfo) (*msp.M } admincert, err := getPemMaterialFromDir(admincertDir) - if err != nil || len(admincert) == 0 { + if err != nil && !os.IsNotExist(err) { return nil, errors.WithMessage(err, fmt.Sprintf("could not load a valid admin certificate from directory %s", admincertDir)) } @@ -292,37 +296,39 @@ func getMspConfig(dir string, ID string, sigid *msp.SigningIdentityInfo) (*msp.M // Prepare NodeOUs if configuration.NodeOUs != nil && configuration.NodeOUs.Enable { mspLogger.Debug("Loading NodeOUs") - if configuration.NodeOUs.ClientOUIdentifier == nil || len(configuration.NodeOUs.ClientOUIdentifier.OrganizationalUnitIdentifier) == 0 { - return nil, errors.New("Failed loading NodeOUs. ClientOU must be different from nil.") + nodeOUs = &msp.FabricNodeOUs{ + Enable: true, } - if configuration.NodeOUs.PeerOUIdentifier == nil || len(configuration.NodeOUs.PeerOUIdentifier.OrganizationalUnitIdentifier) == 0 { - return nil, errors.New("Failed loading NodeOUs. PeerOU must be different from nil.") + if configuration.NodeOUs.ClientOUIdentifier != nil && len(configuration.NodeOUs.ClientOUIdentifier.OrganizationalUnitIdentifier) != 0 { + nodeOUs.ClientOuIdentifier = &msp.FabricOUIdentifier{OrganizationalUnitIdentifier: configuration.NodeOUs.ClientOUIdentifier.OrganizationalUnitIdentifier} } - - nodeOUs = &msp.FabricNodeOUs{ - Enable: configuration.NodeOUs.Enable, - ClientOuIdentifier: &msp.FabricOUIdentifier{OrganizationalUnitIdentifier: configuration.NodeOUs.ClientOUIdentifier.OrganizationalUnitIdentifier}, - PeerOuIdentifier: &msp.FabricOUIdentifier{OrganizationalUnitIdentifier: configuration.NodeOUs.PeerOUIdentifier.OrganizationalUnitIdentifier}, + if configuration.NodeOUs.PeerOUIdentifier != nil && len(configuration.NodeOUs.PeerOUIdentifier.OrganizationalUnitIdentifier) != 0 { + nodeOUs.PeerOuIdentifier = &msp.FabricOUIdentifier{OrganizationalUnitIdentifier: configuration.NodeOUs.PeerOUIdentifier.OrganizationalUnitIdentifier} + } + if configuration.NodeOUs.AdminOUIdentifier != nil && len(configuration.NodeOUs.AdminOUIdentifier.OrganizationalUnitIdentifier) != 0 { + nodeOUs.AdminOuIdentifier = &msp.FabricOUIdentifier{OrganizationalUnitIdentifier: configuration.NodeOUs.AdminOUIdentifier.OrganizationalUnitIdentifier} + } + if configuration.NodeOUs.OrdererOUIdentifier != nil && len(configuration.NodeOUs.OrdererOUIdentifier.OrganizationalUnitIdentifier) != 0 { + nodeOUs.OrdererOuIdentifier = &msp.FabricOUIdentifier{OrganizationalUnitIdentifier: configuration.NodeOUs.OrdererOUIdentifier.OrganizationalUnitIdentifier} } // Read certificates, if defined // ClientOU - f := filepath.Join(dir, configuration.NodeOUs.ClientOUIdentifier.Certificate) - raw, err = readFile(f) - if err != nil { - mspLogger.Infof("Failed loading ClientOU certificate at [%s]: [%s]", f, err) - } else { - nodeOUs.ClientOuIdentifier.Certificate = raw + if nodeOUs.ClientOuIdentifier != nil { + nodeOUs.ClientOuIdentifier.Certificate = loadCertificateAt(dir, configuration.NodeOUs.ClientOUIdentifier.Certificate, "ClientOU") } - // PeerOU - f = filepath.Join(dir, configuration.NodeOUs.PeerOUIdentifier.Certificate) - raw, err = readFile(f) - if err != nil { - mspLogger.Debugf("Failed loading PeerOU certificate at [%s]: [%s]", f, err) - } else { - nodeOUs.PeerOuIdentifier.Certificate = raw + if nodeOUs.PeerOuIdentifier != nil { + nodeOUs.PeerOuIdentifier.Certificate = loadCertificateAt(dir, configuration.NodeOUs.PeerOUIdentifier.Certificate, "PeerOU") + } + // AdminOU + if nodeOUs.AdminOuIdentifier != nil { + nodeOUs.AdminOuIdentifier.Certificate = loadCertificateAt(dir, configuration.NodeOUs.AdminOUIdentifier.Certificate, "AdminOU") + } + // OrdererOU + if nodeOUs.OrdererOuIdentifier != nil { + nodeOUs.OrdererOuIdentifier.Certificate = loadCertificateAt(dir, configuration.NodeOUs.OrdererOUIdentifier.Certificate, "OrdererOU") } } } else { @@ -357,6 +363,18 @@ func getMspConfig(dir string, ID string, sigid *msp.SigningIdentityInfo) (*msp.M return mspconf, nil } +func loadCertificateAt(dir, certificatePath string, ouType string) []byte { + f := filepath.Join(dir, certificatePath) + raw, err := readFile(f) + if err != nil { + mspLogger.Infof("Failed loading %s certificate at [%s]: [%s]", ouType, f, err) + } else { + return raw + } + + return nil +} + const ( IdemixConfigDirMsp = "msp" IdemixConfigDirUser = "user" diff --git a/integration/vendor/github.com/hyperledger/fabric/msp/factory.go b/integration/vendor/github.com/hyperledger/fabric/msp/factory.go index d3e9c5da..c3d5965b 100644 --- a/integration/vendor/github.com/hyperledger/fabric/msp/factory.go +++ b/integration/vendor/github.com/hyperledger/fabric/msp/factory.go @@ -16,6 +16,7 @@ const ( MSPv1_0 = iota MSPv1_1 MSPv1_3 + MSPv1_4_3 ) // NewOpts represent @@ -54,11 +55,15 @@ func New(opts NewOpts) (MSP, error) { return newBccspMsp(MSPv1_1) case MSPv1_3: return newBccspMsp(MSPv1_3) + case MSPv1_4_3: + return newBccspMsp(MSPv1_4_3) default: return nil, errors.Errorf("Invalid *BCCSPNewOpts. Version not recognized [%v]", opts.GetVersion()) } case *IdemixNewOpts: switch opts.GetVersion() { + case MSPv1_4_3: + fallthrough case MSPv1_3: return newIdemixMsp(MSPv1_3) case MSPv1_1: diff --git a/integration/vendor/github.com/hyperledger/fabric/msp/mspimpl.go b/integration/vendor/github.com/hyperledger/fabric/msp/mspimpl.go index 4e959d25..eda59dc2 100644 --- a/integration/vendor/github.com/hyperledger/fabric/msp/mspimpl.go +++ b/integration/vendor/github.com/hyperledger/fabric/msp/mspimpl.go @@ -31,6 +31,9 @@ type validateIdentityOUsFuncType func(id *identity) error // satisfiesPrincipalInternalFuncType is the prototype of the function to check if principals are satisfied type satisfiesPrincipalInternalFuncType func(id Identity, principal *m.MSPPrincipal) error +//setupAdminInternalFuncType is a prototype of the function to setup the admins +type setupAdminInternalFuncType func(conf *m.FabricMSPConfig) error + // This is an instantiation of an MSP that // uses BCCSP for its cryptographic primitives. type bccspmsp struct { @@ -47,6 +50,9 @@ type bccspmsp struct { // internalSatisfiesPrincipalInternalFunc is the pointer to the function to check if principals are satisfied internalSatisfiesPrincipalInternalFunc satisfiesPrincipalInternalFuncType + // internalSetupAdmin is the pointer to the function that setup the administrators of this msp + internalSetupAdmin setupAdminInternalFuncType + // list of CA certs we trust rootCerts []Identity @@ -91,9 +97,9 @@ type bccspmsp struct { // NodeOUs configuration ouEnforcement bool - // These are the OUIdentifiers of the clients, peers and orderers. + // These are the OUIdentifiers of the clients, peers, admins and orderers. // They are used to tell apart these entities - clientOU, peerOU *OUIdentifier + clientOU, peerOU, adminOU, ordererOU *OUIdentifier } // newBccspMsp returns an MSP instance backed up by a BCCSP @@ -112,14 +118,22 @@ func newBccspMsp(version MSPVersion) (MSP, error) { theMsp.internalSetupFunc = theMsp.setupV1 theMsp.internalValidateIdentityOusFunc = theMsp.validateIdentityOUsV1 theMsp.internalSatisfiesPrincipalInternalFunc = theMsp.satisfiesPrincipalInternalPreV13 + theMsp.internalSetupAdmin = theMsp.setupAdminsPreV143 case MSPv1_1: theMsp.internalSetupFunc = theMsp.setupV11 theMsp.internalValidateIdentityOusFunc = theMsp.validateIdentityOUsV11 theMsp.internalSatisfiesPrincipalInternalFunc = theMsp.satisfiesPrincipalInternalPreV13 + theMsp.internalSetupAdmin = theMsp.setupAdminsPreV143 case MSPv1_3: theMsp.internalSetupFunc = theMsp.setupV11 theMsp.internalValidateIdentityOusFunc = theMsp.validateIdentityOUsV11 theMsp.internalSatisfiesPrincipalInternalFunc = theMsp.satisfiesPrincipalInternalV13 + theMsp.internalSetupAdmin = theMsp.setupAdminsPreV143 + case MSPv1_4_3: + theMsp.internalSetupFunc = theMsp.setupV143 + theMsp.internalValidateIdentityOusFunc = theMsp.validateIdentityOUsV143 + theMsp.internalSatisfiesPrincipalInternalFunc = theMsp.satisfiesPrincipalInternalV143 + theMsp.internalSetupAdmin = theMsp.setupAdminsV143 default: return nil, errors.Errorf("Invalid MSP version [%v]", version) } @@ -312,23 +326,34 @@ func (msp *bccspmsp) hasOURole(id Identity, mspRole m.MSPRole_MSPRoleType) error } func (msp *bccspmsp) hasOURoleInternal(id *identity, mspRole m.MSPRole_MSPRoleType) error { - var nodeOUValue string + var nodeOU *OUIdentifier switch mspRole { case m.MSPRole_CLIENT: - nodeOUValue = msp.clientOU.OrganizationalUnitIdentifier + nodeOU = msp.clientOU case m.MSPRole_PEER: - nodeOUValue = msp.peerOU.OrganizationalUnitIdentifier + nodeOU = msp.peerOU + case m.MSPRole_ADMIN: + nodeOU = msp.adminOU + case m.MSPRole_ORDERER: + nodeOU = msp.ordererOU default: - return fmt.Errorf("Invalid MSPRoleType. It must be CLIENT, PEER or ORDERER") + return errors.New("Invalid MSPRoleType. It must be CLIENT, PEER, ADMIN or ORDERER") + } + + // Notice that, for versions prior to v1.4.3, hasOURoleInternal is invoked + // only to check that an identity is a client or a peer. The relative nodeOU are supposed to be different from nil. + // For version >= v1.4.3, any classification is optional. + if nodeOU == nil { + return errors.Errorf("cannot test for classification, node ou for type [%s], not defined, msp: [%s]", mspRole, msp.name) } for _, OU := range id.GetOrganizationalUnits() { - if OU.OrganizationalUnitIdentifier == nodeOUValue { + if OU.OrganizationalUnitIdentifier == nodeOU.OrganizationalUnitIdentifier { return nil } } - return fmt.Errorf("The identity does not contain OU [%s], MSP: [%s]", mspRole, msp.name) + return errors.Errorf("The identity does not contain OU [%s], MSP: [%s]", mspRole, msp.name) } // DeserializeIdentity returns an Identity given the byte-level @@ -459,13 +484,8 @@ func (msp *bccspmsp) satisfiesPrincipalInternalPreV13(id Identity, principal *m. mspLogger.Debugf("Checking if identity satisfies ADMIN role for %s", msp.name) // in the case of admin, we check that the // id is exactly one of our admins - for _, admincert := range msp.admins { - if bytes.Equal(id.(*identity).cert.Raw, admincert.(*identity).cert.Raw) { - // we do not need to check whether the admin is a valid identity - // according to this MSP, since we already check this at Setup time - // if there is a match, we can just return - return nil - } + if msp.isInAdmins(id.(*identity)) { + return nil } return errors.New("This identity is not an admin") case m.MSPRole_CLIENT: @@ -561,6 +581,85 @@ func (msp *bccspmsp) satisfiesPrincipalInternalV13(id Identity, principal *m.MSP } } +// satisfiesPrincipalInternalV143 takes as arguments the identity and the principal. +// The function returns an error if one occurred. +// The function implements the additional behavior expected of an MSP starting from v2.0. +// For v1.3 functionality, the function calls the satisfiesPrincipalInternalPreV13. +func (msp *bccspmsp) satisfiesPrincipalInternalV143(id Identity, principal *m.MSPPrincipal) error { + _, okay := id.(*identity) + if !okay { + return errors.New("invalid identity type, expected *identity") + } + + switch principal.PrincipalClassification { + case m.MSPPrincipal_ROLE: + if !msp.ouEnforcement { + break + } + + // Principal contains the msp role + mspRole := &m.MSPRole{} + err := proto.Unmarshal(principal.Principal, mspRole) + if err != nil { + return errors.Wrap(err, "could not unmarshal MSPRole from principal") + } + + // at first, we check whether the MSP + // identifier is the same as that of the identity + if mspRole.MspIdentifier != msp.name { + return errors.Errorf("the identity is a member of a different MSP (expected %s, got %s)", mspRole.MspIdentifier, id.GetMSPIdentifier()) + } + + // now we validate the admin role only, the other roles are left to the v1.3 function + switch mspRole.Role { + case m.MSPRole_ADMIN: + mspLogger.Debugf("Checking if identity has been named explicitly as an admin for %s", msp.name) + // in the case of admin, we check that the + // id is exactly one of our admins + if msp.isInAdmins(id.(*identity)) { + return nil + } + + // or it carries the Admin OU, in this case check that the identity is valid as well. + mspLogger.Debugf("Checking if identity carries the admin ou for %s", msp.name) + if err := msp.Validate(id); err != nil { + return errors.Wrapf(err, "The identity is not valid under this MSP [%s]", msp.name) + } + + if err := msp.hasOURole(id, m.MSPRole_ADMIN); err != nil { + return errors.Wrapf(err, "The identity is not an admin under this MSP [%s]", msp.name) + } + + return nil + case m.MSPRole_ORDERER: + mspLogger.Debugf("Checking if identity satisfies role [%s] for %s", m.MSPRole_MSPRoleType_name[int32(mspRole.Role)], msp.name) + if err := msp.Validate(id); err != nil { + return errors.Wrapf(err, "The identity is not valid under this MSP [%s]", msp.name) + } + + if err := msp.hasOURole(id, mspRole.Role); err != nil { + return errors.Wrapf(err, "The identity is not a [%s] under this MSP [%s]", m.MSPRole_MSPRoleType_name[int32(mspRole.Role)], msp.name) + } + return nil + } + } + + // Use the v1.3 function to check other principal types + return msp.satisfiesPrincipalInternalV13(id, principal) +} + +func (msp *bccspmsp) isInAdmins(id *identity) bool { + for _, admincert := range msp.admins { + if bytes.Equal(id.cert.Raw, admincert.(*identity).cert.Raw) { + // we do not need to check whether the admin is a valid identity + // according to this MSP, since we already check this at Setup time + // if there is a match, we can just return + return true + } + } + return false +} + // getCertificationChain returns the certification chain of the passed identity within this msp func (msp *bccspmsp) getCertificationChain(id Identity) ([]*x509.Certificate, error) { mspLogger.Debugf("MSP %s getting certification chain", msp.name) diff --git a/integration/vendor/github.com/hyperledger/fabric/msp/mspimplsetup.go b/integration/vendor/github.com/hyperledger/fabric/msp/mspimplsetup.go index 4c2105a6..e34d00fc 100644 --- a/integration/vendor/github.com/hyperledger/fabric/msp/mspimplsetup.go +++ b/integration/vendor/github.com/hyperledger/fabric/msp/mspimplsetup.go @@ -163,6 +163,10 @@ func (msp *bccspmsp) setupCAs(conf *m.FabricMSPConfig) error { } func (msp *bccspmsp) setupAdmins(conf *m.FabricMSPConfig) error { + return msp.internalSetupAdmin(conf) +} + +func (msp *bccspmsp) setupAdminsPreV143(conf *m.FabricMSPConfig) error { // make and fill the set of admin certs (if present) msp.admins = make([]Identity, len(conf.Admins)) for i, admCert := range conf.Admins { @@ -177,6 +181,19 @@ func (msp *bccspmsp) setupAdmins(conf *m.FabricMSPConfig) error { return nil } +func (msp *bccspmsp) setupAdminsV143(conf *m.FabricMSPConfig) error { + // make and fill the set of admin certs (if present) + if err := msp.setupAdminsPreV143(conf); err != nil { + return err + } + + if len(msp.admins) == 0 && (!msp.ouEnforcement || msp.adminOU == nil) { + return errors.New("administrators must be declared when no admin ou classification is set") + } + + return nil +} + func (msp *bccspmsp) setupCRLs(conf *m.FabricMSPConfig) error { // setup the CRL (if present) msp.CRL = make([]*pkix.CertificateList, len(conf.RevocationList)) @@ -235,6 +252,14 @@ func (msp *bccspmsp) setupNodeOUs(config *m.FabricMSPConfig) error { msp.ouEnforcement = config.FabricNodeOus.Enable + if config.FabricNodeOus.ClientOuIdentifier == nil || len(config.FabricNodeOus.ClientOuIdentifier.OrganizationalUnitIdentifier) == 0 { + return errors.New("Failed setting up NodeOUs. ClientOU must be different from nil.") + } + + if config.FabricNodeOus.PeerOuIdentifier == nil || len(config.FabricNodeOus.PeerOuIdentifier.OrganizationalUnitIdentifier) == 0 { + return errors.New("Failed setting up NodeOUs. PeerOU must be different from nil.") + } + // ClientOU msp.clientOU = &OUIdentifier{OrganizationalUnitIdentifier: config.FabricNodeOus.ClientOuIdentifier.OrganizationalUnitIdentifier} if len(config.FabricNodeOus.ClientOuIdentifier.Certificate) != 0 { @@ -262,6 +287,83 @@ func (msp *bccspmsp) setupNodeOUs(config *m.FabricMSPConfig) error { return nil } +func (msp *bccspmsp) setupNodeOUsV143(config *m.FabricMSPConfig) error { + if config.FabricNodeOus == nil { + msp.ouEnforcement = false + return nil + } + + msp.ouEnforcement = config.FabricNodeOus.Enable + + counter := 0 + // ClientOU + if config.FabricNodeOus.ClientOuIdentifier != nil { + msp.clientOU = &OUIdentifier{OrganizationalUnitIdentifier: config.FabricNodeOus.ClientOuIdentifier.OrganizationalUnitIdentifier} + if len(config.FabricNodeOus.ClientOuIdentifier.Certificate) != 0 { + certifiersIdentifier, err := msp.getCertifiersIdentifier(config.FabricNodeOus.ClientOuIdentifier.Certificate) + if err != nil { + return err + } + msp.clientOU.CertifiersIdentifier = certifiersIdentifier + } + counter++ + } else { + msp.clientOU = nil + } + + // PeerOU + if config.FabricNodeOus.PeerOuIdentifier != nil { + msp.peerOU = &OUIdentifier{OrganizationalUnitIdentifier: config.FabricNodeOus.PeerOuIdentifier.OrganizationalUnitIdentifier} + if len(config.FabricNodeOus.PeerOuIdentifier.Certificate) != 0 { + certifiersIdentifier, err := msp.getCertifiersIdentifier(config.FabricNodeOus.PeerOuIdentifier.Certificate) + if err != nil { + return err + } + msp.peerOU.CertifiersIdentifier = certifiersIdentifier + } + counter++ + } else { + msp.peerOU = nil + } + + // AdminOU + if config.FabricNodeOus.AdminOuIdentifier != nil { + msp.adminOU = &OUIdentifier{OrganizationalUnitIdentifier: config.FabricNodeOus.AdminOuIdentifier.OrganizationalUnitIdentifier} + if len(config.FabricNodeOus.AdminOuIdentifier.Certificate) != 0 { + certifiersIdentifier, err := msp.getCertifiersIdentifier(config.FabricNodeOus.AdminOuIdentifier.Certificate) + if err != nil { + return err + } + msp.adminOU.CertifiersIdentifier = certifiersIdentifier + } + counter++ + } else { + msp.adminOU = nil + } + + // OrdererOU + if config.FabricNodeOus.OrdererOuIdentifier != nil { + msp.ordererOU = &OUIdentifier{OrganizationalUnitIdentifier: config.FabricNodeOus.OrdererOuIdentifier.OrganizationalUnitIdentifier} + if len(config.FabricNodeOus.OrdererOuIdentifier.Certificate) != 0 { + certifiersIdentifier, err := msp.getCertifiersIdentifier(config.FabricNodeOus.OrdererOuIdentifier.Certificate) + if err != nil { + return err + } + msp.ordererOU.CertifiersIdentifier = certifiersIdentifier + } + counter++ + } else { + msp.ordererOU = nil + } + + if counter == 0 { + // Disable NodeOU + msp.ouEnforcement = false + } + + return nil +} + func (msp *bccspmsp) setupSigningIdentity(conf *m.FabricMSPConfig) error { if conf.SigningIdentity != nil { sid, err := msp.getSigningIdentityFromConf(conf.SigningIdentity) @@ -427,6 +529,55 @@ func (msp *bccspmsp) preSetupV1(conf *m.FabricMSPConfig) error { return nil } +func (msp *bccspmsp) preSetupV143(conf *m.FabricMSPConfig) error { + // setup crypto config + if err := msp.setupCrypto(conf); err != nil { + return err + } + + // Setup CAs + if err := msp.setupCAs(conf); err != nil { + return err + } + + // Setup CRLs + if err := msp.setupCRLs(conf); err != nil { + return err + } + + // Finalize setup of the CAs + if err := msp.finalizeSetupCAs(); err != nil { + return err + } + + // setup the signer (if present) + if err := msp.setupSigningIdentity(conf); err != nil { + return err + } + + // setup TLS CAs + if err := msp.setupTLSCAs(conf); err != nil { + return err + } + + // setup the OUs + if err := msp.setupOUs(conf); err != nil { + return err + } + + // setup NodeOUs + if err := msp.setupNodeOUsV143(conf); err != nil { + return err + } + + // Setup Admins + if err := msp.setupAdmins(conf); err != nil { + return err + } + + return nil +} + func (msp *bccspmsp) postSetupV1(conf *m.FabricMSPConfig) error { // make sure that admins are valid members as well // this way, when we validate an admin MSP principal @@ -460,6 +611,20 @@ func (msp *bccspmsp) setupV11(conf *m.FabricMSPConfig) error { return nil } +func (msp *bccspmsp) setupV143(conf *m.FabricMSPConfig) error { + err := msp.preSetupV143(conf) + if err != nil { + return err + } + + err = msp.postSetupV143(conf) + if err != nil { + return err + } + + return nil +} + func (msp *bccspmsp) postSetupV11(conf *m.FabricMSPConfig) error { // Check for OU enforcement if !msp.ouEnforcement { @@ -484,3 +649,22 @@ func (msp *bccspmsp) postSetupV11(conf *m.FabricMSPConfig) error { return nil } + +func (msp *bccspmsp) postSetupV143(conf *m.FabricMSPConfig) error { + // Check for OU enforcement + if !msp.ouEnforcement { + // No enforcement required. Call post setup as per V1 + return msp.postSetupV1(conf) + } + + // Check that admins are clients or admins + for i, admin := range msp.admins { + err1 := msp.hasOURole(admin, m.MSPRole_CLIENT) + err2 := msp.hasOURole(admin, m.MSPRole_ADMIN) + if err1 != nil && err2 != nil { + return errors.Errorf("admin %d is invalid [%s,%s]", i, err1, err2) + } + } + + return nil +} diff --git a/integration/vendor/github.com/hyperledger/fabric/msp/mspimplvalidate.go b/integration/vendor/github.com/hyperledger/fabric/msp/mspimplvalidate.go index 264ba878..4706b687 100644 --- a/integration/vendor/github.com/hyperledger/fabric/msp/mspimplvalidate.go +++ b/integration/vendor/github.com/hyperledger/fabric/msp/mspimplvalidate.go @@ -172,7 +172,7 @@ func (msp *bccspmsp) validateIdentityOUsV11(id *identity) error { } // Make sure that the identity has only one of the special OUs - // used to tell apart clients, peers and orderers. + // used to tell apart clients or peers. counter := 0 for _, OU := range id.GetOrganizationalUnits() { // Is OU.OrganizationalUnitIdentifier one of the special OUs? @@ -197,7 +197,61 @@ func (msp *bccspmsp) validateIdentityOUsV11(id *identity) error { } } if counter != 1 { - return errors.Errorf("the identity must be a client, a peer or an orderer identity to be valid, not a combination of them. OUs: [%v], MSP: [%s]", id.GetOrganizationalUnits(), msp.name) + return errors.Errorf("the identity must be a client or a peer identity to be valid, not a combination of them. OUs: [%v], MSP: [%s]", id.GetOrganizationalUnits(), msp.name) + } + + return nil +} + +func (msp *bccspmsp) validateIdentityOUsV143(id *identity) error { + // Run the same checks as per V1 + err := msp.validateIdentityOUsV1(id) + if err != nil { + return err + } + + // -- Check for OU enforcement + if !msp.ouEnforcement { + // No enforcement required + return nil + } + + // Make sure that the identity has only one of the special OUs + // used to tell apart clients, peers and admins. + counter := 0 + validOUs := make(map[string]*OUIdentifier) + if msp.clientOU != nil { + validOUs[msp.clientOU.OrganizationalUnitIdentifier] = msp.clientOU + } + if msp.peerOU != nil { + validOUs[msp.peerOU.OrganizationalUnitIdentifier] = msp.peerOU + } + if msp.adminOU != nil { + validOUs[msp.adminOU.OrganizationalUnitIdentifier] = msp.adminOU + } + if msp.ordererOU != nil { + validOUs[msp.ordererOU.OrganizationalUnitIdentifier] = msp.ordererOU + } + + for _, OU := range id.GetOrganizationalUnits() { + // Is OU.OrganizationalUnitIdentifier one of the special OUs? + nodeOU := validOUs[OU.OrganizationalUnitIdentifier] + if nodeOU == nil { + continue + } + + // Yes. Then, enforce the certifiers identifier in this is specified. + // If is not specified, it means that any certification path is fine. + if len(nodeOU.CertifiersIdentifier) != 0 && !bytes.Equal(nodeOU.CertifiersIdentifier, OU.CertifiersIdentifier) { + return errors.Errorf("certifiersIdentifier does not match: [%v], MSP: [%s]", id.GetOrganizationalUnits(), msp.name) + } + counter++ + if counter > 1 { + break + } + } + if counter != 1 { + return errors.Errorf("the identity must be a client, a peer, an orderer or an admin identity to be valid, not a combination of them. OUs: [%v], MSP: [%s]", id.GetOrganizationalUnits(), msp.name) } return nil diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/common/common.pb.go b/integration/vendor/github.com/hyperledger/fabric/protos/common/common.pb.go index df973bd0..bfadd489 100644 --- a/integration/vendor/github.com/hyperledger/fabric/protos/common/common.pb.go +++ b/integration/vendor/github.com/hyperledger/fabric/protos/common/common.pb.go @@ -61,7 +61,7 @@ func (x Status) String() string { return proto.EnumName(Status_name, int32(x)) } func (Status) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_common_b374fafc5e1c956e, []int{0} + return fileDescriptor_common_72f685cee4d0b877, []int{0} } type HeaderType int32 @@ -105,7 +105,7 @@ func (x HeaderType) String() string { return proto.EnumName(HeaderType_name, int32(x)) } func (HeaderType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_common_b374fafc5e1c956e, []int{1} + return fileDescriptor_common_72f685cee4d0b877, []int{1} } // This enum enlists indexes of the block metadata array @@ -116,6 +116,7 @@ const ( BlockMetadataIndex_LAST_CONFIG BlockMetadataIndex = 1 BlockMetadataIndex_TRANSACTIONS_FILTER BlockMetadataIndex = 2 BlockMetadataIndex_ORDERER BlockMetadataIndex = 3 + BlockMetadataIndex_COMMIT_HASH BlockMetadataIndex = 4 ) var BlockMetadataIndex_name = map[int32]string{ @@ -123,19 +124,21 @@ var BlockMetadataIndex_name = map[int32]string{ 1: "LAST_CONFIG", 2: "TRANSACTIONS_FILTER", 3: "ORDERER", + 4: "COMMIT_HASH", } var BlockMetadataIndex_value = map[string]int32{ "SIGNATURES": 0, "LAST_CONFIG": 1, "TRANSACTIONS_FILTER": 2, "ORDERER": 3, + "COMMIT_HASH": 4, } func (x BlockMetadataIndex) String() string { return proto.EnumName(BlockMetadataIndex_name, int32(x)) } func (BlockMetadataIndex) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_common_b374fafc5e1c956e, []int{2} + return fileDescriptor_common_72f685cee4d0b877, []int{2} } // LastConfig is the encoded value for the Metadata message which is encoded in the LAST_CONFIGURATION block metadata index @@ -150,7 +153,7 @@ func (m *LastConfig) Reset() { *m = LastConfig{} } func (m *LastConfig) String() string { return proto.CompactTextString(m) } func (*LastConfig) ProtoMessage() {} func (*LastConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_common_b374fafc5e1c956e, []int{0} + return fileDescriptor_common_72f685cee4d0b877, []int{0} } func (m *LastConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LastConfig.Unmarshal(m, b) @@ -190,7 +193,7 @@ func (m *Metadata) Reset() { *m = Metadata{} } func (m *Metadata) String() string { return proto.CompactTextString(m) } func (*Metadata) ProtoMessage() {} func (*Metadata) Descriptor() ([]byte, []int) { - return fileDescriptor_common_b374fafc5e1c956e, []int{1} + return fileDescriptor_common_72f685cee4d0b877, []int{1} } func (m *Metadata) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Metadata.Unmarshal(m, b) @@ -236,7 +239,7 @@ func (m *MetadataSignature) Reset() { *m = MetadataSignature{} } func (m *MetadataSignature) String() string { return proto.CompactTextString(m) } func (*MetadataSignature) ProtoMessage() {} func (*MetadataSignature) Descriptor() ([]byte, []int) { - return fileDescriptor_common_b374fafc5e1c956e, []int{2} + return fileDescriptor_common_72f685cee4d0b877, []int{2} } func (m *MetadataSignature) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MetadataSignature.Unmarshal(m, b) @@ -282,7 +285,7 @@ func (m *Header) Reset() { *m = Header{} } func (m *Header) String() string { return proto.CompactTextString(m) } func (*Header) ProtoMessage() {} func (*Header) Descriptor() ([]byte, []int) { - return fileDescriptor_common_b374fafc5e1c956e, []int{3} + return fileDescriptor_common_72f685cee4d0b877, []int{3} } func (m *Header) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Header.Unmarshal(m, b) @@ -355,7 +358,7 @@ func (m *ChannelHeader) Reset() { *m = ChannelHeader{} } func (m *ChannelHeader) String() string { return proto.CompactTextString(m) } func (*ChannelHeader) ProtoMessage() {} func (*ChannelHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_common_b374fafc5e1c956e, []int{4} + return fileDescriptor_common_72f685cee4d0b877, []int{4} } func (m *ChannelHeader) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ChannelHeader.Unmarshal(m, b) @@ -445,7 +448,7 @@ func (m *SignatureHeader) Reset() { *m = SignatureHeader{} } func (m *SignatureHeader) String() string { return proto.CompactTextString(m) } func (*SignatureHeader) ProtoMessage() {} func (*SignatureHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_common_b374fafc5e1c956e, []int{5} + return fileDescriptor_common_72f685cee4d0b877, []int{5} } func (m *SignatureHeader) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignatureHeader.Unmarshal(m, b) @@ -494,7 +497,7 @@ func (m *Payload) Reset() { *m = Payload{} } func (m *Payload) String() string { return proto.CompactTextString(m) } func (*Payload) ProtoMessage() {} func (*Payload) Descriptor() ([]byte, []int) { - return fileDescriptor_common_b374fafc5e1c956e, []int{6} + return fileDescriptor_common_72f685cee4d0b877, []int{6} } func (m *Payload) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Payload.Unmarshal(m, b) @@ -543,7 +546,7 @@ func (m *Envelope) Reset() { *m = Envelope{} } func (m *Envelope) String() string { return proto.CompactTextString(m) } func (*Envelope) ProtoMessage() {} func (*Envelope) Descriptor() ([]byte, []int) { - return fileDescriptor_common_b374fafc5e1c956e, []int{7} + return fileDescriptor_common_72f685cee4d0b877, []int{7} } func (m *Envelope) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Envelope.Unmarshal(m, b) @@ -594,7 +597,7 @@ func (m *Block) Reset() { *m = Block{} } func (m *Block) String() string { return proto.CompactTextString(m) } func (*Block) ProtoMessage() {} func (*Block) Descriptor() ([]byte, []int) { - return fileDescriptor_common_b374fafc5e1c956e, []int{8} + return fileDescriptor_common_72f685cee4d0b877, []int{8} } func (m *Block) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Block.Unmarshal(m, b) @@ -651,7 +654,7 @@ func (m *BlockHeader) Reset() { *m = BlockHeader{} } func (m *BlockHeader) String() string { return proto.CompactTextString(m) } func (*BlockHeader) ProtoMessage() {} func (*BlockHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_common_b374fafc5e1c956e, []int{9} + return fileDescriptor_common_72f685cee4d0b877, []int{9} } func (m *BlockHeader) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BlockHeader.Unmarshal(m, b) @@ -703,7 +706,7 @@ func (m *BlockData) Reset() { *m = BlockData{} } func (m *BlockData) String() string { return proto.CompactTextString(m) } func (*BlockData) ProtoMessage() {} func (*BlockData) Descriptor() ([]byte, []int) { - return fileDescriptor_common_b374fafc5e1c956e, []int{10} + return fileDescriptor_common_72f685cee4d0b877, []int{10} } func (m *BlockData) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BlockData.Unmarshal(m, b) @@ -741,7 +744,7 @@ func (m *BlockMetadata) Reset() { *m = BlockMetadata{} } func (m *BlockMetadata) String() string { return proto.CompactTextString(m) } func (*BlockMetadata) ProtoMessage() {} func (*BlockMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_common_b374fafc5e1c956e, []int{11} + return fileDescriptor_common_72f685cee4d0b877, []int{11} } func (m *BlockMetadata) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BlockMetadata.Unmarshal(m, b) @@ -768,6 +771,53 @@ func (m *BlockMetadata) GetMetadata() [][]byte { return nil } +// OrdererBlockMetadata defines metadata that is set by the ordering service. +type OrdererBlockMetadata struct { + LastConfig *LastConfig `protobuf:"bytes,1,opt,name=last_config,json=lastConfig,proto3" json:"last_config,omitempty"` + ConsenterMetadata []byte `protobuf:"bytes,2,opt,name=consenter_metadata,json=consenterMetadata,proto3" json:"consenter_metadata,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *OrdererBlockMetadata) Reset() { *m = OrdererBlockMetadata{} } +func (m *OrdererBlockMetadata) String() string { return proto.CompactTextString(m) } +func (*OrdererBlockMetadata) ProtoMessage() {} +func (*OrdererBlockMetadata) Descriptor() ([]byte, []int) { + return fileDescriptor_common_72f685cee4d0b877, []int{12} +} +func (m *OrdererBlockMetadata) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_OrdererBlockMetadata.Unmarshal(m, b) +} +func (m *OrdererBlockMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_OrdererBlockMetadata.Marshal(b, m, deterministic) +} +func (dst *OrdererBlockMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_OrdererBlockMetadata.Merge(dst, src) +} +func (m *OrdererBlockMetadata) XXX_Size() int { + return xxx_messageInfo_OrdererBlockMetadata.Size(m) +} +func (m *OrdererBlockMetadata) XXX_DiscardUnknown() { + xxx_messageInfo_OrdererBlockMetadata.DiscardUnknown(m) +} + +var xxx_messageInfo_OrdererBlockMetadata proto.InternalMessageInfo + +func (m *OrdererBlockMetadata) GetLastConfig() *LastConfig { + if m != nil { + return m.LastConfig + } + return nil +} + +func (m *OrdererBlockMetadata) GetConsenterMetadata() []byte { + if m != nil { + return m.ConsenterMetadata + } + return nil +} + func init() { proto.RegisterType((*LastConfig)(nil), "common.LastConfig") proto.RegisterType((*Metadata)(nil), "common.Metadata") @@ -781,73 +831,78 @@ func init() { proto.RegisterType((*BlockHeader)(nil), "common.BlockHeader") proto.RegisterType((*BlockData)(nil), "common.BlockData") proto.RegisterType((*BlockMetadata)(nil), "common.BlockMetadata") + proto.RegisterType((*OrdererBlockMetadata)(nil), "common.OrdererBlockMetadata") proto.RegisterEnum("common.Status", Status_name, Status_value) proto.RegisterEnum("common.HeaderType", HeaderType_name, HeaderType_value) proto.RegisterEnum("common.BlockMetadataIndex", BlockMetadataIndex_name, BlockMetadataIndex_value) } -func init() { proto.RegisterFile("common/common.proto", fileDescriptor_common_b374fafc5e1c956e) } +func init() { proto.RegisterFile("common/common.proto", fileDescriptor_common_72f685cee4d0b877) } -var fileDescriptor_common_b374fafc5e1c956e = []byte{ - // 959 bytes of a gzipped FileDescriptorProto +var fileDescriptor_common_72f685cee4d0b877 = []byte{ + // 1023 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x55, 0xcf, 0x6f, 0xe3, 0x44, - 0x18, 0xdd, 0xc4, 0xf9, 0xf9, 0xa5, 0x69, 0xdd, 0x49, 0xcb, 0x9a, 0xc2, 0x6a, 0x2b, 0xc3, 0xa2, - 0xd2, 0x4a, 0xa9, 0x28, 0x17, 0x38, 0x3a, 0xf6, 0xb4, 0xb5, 0x9a, 0x8e, 0xc3, 0xd8, 0x59, 0xc4, - 0x2e, 0x92, 0xe5, 0x24, 0xd3, 0x24, 0x22, 0xb1, 0x23, 0x7b, 0x52, 0xb5, 0x67, 0xee, 0x08, 0x09, - 0xae, 0xfc, 0x2f, 0x1c, 0x11, 0x7f, 0x0f, 0x88, 0x2b, 0x1a, 0x8f, 0xed, 0x4d, 0xca, 0x4a, 0x9c, - 0xe2, 0xf7, 0xe6, 0xcd, 0xf7, 0xbd, 0xf9, 0xde, 0xc4, 0x86, 0xce, 0x38, 0x5a, 0x2e, 0xa3, 0xf0, - 0x5c, 0xfe, 0x74, 0x57, 0x71, 0xc4, 0x23, 0x54, 0x93, 0xe8, 0xe8, 0xe5, 0x34, 0x8a, 0xa6, 0x0b, - 0x76, 0x9e, 0xb2, 0xa3, 0xf5, 0xdd, 0x39, 0x9f, 0x2f, 0x59, 0xc2, 0x83, 0xe5, 0x4a, 0x0a, 0x75, - 0x1d, 0xa0, 0x1f, 0x24, 0xdc, 0x8c, 0xc2, 0xbb, 0xf9, 0x14, 0x1d, 0x40, 0x75, 0x1e, 0x4e, 0xd8, - 0x83, 0x56, 0x3a, 0x2e, 0x9d, 0x54, 0xa8, 0x04, 0xfa, 0x5b, 0x68, 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xca, 0x17, 0x4b, 0x96, 0x70, 0x7f, 0xb9, 0x92, 0xc4, + 0x6e, 0x17, 0x60, 0xe0, 0x27, 0xdc, 0x88, 0xc2, 0x9b, 0xc5, 0x0c, 0xed, 0x43, 0x75, 0x11, 0x4e, + 0xd9, 0x9d, 0x56, 0x3a, 0x2c, 0x1d, 0x55, 0x88, 0x04, 0xdd, 0x6f, 0xa1, 0x31, 0x64, 0xdc, 0x9f, + 0xfa, 0xdc, 0x17, 0x8c, 0x5b, 0x3f, 0x58, 0xb3, 0x94, 0xf1, 0x94, 0x48, 0x80, 0xbe, 0x04, 0x48, + 0x16, 0xb3, 0xd0, 0xe7, 0xeb, 0x98, 0x25, 0x5a, 0xf9, 0x50, 0x39, 0x6a, 0x9d, 0xbd, 0xdf, 0xcb, + 0x14, 0xe5, 0x7b, 0xdd, 0x9c, 0x41, 0x36, 0xc8, 0xdd, 0xef, 0x60, 0xef, 0x3f, 0x04, 0xf4, 0x29, + 0xa8, 0x05, 0x85, 0xce, 0x99, 0x3f, 0x65, 0x71, 0x56, 0x70, 0xb7, 0x88, 0x5f, 0xa6, 0x61, 0xf4, + 0x21, 0x34, 0x8b, 0x90, 0x56, 0x4e, 0x39, 0x0f, 0x81, 0xee, 0x5b, 0xa8, 0x65, 0xbc, 0x57, 0xb0, + 0x33, 0x99, 0xfb, 0x61, 0xc8, 0x82, 0xed, 0x84, 0xed, 0x2c, 0x9a, 0xd1, 0xde, 0x55, 0xb9, 0xfc, + 0xce, 0xca, 0xdd, 0x1f, 0xcb, 0xd0, 0x36, 0xb6, 0x36, 0x23, 0xa8, 0xf0, 0xfb, 0x95, 0xec, 0x4d, + 0x95, 0xa4, 0xdf, 0x48, 0x83, 0xfa, 0x2d, 0x8b, 0x93, 0x45, 0x14, 0xa6, 0x79, 0xaa, 0x24, 0x87, + 0xe8, 0x0b, 0x68, 0x16, 0x6e, 0x68, 0xca, 0x61, 0xe9, 0xa8, 0x75, 0x76, 0xd0, 0x93, 0x7e, 0x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, + 0xb0, 0x84, 0x62, 0x17, 0xe3, 0x2b, 0x6a, 0xd9, 0xe7, 0x8e, 0x5a, 0x15, 0x61, 0xe3, 0x52, 0xb7, + 0x6c, 0xc3, 0x31, 0x31, 0x1d, 0xe9, 0xc6, 0x95, 0xa8, 0x5f, 0x13, 0x05, 0x46, 0x18, 0x13, 0xaa, + 0x9b, 0x43, 0xcb, 0xa6, 0xce, 0x08, 0x13, 0x3d, 0xcd, 0xd3, 0x10, 0x1b, 0x3c, 0xe7, 0x0a, 0xdb, + 0x5b, 0xe9, 0x9b, 0xc7, 0x01, 0xa0, 0xad, 0x21, 0xb0, 0xc4, 0xa3, 0x82, 0x76, 0x00, 0x5c, 0xeb, + 0xc2, 0xd6, 0xbd, 0x31, 0xc1, 0xae, 0xfa, 0x04, 0xed, 0x42, 0x6b, 0xa0, 0xbb, 0x1e, 0x2d, 0xce, + 0xf6, 0x1c, 0x3a, 0x1b, 0x79, 0x5c, 0x7a, 0x6e, 0x0d, 0x3c, 0x4c, 0xd4, 0xb2, 0xe8, 0x46, 0x76, + 0x0e, 0x55, 0x11, 0xdb, 0x0c, 0x67, 0x38, 0xb4, 0x3c, 0x7a, 0xa9, 0xbb, 0x97, 0x6a, 0xa5, 0xef, + 0xc2, 0xc7, 0x51, 0x3c, 0xeb, 0xcd, 0xef, 0x57, 0x2c, 0x0e, 0xd8, 0x74, 0xc6, 0xe2, 0xde, 0x8d, + 0x7f, 0x1d, 0x2f, 0x26, 0xf2, 0x4e, 0x4d, 0xb2, 0x59, 0x7b, 0x7b, 0x32, 0x5b, 0xf0, 0xf9, 0xfa, + 0x5a, 0xc0, 0xd3, 0x0d, 0xf2, 0xa9, 0x24, 0xcb, 0x07, 0x33, 0xc9, 0x1e, 0xd5, 0xeb, 0x5a, 0x0a, + 0x5f, 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xad, 0x85, 0xf1, 0xab, 0x6c, 0x07, 0x00, 0x00, } diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/common/common.proto b/integration/vendor/github.com/hyperledger/fabric/protos/common/common.proto index e93d5117..cb3befb3 100644 --- a/integration/vendor/github.com/hyperledger/fabric/protos/common/common.proto +++ b/integration/vendor/github.com/hyperledger/fabric/protos/common/common.proto @@ -58,8 +58,10 @@ enum BlockMetadataIndex { SIGNATURES = 0; // Block metadata array position for block signatures LAST_CONFIG = 1; // Block metadata array position to store last configuration block sequence number TRANSACTIONS_FILTER = 2; // Block metadata array position to store serialized bit array filter of invalid transactions - ORDERER = 3; // Block metadata array position to store operational metadata for orderers - // e.g. For Kafka, this is where we store the last offset written to the local ledger. + ORDERER = 3; /* Block metadata array position to store operational metadata for orderers e.g. For Kafka, + this is where we store the last offset written to the local ledger */ + COMMIT_HASH = 4; /* Block metadata array position to store the hash of TRANSACTIONS_FILTER, State Updates, + and the COMMIT_HASH of the previous block */ } // LastConfig is the encoded value for the Metadata message which is encoded in the LAST_CONFIGURATION block metadata index @@ -175,3 +177,9 @@ message BlockData { message BlockMetadata { repeated bytes metadata = 1; } + +// OrdererBlockMetadata defines metadata that is set by the ordering service. +message OrdererBlockMetadata { + LastConfig last_config = 1; + bytes consenter_metadata = 2; +} diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/msp/msp_config.pb.go b/integration/vendor/github.com/hyperledger/fabric/protos/msp/msp_config.pb.go index eb9066a6..3ab0ce60 100644 --- a/integration/vendor/github.com/hyperledger/fabric/protos/msp/msp_config.pb.go +++ b/integration/vendor/github.com/hyperledger/fabric/protos/msp/msp_config.pb.go @@ -36,7 +36,7 @@ func (m *MSPConfig) Reset() { *m = MSPConfig{} } func (m *MSPConfig) String() string { return proto.CompactTextString(m) } func (*MSPConfig) ProtoMessage() {} func (*MSPConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_msp_config_e749e5bd1d6d997b, []int{0} + return fileDescriptor_msp_config_c4b502fff5780348, []int{0} } func (m *MSPConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MSPConfig.Unmarshal(m, b) @@ -131,7 +131,7 @@ func (m *FabricMSPConfig) Reset() { *m = FabricMSPConfig{} } func (m *FabricMSPConfig) String() string { return proto.CompactTextString(m) } func (*FabricMSPConfig) ProtoMessage() {} func (*FabricMSPConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_msp_config_e749e5bd1d6d997b, []int{1} + return fileDescriptor_msp_config_c4b502fff5780348, []int{1} } func (m *FabricMSPConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FabricMSPConfig.Unmarshal(m, b) @@ -249,7 +249,7 @@ func (m *FabricCryptoConfig) Reset() { *m = FabricCryptoConfig{} } func (m *FabricCryptoConfig) String() string { return proto.CompactTextString(m) } func (*FabricCryptoConfig) ProtoMessage() {} func (*FabricCryptoConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_msp_config_e749e5bd1d6d997b, []int{2} + return fileDescriptor_msp_config_c4b502fff5780348, []int{2} } func (m *FabricCryptoConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FabricCryptoConfig.Unmarshal(m, b) @@ -305,7 +305,7 @@ func (m *IdemixMSPConfig) Reset() { *m = IdemixMSPConfig{} } func (m *IdemixMSPConfig) String() string { return proto.CompactTextString(m) } func (*IdemixMSPConfig) ProtoMessage() {} func (*IdemixMSPConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_msp_config_e749e5bd1d6d997b, []int{3} + return fileDescriptor_msp_config_c4b502fff5780348, []int{3} } func (m *IdemixMSPConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_IdemixMSPConfig.Unmarshal(m, b) @@ -383,7 +383,7 @@ func (m *IdemixMSPSignerConfig) Reset() { *m = IdemixMSPSignerConfig{} } func (m *IdemixMSPSignerConfig) String() string { return proto.CompactTextString(m) } func (*IdemixMSPSignerConfig) ProtoMessage() {} func (*IdemixMSPSignerConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_msp_config_e749e5bd1d6d997b, []int{4} + return fileDescriptor_msp_config_c4b502fff5780348, []int{4} } func (m *IdemixMSPSignerConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_IdemixMSPSignerConfig.Unmarshal(m, b) @@ -465,7 +465,7 @@ func (m *SigningIdentityInfo) Reset() { *m = SigningIdentityInfo{} } func (m *SigningIdentityInfo) String() string { return proto.CompactTextString(m) } func (*SigningIdentityInfo) ProtoMessage() {} func (*SigningIdentityInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_msp_config_e749e5bd1d6d997b, []int{5} + return fileDescriptor_msp_config_c4b502fff5780348, []int{5} } func (m *SigningIdentityInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SigningIdentityInfo.Unmarshal(m, b) @@ -520,7 +520,7 @@ func (m *KeyInfo) Reset() { *m = KeyInfo{} } func (m *KeyInfo) String() string { return proto.CompactTextString(m) } func (*KeyInfo) ProtoMessage() {} func (*KeyInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_msp_config_e749e5bd1d6d997b, []int{6} + return fileDescriptor_msp_config_c4b502fff5780348, []int{6} } func (m *KeyInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_KeyInfo.Unmarshal(m, b) @@ -577,7 +577,7 @@ func (m *FabricOUIdentifier) Reset() { *m = FabricOUIdentifier{} } func (m *FabricOUIdentifier) String() string { return proto.CompactTextString(m) } func (*FabricOUIdentifier) ProtoMessage() {} func (*FabricOUIdentifier) Descriptor() ([]byte, []int) { - return fileDescriptor_msp_config_e749e5bd1d6d997b, []int{7} + return fileDescriptor_msp_config_c4b502fff5780348, []int{7} } func (m *FabricOUIdentifier) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FabricOUIdentifier.Unmarshal(m, b) @@ -620,7 +620,11 @@ type FabricNodeOUs struct { // OU Identifier of the clients ClientOuIdentifier *FabricOUIdentifier `protobuf:"bytes,2,opt,name=client_ou_identifier,json=clientOuIdentifier,proto3" json:"client_ou_identifier,omitempty"` // OU Identifier of the peers - PeerOuIdentifier *FabricOUIdentifier `protobuf:"bytes,3,opt,name=peer_ou_identifier,json=peerOuIdentifier,proto3" json:"peer_ou_identifier,omitempty"` + PeerOuIdentifier *FabricOUIdentifier `protobuf:"bytes,3,opt,name=peer_ou_identifier,json=peerOuIdentifier,proto3" json:"peer_ou_identifier,omitempty"` + // OU Identifier of the admins + AdminOuIdentifier *FabricOUIdentifier `protobuf:"bytes,4,opt,name=admin_ou_identifier,json=adminOuIdentifier,proto3" json:"admin_ou_identifier,omitempty"` + // OU Identifier of the orderers + OrdererOuIdentifier *FabricOUIdentifier `protobuf:"bytes,5,opt,name=orderer_ou_identifier,json=ordererOuIdentifier,proto3" json:"orderer_ou_identifier,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -630,7 +634,7 @@ func (m *FabricNodeOUs) Reset() { *m = FabricNodeOUs{} } func (m *FabricNodeOUs) String() string { return proto.CompactTextString(m) } func (*FabricNodeOUs) ProtoMessage() {} func (*FabricNodeOUs) Descriptor() ([]byte, []int) { - return fileDescriptor_msp_config_e749e5bd1d6d997b, []int{8} + return fileDescriptor_msp_config_c4b502fff5780348, []int{8} } func (m *FabricNodeOUs) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FabricNodeOUs.Unmarshal(m, b) @@ -671,6 +675,20 @@ func (m *FabricNodeOUs) GetPeerOuIdentifier() *FabricOUIdentifier { return nil } +func (m *FabricNodeOUs) GetAdminOuIdentifier() *FabricOUIdentifier { + if m != nil { + return m.AdminOuIdentifier + } + return nil +} + +func (m *FabricNodeOUs) GetOrdererOuIdentifier() *FabricOUIdentifier { + if m != nil { + return m.OrdererOuIdentifier + } + return nil +} + func init() { proto.RegisterType((*MSPConfig)(nil), "msp.MSPConfig") proto.RegisterType((*FabricMSPConfig)(nil), "msp.FabricMSPConfig") @@ -683,61 +701,63 @@ func init() { proto.RegisterType((*FabricNodeOUs)(nil), "msp.FabricNodeOUs") } -func init() { proto.RegisterFile("msp/msp_config.proto", fileDescriptor_msp_config_e749e5bd1d6d997b) } - -var fileDescriptor_msp_config_e749e5bd1d6d997b = []byte{ - // 847 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x5f, 0x6f, 0xe3, 0x44, - 0x10, 0x57, 0x92, 0x26, 0x77, 0x99, 0x38, 0x49, 0xd9, 0xeb, 0x15, 0x0b, 0x71, 0x77, 0xa9, 0x01, - 0x91, 0x17, 0x52, 0xa9, 0x87, 0x84, 0x84, 0x78, 0xba, 0xc2, 0x09, 0x03, 0xa5, 0xd5, 0x56, 0x7d, - 0xe1, 0xc5, 0xda, 0xd8, 0x9b, 0x64, 0x65, 0x7b, 0xd7, 0xda, 0x5d, 0x9f, 0x08, 0xe2, 0x99, 0x2f, - 0xc0, 0x77, 0xe0, 0x99, 0x57, 0xbe, 0x1d, 0xda, 0x3f, 0x8d, 0x9d, 0x6b, 0x15, 0x78, 0x9b, 0x9d, - 0xf9, 0xcd, 0xcf, 0xb3, 0xbf, 0x99, 0x59, 0xc3, 0x49, 0xa9, 0xaa, 0xf3, 0x52, 0x55, 0x49, 0x2a, - 0xf8, 0x8a, 0xad, 0x17, 0x95, 0x14, 0x5a, 0xa0, 0x5e, 0xa9, 0xaa, 0xe8, 0x2b, 0x18, 0x5e, 0xdd, - 0xde, 0x5c, 0x5a, 0x3f, 0x42, 0x70, 0xa4, 0xb7, 0x15, 0x0d, 0x3b, 0xb3, 0xce, 0xbc, 0x8f, 0xad, - 0x8d, 0x4e, 0x61, 0xe0, 0xb2, 0xc2, 0xee, 0xac, 0x33, 0x0f, 0xb0, 0x3f, 0x45, 0x7f, 0x1f, 0xc1, - 0xf4, 0x2d, 0x59, 0x4a, 0x96, 0xee, 0xe5, 0x73, 0x52, 0xba, 0xfc, 0x21, 0xb6, 0x36, 0x7a, 0x01, - 0x20, 0x85, 0xd0, 0x49, 0x4a, 0xa5, 0x56, 0x61, 0x77, 0xd6, 0x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0x25, 0xcd, 0x6c, 0xb9, 0x01, 0xb6, 0x36, 0x9a, 0x40, 0x57, 0xdd, 0x57, - 0xdb, 0x55, 0x39, 0xfa, 0x16, 0x5e, 0x1e, 0x9e, 0x59, 0x7b, 0x89, 0x21, 0xfe, 0xf8, 0xd0, 0x64, - 0x9a, 0x2f, 0x49, 0x51, 0x50, 0x5b, 0x75, 0x1f, 0x5b, 0xdb, 0x5c, 0x89, 0x72, 0x29, 0x8a, 0xa2, - 0xa4, 0xdc, 0x10, 0xda, 0xaa, 0x87, 0x38, 0x68, 0x9c, 0x71, 0x86, 0x7e, 0x80, 0x33, 0x53, 0x96, - 0x21, 0x22, 0x45, 0xd2, 0x92, 0x80, 0xf1, 0x95, 0x90, 0xa5, 0xb5, 0xed, 0x22, 0x06, 0xf8, 0x55, - 0x03, 0xc4, 0x3b, 0x5c, 0xdc, 0xc0, 0x22, 0x01, 0xcf, 0x1e, 0x59, 0x53, 0x53, 0x47, 0x55, 0x2f, - 0x0b, 0x96, 0x26, 0xbe, 0x2b, 0x4e, 0x8e, 0xc0, 0x39, 0x9d, 0x60, 0xe8, 0x35, 0x4c, 0x2a, 0xc9, - 0xde, 0x99, 0x61, 0xf7, 0xa8, 0xae, 0xed, 0x5d, 0x60, 0x7b, 0xf7, 0x23, 0x75, 0x1b, 0x3f, 0xf6, - 0x18, 0x97, 0x14, 0xdd, 0xc2, 0x13, 0x1f, 0x41, 0x9f, 0xc1, 0x24, 0xa7, 0xed, 0x99, 0xf3, 0x33, - 0x32, 0xce, 0x69, 0x6b, 0xc0, 0xd0, 0x19, 0x04, 0x06, 0x56, 0x12, 0x4d, 0x25, 0x23, 0x85, 0xef, - 0xc3, 0x28, 0xa7, 0xdb, 0x2b, 0xef, 0x8a, 0x7e, 0xbf, 0x5f, 0x86, 0xf6, 0xc3, 0x80, 0x66, 0x30, - 0x32, 0x4b, 0xc8, 0x56, 0x2c, 0x25, 0x9a, 0xfa, 0x2b, 0xb4, 0x5d, 0xff, 0xa3, 0x91, 0xdd, 0xff, - 0x6e, 0x64, 0xf4, 0x4f, 0x07, 0xc6, 0x7b, 0xcb, 0x6a, 0x9e, 0x56, 0xca, 0xc9, 0xb2, 0x70, 0x1f, - 0x7d, 0x8a, 0xfd, 0x09, 0xc5, 0x70, 0x92, 0x16, 0xcc, 0xb4, 0x56, 0xd4, 0xef, 0x7f, 0xe5, 0xc0, - 0x0b, 0x87, 0x5c, 0xd2, 0x75, 0xdd, 0xba, 0xdc, 0x77, 0x80, 0x2a, 0x4a, 0xe5, 0x7b, 0x44, 0xbd, - 0xc3, 0x44, 0xc7, 0x26, 0xa5, 0x4d, 0xf3, 0x26, 0x81, 0x33, 0x21, 0xd7, 0x8b, 0xcd, 0xb6, 0xa2, - 0xb2, 0xa0, 0xd9, 0x9a, 0xca, 0x85, 0x7b, 0x68, 0xdc, 0x8f, 0x4d, 0x19, 0xa6, 0x37, 0xc7, 0x57, - 0xaa, 0x72, 0xeb, 0x71, 0x43, 0xd2, 0x9c, 0xac, 0xe9, 0x2f, 0xf3, 0x35, 0xd3, 0x9b, 0x7a, 0xb9, - 0x48, 0x45, 0x79, 0xde, 0xca, 0x3d, 0x77, 0xb9, 0xe7, 0x2e, 0xd7, 0xfc, 0x26, 0x97, 0x03, 0x6b, - 0xbf, 0xfe, 0x37, 0x00, 0x00, 0xff, 0xff, 0x54, 0x67, 0x46, 0xdb, 0x38, 0x07, 0x00, 0x00, +func init() { proto.RegisterFile("msp/msp_config.proto", fileDescriptor_msp_config_c4b502fff5780348) } + +var fileDescriptor_msp_config_c4b502fff5780348 = []byte{ + // 878 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0xcd, 0x6e, 0x23, 0x45, + 0x10, 0x96, 0x7f, 0x77, 0x5d, 0x1e, 0xdb, 0xd9, 0xce, 0x0f, 0x23, 0xc4, 0xee, 0x3a, 0x03, 0x08, + 0x5f, 0x70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0x3d, 0xa0, 0x92, 0x52, 0xf9, 0x80, 0xa8, 0xb5, + 0x9f, 0xe8, 0xc0, 0xa4, 0xec, 0xd0, 0xfc, 0x00, 0x87, 0xf6, 0xd9, 0x7f, 0xc0, 0xd3, 0xde, 0xcf, + 0xf3, 0xc2, 0xe6, 0xec, 0x10, 0xbd, 0x87, 0x63, 0x21, 0x33, 0x2a, 0x1f, 0x95, 0xd4, 0xd9, 0x4f, + 0x75, 0xe8, 0xb3, 0xea, 0x64, 0x6f, 0x13, 0x38, 0x15, 0x72, 0x31, 0x5d, 0xae, 0x4b, 0x2a, 0x73, + 0x9a, 0x2d, 0xa8, 0x9c, 0xba, 0xe7, 0xcf, 0xfd, 0x6e, 0x95, 0x21, 0x7b, 0x7b, 0x70, 0xa9, 0x4a, + 0xb7, 0xb4, 0xd7, 0x24, 0x5d, 0x91, 0x05, 0xfd, 0x75, 0xb2, 0x60, 0x7a, 0x59, 0xcd, 0xa6, 0xa9, + 0x28, 0xce, 0x6a, 0xb9, 0x67, 0x2e, 0xf7, 0xcc, 0xe5, 0x9a, 0x9f, 0xf7, 0xac, 0x6b, 0xed, 0x37, + 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x69, 0x49, 0xd1, 0x51, 0xce, 0x07, 0x00, 0x00, } diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/msp/msp_config.proto b/integration/vendor/github.com/hyperledger/fabric/protos/msp/msp_config.proto index 542f06d8..acedcaa5 100644 --- a/integration/vendor/github.com/hyperledger/fabric/protos/msp/msp_config.proto +++ b/integration/vendor/github.com/hyperledger/fabric/protos/msp/msp_config.proto @@ -205,4 +205,9 @@ message FabricNodeOUs { // OU Identifier of the peers FabricOUIdentifier peer_ou_identifier = 3; + // OU Identifier of the admins + FabricOUIdentifier admin_ou_identifier = 4; + + // OU Identifier of the orderers + FabricOUIdentifier orderer_ou_identifier = 5; } \ No newline at end of file diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/msp/msp_principal.go b/integration/vendor/github.com/hyperledger/fabric/protos/msp/msp_principal.go index 339dc629..624c7687 100644 --- a/integration/vendor/github.com/hyperledger/fabric/protos/msp/msp_principal.go +++ b/integration/vendor/github.com/hyperledger/fabric/protos/msp/msp_principal.go @@ -36,7 +36,7 @@ func (mp *MSPPrincipal) VariablyOpaqueFieldProto(name string) (proto.Message, er case MSPPrincipal_ORGANIZATION_UNIT: return &OrganizationUnit{}, nil case MSPPrincipal_IDENTITY: - return nil, fmt.Errorf("unable to decode MSP type IDENTITY until the protos are fixed to include the IDENTITY proto in protos/msp") + return &SerializedIdentity{}, nil default: return nil, fmt.Errorf("unable to decode MSP type: %v", mp.PrincipalClassification) } diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/msp/msp_principal.pb.go b/integration/vendor/github.com/hyperledger/fabric/protos/msp/msp_principal.pb.go index 9200e97f..95fd1a47 100644 --- a/integration/vendor/github.com/hyperledger/fabric/protos/msp/msp_principal.pb.go +++ b/integration/vendor/github.com/hyperledger/fabric/protos/msp/msp_principal.pb.go @@ -54,16 +54,17 @@ func (x MSPPrincipal_Classification) String() string { return proto.EnumName(MSPPrincipal_Classification_name, int32(x)) } func (MSPPrincipal_Classification) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_msp_principal_9016cf1a8a7156cd, []int{0, 0} + return fileDescriptor_msp_principal_3b3c17f3e626d163, []int{0, 0} } type MSPRole_MSPRoleType int32 const ( - MSPRole_MEMBER MSPRole_MSPRoleType = 0 - MSPRole_ADMIN MSPRole_MSPRoleType = 1 - MSPRole_CLIENT MSPRole_MSPRoleType = 2 - MSPRole_PEER MSPRole_MSPRoleType = 3 + MSPRole_MEMBER MSPRole_MSPRoleType = 0 + MSPRole_ADMIN MSPRole_MSPRoleType = 1 + MSPRole_CLIENT MSPRole_MSPRoleType = 2 + MSPRole_PEER MSPRole_MSPRoleType = 3 + MSPRole_ORDERER MSPRole_MSPRoleType = 4 ) var MSPRole_MSPRoleType_name = map[int32]string{ @@ -71,19 +72,21 @@ var MSPRole_MSPRoleType_name = map[int32]string{ 1: "ADMIN", 2: "CLIENT", 3: "PEER", + 4: "ORDERER", } var MSPRole_MSPRoleType_value = map[string]int32{ - "MEMBER": 0, - "ADMIN": 1, - "CLIENT": 2, - "PEER": 3, + "MEMBER": 0, + "ADMIN": 1, + "CLIENT": 2, + "PEER": 3, + "ORDERER": 4, } func (x MSPRole_MSPRoleType) String() string { return proto.EnumName(MSPRole_MSPRoleType_name, int32(x)) } func (MSPRole_MSPRoleType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_msp_principal_9016cf1a8a7156cd, []int{2, 0} + return fileDescriptor_msp_principal_3b3c17f3e626d163, []int{2, 0} } type MSPIdentityAnonymity_MSPIdentityAnonymityType int32 @@ -106,7 +109,7 @@ func (x MSPIdentityAnonymity_MSPIdentityAnonymityType) String() string { return proto.EnumName(MSPIdentityAnonymity_MSPIdentityAnonymityType_name, int32(x)) } func (MSPIdentityAnonymity_MSPIdentityAnonymityType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_msp_principal_9016cf1a8a7156cd, []int{3, 0} + return fileDescriptor_msp_principal_3b3c17f3e626d163, []int{3, 0} } // MSPPrincipal aims to represent an MSP-centric set of identities. @@ -153,7 +156,7 @@ func (m *MSPPrincipal) Reset() { *m = MSPPrincipal{} } func (m *MSPPrincipal) String() string { return proto.CompactTextString(m) } func (*MSPPrincipal) ProtoMessage() {} func (*MSPPrincipal) Descriptor() ([]byte, []int) { - return fileDescriptor_msp_principal_9016cf1a8a7156cd, []int{0} + return fileDescriptor_msp_principal_3b3c17f3e626d163, []int{0} } func (m *MSPPrincipal) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MSPPrincipal.Unmarshal(m, b) @@ -209,7 +212,7 @@ func (m *OrganizationUnit) Reset() { *m = OrganizationUnit{} } func (m *OrganizationUnit) String() string { return proto.CompactTextString(m) } func (*OrganizationUnit) ProtoMessage() {} func (*OrganizationUnit) Descriptor() ([]byte, []int) { - return fileDescriptor_msp_principal_9016cf1a8a7156cd, []int{1} + return fileDescriptor_msp_principal_3b3c17f3e626d163, []int{1} } func (m *OrganizationUnit) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OrganizationUnit.Unmarshal(m, b) @@ -269,7 +272,7 @@ func (m *MSPRole) Reset() { *m = MSPRole{} } func (m *MSPRole) String() string { return proto.CompactTextString(m) } func (*MSPRole) ProtoMessage() {} func (*MSPRole) Descriptor() ([]byte, []int) { - return fileDescriptor_msp_principal_9016cf1a8a7156cd, []int{2} + return fileDescriptor_msp_principal_3b3c17f3e626d163, []int{2} } func (m *MSPRole) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MSPRole.Unmarshal(m, b) @@ -315,7 +318,7 @@ func (m *MSPIdentityAnonymity) Reset() { *m = MSPIdentityAnonymity{} } func (m *MSPIdentityAnonymity) String() string { return proto.CompactTextString(m) } func (*MSPIdentityAnonymity) ProtoMessage() {} func (*MSPIdentityAnonymity) Descriptor() ([]byte, []int) { - return fileDescriptor_msp_principal_9016cf1a8a7156cd, []int{3} + return fileDescriptor_msp_principal_3b3c17f3e626d163, []int{3} } func (m *MSPIdentityAnonymity) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MSPIdentityAnonymity.Unmarshal(m, b) @@ -357,7 +360,7 @@ func (m *CombinedPrincipal) Reset() { *m = CombinedPrincipal{} } func (m *CombinedPrincipal) String() string { return proto.CompactTextString(m) } func (*CombinedPrincipal) ProtoMessage() {} func (*CombinedPrincipal) Descriptor() ([]byte, []int) { - return fileDescriptor_msp_principal_9016cf1a8a7156cd, []int{4} + return fileDescriptor_msp_principal_3b3c17f3e626d163, []int{4} } func (m *CombinedPrincipal) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CombinedPrincipal.Unmarshal(m, b) @@ -396,42 +399,42 @@ func init() { } func init() { - proto.RegisterFile("msp/msp_principal.proto", fileDescriptor_msp_principal_9016cf1a8a7156cd) -} - -var fileDescriptor_msp_principal_9016cf1a8a7156cd = []byte{ - // 519 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xdf, 0x6a, 0xdb, 0x30, - 0x14, 0xc6, 0xeb, 0xa4, 0x6b, 0x9b, 0x93, 0x3f, 0xa8, 0x22, 0xa5, 0x81, 0x95, 0x11, 0xbc, 0x0d, - 0x72, 0xe5, 0x40, 0xba, 0xed, 0x62, 0x77, 0x4e, 0x62, 0x86, 0x20, 0x96, 0x8d, 0xe3, 0x5c, 0xb4, - 0x94, 0x05, 0xc7, 0x51, 0x52, 0x81, 0x6d, 0x19, 0xdb, 0xbd, 0xf0, 0xde, 0x65, 0x6f, 0xb0, 0xcb, - 0x3d, 0xd5, 0x9e, 0x62, 0xd8, 0x6e, 0x12, 0x65, 0xeb, 0x60, 0x57, 0xf6, 0x39, 0xe7, 0xf7, 0x1d, - 0x1d, 0x49, 0x9f, 0xe0, 0x3a, 0x4c, 0xe3, 0x61, 0x98, 0xc6, 0xcb, 0x38, 0xe1, 0x91, 0xcf, 0x63, - 0x2f, 0xd0, 0xe2, 0x44, 0x64, 0x02, 0x9f, 0xf9, 0x22, 0x0c, 0x45, 0xa4, 0xfe, 0x52, 0xa0, 0x65, - 0xce, 0x6d, 0x7b, 0x57, 0xc6, 0x5f, 0xa1, 0xb7, 0x67, 0x97, 0x7e, 0xe0, 0xa5, 0x29, 0xdf, 0x70, - 0xdf, 0xcb, 0xb8, 0x88, 0x7a, 0x4a, 0x5f, 0x19, 0x74, 0x46, 0x6f, 0xb5, 0x4a, 0xab, 0xc9, 0x3a, - 0x6d, 0x72, 0x84, 0x3a, 0xd7, 0xfb, 0x26, 0xc7, 0x05, 0x7c, 0x03, 0x8d, 0x7d, 0xa9, 0x57, 0xeb, - 0x2b, 0x83, 0x96, 0x73, 0x48, 0xa8, 0x0f, 0xd0, 0xf9, 0x83, 0xbf, 0x80, 0x53, 0xc7, 0x9a, 0x19, - 0xe8, 0x04, 0x5f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x31, 0xb6, 0x61, 0x38, 0xa8, 0xae, - 0xfe, 0x50, 0xa0, 0x6b, 0xce, 0xed, 0x6a, 0xf9, 0x2c, 0xd7, 0x23, 0x11, 0xe5, 0x21, 0xcf, 0x72, - 0xfc, 0x00, 0x1d, 0x6f, 0x17, 0x2c, 0xb3, 0x3c, 0x66, 0xcf, 0x0e, 0xfa, 0x28, 0xcd, 0xf3, 0x97, - 0xea, 0xc5, 0x64, 0x39, 0x69, 0xdb, 0x93, 0x43, 0xf5, 0x13, 0xf4, 0xfe, 0x85, 0xe2, 0x26, 0x9c, - 0x53, 0xcb, 0x24, 0x54, 0x9f, 0xa1, 0x93, 0x83, 0x27, 0xac, 0xc5, 0x1c, 0x29, 0x2a, 0x81, 0xcb, - 0x89, 0x08, 0x57, 0x3c, 0x62, 0xeb, 0x83, 0xed, 0x3f, 0x00, 0xec, 0x5d, 0x98, 0xf6, 0x94, 0x7e, - 0x7d, 0xd0, 0x1c, 0x75, 0x5f, 0x32, 0xba, 0x23, 0x71, 0x63, 0x1b, 0xde, 0x89, 0x64, 0xab, 0x3d, - 0xe6, 0x31, 0x4b, 0x02, 0xb6, 0xde, 0xb2, 0x44, 0xdb, 0x78, 0xab, 0x84, 0xfb, 0xd5, 0x2b, 0x4b, - 0x9f, 0x1b, 0xdc, 0x0f, 0xb6, 0x3c, 0x7b, 0x7c, 0x5a, 0x15, 0xe1, 0x50, 0x82, 0x87, 0x15, 0x3c, - 0xac, 0xe0, 0xe2, 0x9d, 0xae, 0xce, 0xca, 0xff, 0xdb, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x40, - 0x36, 0xd2, 0xf9, 0xb9, 0x03, 0x00, 0x00, + proto.RegisterFile("msp/msp_principal.proto", fileDescriptor_msp_principal_3b3c17f3e626d163) +} + +var fileDescriptor_msp_principal_3b3c17f3e626d163 = []byte{ + // 524 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xc1, 0x6e, 0xda, 0x40, + 0x10, 0x86, 0x63, 0xa0, 0x49, 0x98, 0x00, 0xda, 0xac, 0x88, 0x82, 0xd4, 0xa8, 0x42, 0x6e, 0x2b, + 0x71, 0x32, 0x12, 0x69, 0x7b, 0x37, 0x60, 0x45, 0x96, 0xf0, 0xda, 0x5a, 0xcc, 0x21, 0x51, 0x54, + 0x64, 0xcc, 0x42, 0x56, 0xb2, 0xbd, 0x96, 0xed, 0x1c, 0xdc, 0x47, 0xaa, 0x7a, 0xec, 0x53, 0xf5, + 0x29, 0x2a, 0xdb, 0x01, 0x96, 0x36, 0x95, 0x7a, 0xb2, 0x67, 0xe6, 0xfb, 0xc7, 0xbf, 0x77, 0x67, + 0xe0, 0x3a, 0x4c, 0xe3, 0x61, 0x98, 0xc6, 0xcb, 0x38, 0xe1, 0x91, 0xcf, 0x63, 0x2f, 0xd0, 0xe2, + 0x44, 0x64, 0x02, 0x9f, 0xfa, 0x22, 0x0c, 0x45, 0xa4, 0xfe, 0x52, 0xa0, 0x65, 0xcd, 0x1d, 0x67, + 0x57, 0xc6, 0x5f, 0xa1, 0xb7, 0x67, 0x97, 0x7e, 0xe0, 0xa5, 0x29, 0xdf, 0x70, 0xdf, 0xcb, 0xb8, + 0x88, 0x7a, 0x4a, 0x5f, 0x19, 0x74, 0x46, 0xef, 0xb5, 0x4a, 0xab, 0xc9, 0x3a, 0x6d, 0x72, 0x84, + 0xd2, 0xeb, 0x7d, 0x93, 0xe3, 0x02, 0xbe, 0x81, 0xe6, 0xbe, 0xd4, 0xab, 0xf5, 0x95, 0x41, 0x8b, + 0x1e, 0x12, 0xea, 0x23, 0x74, 0xfe, 0xe0, 0xcf, 0xa1, 0x41, 0xed, 0x99, 0x81, 0x4e, 0xf0, 0x15, + 0x5c, 0xda, 0xf4, 0x4e, 0x27, 0xe6, 0x83, 0xee, 0x9a, 0x36, 0x59, 0x2e, 0x88, 0xe9, 0x22, 0x05, + 0xb7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x43, 0xfd, 0xa1, 0x40, 0xd7, 0x9a, 0x3b, 0x95, 0x97, 0x2c, 0xd7, + 0x23, 0x11, 0xe5, 0x21, 0xcf, 0x72, 0xfc, 0x08, 0x1d, 0x6f, 0x17, 0x2c, 0xb3, 0x3c, 0x66, 0x2f, + 0xe3, 0xf4, 0x59, 0x32, 0xf7, 0x97, 0xea, 0xd5, 0x64, 0x69, 0xbb, 0xed, 0xc9, 0xa1, 0xfa, 0x05, + 0x7a, 0xff, 0x42, 0x0b, 0x7f, 0xc4, 0xb6, 0x4c, 0xa2, 0xcf, 0xd0, 0xc9, 0x61, 0x40, 0xec, 0xc5, + 0x1c, 0x29, 0xaa, 0x09, 0x97, 0x13, 0x11, 0xae, 0x78, 0xc4, 0xd6, 0x87, 0x1d, 0xf8, 0x04, 0xb0, + 0x1f, 0xc9, 0xb4, 0xa7, 0xf4, 0xeb, 0x83, 0x8b, 0x51, 0xf7, 0xb5, 0xa9, 0xa7, 0x12, 0x37, 0x76, + 0xe0, 0x83, 0x48, 0xb6, 0xda, 0x53, 0x1e, 0xb3, 0x24, 0x60, 0xeb, 0x2d, 0x4b, 0xb4, 0x8d, 0xb7, + 0x4a, 0xb8, 0x5f, 0xad, 0x5c, 0xfa, 0xd2, 0xe0, 0x61, 0xb0, 0xe5, 0xd9, 0xd3, 0xf3, 0xaa, 0x08, + 0x87, 0x12, 0x3c, 0xac, 0xe0, 0x61, 0x05, 0x17, 0x4b, 0xbb, 0x3a, 0x2d, 0xdf, 0x6f, 0x7f, 0x07, + 0x00, 0x00, 0xff, 0xff, 0x30, 0x91, 0xbc, 0x0d, 0xc6, 0x03, 0x00, 0x00, } diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/msp/msp_principal.proto b/integration/vendor/github.com/hyperledger/fabric/protos/msp/msp_principal.proto index 972f0fe4..c9300ff3 100644 --- a/integration/vendor/github.com/hyperledger/fabric/protos/msp/msp_principal.proto +++ b/integration/vendor/github.com/hyperledger/fabric/protos/msp/msp_principal.proto @@ -116,6 +116,7 @@ message MSPRole { ADMIN = 1; // Represents an MSP Admin CLIENT = 2; // Represents an MSP Client PEER = 3; // Represents an MSP Peer + ORDERER = 4; // Represents an MSP Orderer } // MSPRoleType defines which of the available, pre-defined MSP-roles diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/orderer/ab.pb.go b/integration/vendor/github.com/hyperledger/fabric/protos/orderer/ab.pb.go new file mode 100644 index 00000000..55edd153 --- /dev/null +++ b/integration/vendor/github.com/hyperledger/fabric/protos/orderer/ab.pb.go @@ -0,0 +1,839 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: orderer/ab.proto + +package orderer // import "github.com/hyperledger/fabric/protos/orderer" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import common "github.com/hyperledger/fabric/protos/common" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +// If BLOCK_UNTIL_READY is specified, the reply will block until the requested blocks are available, +// if FAIL_IF_NOT_READY is specified, the reply will return an error indicating that the block is not +// found. To request that all blocks be returned indefinitely as they are created, behavior should be +// set to BLOCK_UNTIL_READY and the stop should be set to specified with a number of MAX_UINT64 +type SeekInfo_SeekBehavior int32 + +const ( + SeekInfo_BLOCK_UNTIL_READY SeekInfo_SeekBehavior = 0 + SeekInfo_FAIL_IF_NOT_READY SeekInfo_SeekBehavior = 1 +) + +var SeekInfo_SeekBehavior_name = map[int32]string{ + 0: "BLOCK_UNTIL_READY", + 1: "FAIL_IF_NOT_READY", +} +var SeekInfo_SeekBehavior_value = map[string]int32{ + "BLOCK_UNTIL_READY": 0, + "FAIL_IF_NOT_READY": 1, +} + +func (x SeekInfo_SeekBehavior) String() string { + return proto.EnumName(SeekInfo_SeekBehavior_name, int32(x)) +} +func (SeekInfo_SeekBehavior) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_ab_237e854d47750248, []int{5, 0} +} + +// SeekErrorTolerance indicates to the server how block provider errors should be tolerated. By default, +// if the deliver service detects a problem in the underlying block source (typically, in the orderer, +// a consenter error), it will begin to reject deliver requests. This is to prevent a client from waiting +// for blocks from an orderer which is stuck in an errored state. This is almost always the desired behavior +// and clients should stick with the default STRICT checking behavior. However, in some scenarios, particularly +// when attempting to recover from a crash or other corruption, it's desirable to force an orderer to respond +// with blocks on a best effort basis, even if the backing consensus implementation is in an errored state. +// In this case, set the SeekErrorResponse to BEST_EFFORT to ignore the consenter errors. +type SeekInfo_SeekErrorResponse int32 + +const ( + SeekInfo_STRICT SeekInfo_SeekErrorResponse = 0 + SeekInfo_BEST_EFFORT SeekInfo_SeekErrorResponse = 1 +) + +var SeekInfo_SeekErrorResponse_name = map[int32]string{ + 0: "STRICT", + 1: "BEST_EFFORT", +} +var SeekInfo_SeekErrorResponse_value = map[string]int32{ + "STRICT": 0, + "BEST_EFFORT": 1, +} + +func (x SeekInfo_SeekErrorResponse) String() string { + return proto.EnumName(SeekInfo_SeekErrorResponse_name, int32(x)) +} +func (SeekInfo_SeekErrorResponse) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_ab_237e854d47750248, []int{5, 1} +} + +type BroadcastResponse struct { + // Status code, which may be used to programatically respond to success/failure + Status common.Status `protobuf:"varint,1,opt,name=status,proto3,enum=common.Status" json:"status,omitempty"` + // Info string which may contain additional information about the status returned + Info string `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BroadcastResponse) Reset() { *m = BroadcastResponse{} } +func (m *BroadcastResponse) String() string { return proto.CompactTextString(m) } +func (*BroadcastResponse) ProtoMessage() {} +func (*BroadcastResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ab_237e854d47750248, []int{0} +} +func (m *BroadcastResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BroadcastResponse.Unmarshal(m, b) +} +func (m *BroadcastResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BroadcastResponse.Marshal(b, m, deterministic) +} +func (dst *BroadcastResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_BroadcastResponse.Merge(dst, src) +} +func (m *BroadcastResponse) XXX_Size() int { + return xxx_messageInfo_BroadcastResponse.Size(m) +} +func (m *BroadcastResponse) XXX_DiscardUnknown() { + xxx_messageInfo_BroadcastResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_BroadcastResponse proto.InternalMessageInfo + +func (m *BroadcastResponse) GetStatus() common.Status { + if m != nil { + return m.Status + } + return common.Status_UNKNOWN +} + +func (m *BroadcastResponse) GetInfo() string { + if m != nil { + return m.Info + } + return "" +} + +type SeekNewest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SeekNewest) Reset() { *m = SeekNewest{} } +func (m *SeekNewest) String() string { return proto.CompactTextString(m) } +func (*SeekNewest) ProtoMessage() {} +func (*SeekNewest) Descriptor() ([]byte, []int) { + return fileDescriptor_ab_237e854d47750248, []int{1} +} +func (m *SeekNewest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SeekNewest.Unmarshal(m, b) +} +func (m *SeekNewest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SeekNewest.Marshal(b, m, deterministic) +} +func (dst *SeekNewest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SeekNewest.Merge(dst, src) +} +func (m *SeekNewest) XXX_Size() int { + return xxx_messageInfo_SeekNewest.Size(m) +} +func (m *SeekNewest) XXX_DiscardUnknown() { + xxx_messageInfo_SeekNewest.DiscardUnknown(m) +} + +var xxx_messageInfo_SeekNewest proto.InternalMessageInfo + +type SeekOldest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SeekOldest) Reset() { *m = SeekOldest{} } +func (m *SeekOldest) String() string { return proto.CompactTextString(m) } +func (*SeekOldest) ProtoMessage() {} +func (*SeekOldest) Descriptor() ([]byte, []int) { + return fileDescriptor_ab_237e854d47750248, []int{2} +} +func (m *SeekOldest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SeekOldest.Unmarshal(m, b) +} +func (m *SeekOldest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SeekOldest.Marshal(b, m, deterministic) +} +func (dst *SeekOldest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SeekOldest.Merge(dst, src) +} +func (m *SeekOldest) XXX_Size() int { + return xxx_messageInfo_SeekOldest.Size(m) +} +func (m *SeekOldest) XXX_DiscardUnknown() { + xxx_messageInfo_SeekOldest.DiscardUnknown(m) +} + +var xxx_messageInfo_SeekOldest proto.InternalMessageInfo + +type SeekSpecified struct { + Number uint64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SeekSpecified) Reset() { *m = SeekSpecified{} } +func (m *SeekSpecified) String() string { return proto.CompactTextString(m) } +func (*SeekSpecified) ProtoMessage() {} +func (*SeekSpecified) Descriptor() ([]byte, []int) { + return fileDescriptor_ab_237e854d47750248, []int{3} +} +func (m *SeekSpecified) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SeekSpecified.Unmarshal(m, b) +} +func (m *SeekSpecified) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SeekSpecified.Marshal(b, m, deterministic) +} +func (dst *SeekSpecified) XXX_Merge(src proto.Message) { + xxx_messageInfo_SeekSpecified.Merge(dst, src) +} +func (m *SeekSpecified) XXX_Size() int { + return xxx_messageInfo_SeekSpecified.Size(m) +} +func (m *SeekSpecified) XXX_DiscardUnknown() { + xxx_messageInfo_SeekSpecified.DiscardUnknown(m) +} + +var xxx_messageInfo_SeekSpecified proto.InternalMessageInfo + +func (m *SeekSpecified) GetNumber() uint64 { + if m != nil { + return m.Number + } + return 0 +} + +type SeekPosition struct { + // Types that are valid to be assigned to Type: + // *SeekPosition_Newest + // *SeekPosition_Oldest + // *SeekPosition_Specified + Type isSeekPosition_Type `protobuf_oneof:"Type"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SeekPosition) Reset() { *m = SeekPosition{} } +func (m *SeekPosition) String() string { return proto.CompactTextString(m) } +func (*SeekPosition) ProtoMessage() {} +func (*SeekPosition) Descriptor() ([]byte, []int) { + return fileDescriptor_ab_237e854d47750248, []int{4} +} +func (m *SeekPosition) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SeekPosition.Unmarshal(m, b) +} +func (m *SeekPosition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SeekPosition.Marshal(b, m, deterministic) +} +func (dst *SeekPosition) XXX_Merge(src proto.Message) { + xxx_messageInfo_SeekPosition.Merge(dst, src) +} +func (m *SeekPosition) XXX_Size() int { + return xxx_messageInfo_SeekPosition.Size(m) +} +func (m *SeekPosition) XXX_DiscardUnknown() { + xxx_messageInfo_SeekPosition.DiscardUnknown(m) +} + +var xxx_messageInfo_SeekPosition proto.InternalMessageInfo + +type isSeekPosition_Type interface { + isSeekPosition_Type() +} + +type SeekPosition_Newest struct { + Newest *SeekNewest `protobuf:"bytes,1,opt,name=newest,proto3,oneof"` +} + +type SeekPosition_Oldest struct { + Oldest *SeekOldest `protobuf:"bytes,2,opt,name=oldest,proto3,oneof"` +} + +type SeekPosition_Specified struct { + Specified *SeekSpecified `protobuf:"bytes,3,opt,name=specified,proto3,oneof"` +} + +func (*SeekPosition_Newest) isSeekPosition_Type() {} + +func (*SeekPosition_Oldest) isSeekPosition_Type() {} + +func (*SeekPosition_Specified) isSeekPosition_Type() {} + +func (m *SeekPosition) GetType() isSeekPosition_Type { + if m != nil { + return m.Type + } + return nil +} + +func (m *SeekPosition) GetNewest() *SeekNewest { + if x, ok := m.GetType().(*SeekPosition_Newest); ok { + return x.Newest + } + return nil +} + +func (m *SeekPosition) GetOldest() *SeekOldest { + if x, ok := m.GetType().(*SeekPosition_Oldest); ok { + return x.Oldest + } + return nil +} + +func (m *SeekPosition) GetSpecified() *SeekSpecified { + if x, ok := m.GetType().(*SeekPosition_Specified); ok { + return x.Specified + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*SeekPosition) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _SeekPosition_OneofMarshaler, _SeekPosition_OneofUnmarshaler, _SeekPosition_OneofSizer, []interface{}{ + (*SeekPosition_Newest)(nil), + (*SeekPosition_Oldest)(nil), + (*SeekPosition_Specified)(nil), + } +} + +func _SeekPosition_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*SeekPosition) + // Type + switch x := m.Type.(type) { + case *SeekPosition_Newest: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Newest); err != nil { + return err + } + case *SeekPosition_Oldest: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Oldest); err != nil { + return err + } + case *SeekPosition_Specified: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Specified); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("SeekPosition.Type has unexpected type %T", x) + } + return nil +} + +func _SeekPosition_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*SeekPosition) + switch tag { + case 1: // Type.newest + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SeekNewest) + err := b.DecodeMessage(msg) + m.Type = &SeekPosition_Newest{msg} + return true, err + case 2: // Type.oldest + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SeekOldest) + err := b.DecodeMessage(msg) + m.Type = &SeekPosition_Oldest{msg} + return true, err + case 3: // Type.specified + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SeekSpecified) + err := b.DecodeMessage(msg) + m.Type = &SeekPosition_Specified{msg} + return true, err + default: + return false, nil + } +} + +func _SeekPosition_OneofSizer(msg proto.Message) (n int) { + m := msg.(*SeekPosition) + // Type + switch x := m.Type.(type) { + case *SeekPosition_Newest: + s := proto.Size(x.Newest) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *SeekPosition_Oldest: + s := proto.Size(x.Oldest) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *SeekPosition_Specified: + s := proto.Size(x.Specified) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// SeekInfo specifies the range of requested blocks to return +// If the start position is not found, an error is immediately returned +// Otherwise, blocks are returned until a missing block is encountered, then behavior is dictated +// by the SeekBehavior specified. +type SeekInfo struct { + Start *SeekPosition `protobuf:"bytes,1,opt,name=start,proto3" json:"start,omitempty"` + Stop *SeekPosition `protobuf:"bytes,2,opt,name=stop,proto3" json:"stop,omitempty"` + Behavior SeekInfo_SeekBehavior `protobuf:"varint,3,opt,name=behavior,proto3,enum=orderer.SeekInfo_SeekBehavior" json:"behavior,omitempty"` + ErrorResponse SeekInfo_SeekErrorResponse `protobuf:"varint,4,opt,name=error_response,json=errorResponse,proto3,enum=orderer.SeekInfo_SeekErrorResponse" json:"error_response,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SeekInfo) Reset() { *m = SeekInfo{} } +func (m *SeekInfo) String() string { return proto.CompactTextString(m) } +func (*SeekInfo) ProtoMessage() {} +func (*SeekInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_ab_237e854d47750248, []int{5} +} +func (m *SeekInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SeekInfo.Unmarshal(m, b) +} +func (m *SeekInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SeekInfo.Marshal(b, m, deterministic) +} +func (dst *SeekInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_SeekInfo.Merge(dst, src) +} +func (m *SeekInfo) XXX_Size() int { + return xxx_messageInfo_SeekInfo.Size(m) +} +func (m *SeekInfo) XXX_DiscardUnknown() { + xxx_messageInfo_SeekInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_SeekInfo proto.InternalMessageInfo + +func (m *SeekInfo) GetStart() *SeekPosition { + if m != nil { + return m.Start + } + return nil +} + +func (m *SeekInfo) GetStop() *SeekPosition { + if m != nil { + return m.Stop + } + return nil +} + +func (m *SeekInfo) GetBehavior() SeekInfo_SeekBehavior { + if m != nil { + return m.Behavior + } + return SeekInfo_BLOCK_UNTIL_READY +} + +func (m *SeekInfo) GetErrorResponse() SeekInfo_SeekErrorResponse { + if m != nil { + return m.ErrorResponse + } + return SeekInfo_STRICT +} + +type DeliverResponse struct { + // Types that are valid to be assigned to Type: + // *DeliverResponse_Status + // *DeliverResponse_Block + Type isDeliverResponse_Type `protobuf_oneof:"Type"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeliverResponse) Reset() { *m = DeliverResponse{} } +func (m *DeliverResponse) String() string { return proto.CompactTextString(m) } +func (*DeliverResponse) ProtoMessage() {} +func (*DeliverResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ab_237e854d47750248, []int{6} +} +func (m *DeliverResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeliverResponse.Unmarshal(m, b) +} +func (m *DeliverResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeliverResponse.Marshal(b, m, deterministic) +} +func (dst *DeliverResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeliverResponse.Merge(dst, src) +} +func (m *DeliverResponse) XXX_Size() int { + return xxx_messageInfo_DeliverResponse.Size(m) +} +func (m *DeliverResponse) XXX_DiscardUnknown() { + xxx_messageInfo_DeliverResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_DeliverResponse proto.InternalMessageInfo + +type isDeliverResponse_Type interface { + isDeliverResponse_Type() +} + +type DeliverResponse_Status struct { + Status common.Status `protobuf:"varint,1,opt,name=status,proto3,enum=common.Status,oneof"` +} + +type DeliverResponse_Block struct { + Block *common.Block `protobuf:"bytes,2,opt,name=block,proto3,oneof"` +} + +func (*DeliverResponse_Status) isDeliverResponse_Type() {} + +func (*DeliverResponse_Block) isDeliverResponse_Type() {} + +func (m *DeliverResponse) GetType() isDeliverResponse_Type { + if m != nil { + return m.Type + } + return nil +} + +func (m *DeliverResponse) GetStatus() common.Status { + if x, ok := m.GetType().(*DeliverResponse_Status); ok { + return x.Status + } + return common.Status_UNKNOWN +} + +func (m *DeliverResponse) GetBlock() *common.Block { + if x, ok := m.GetType().(*DeliverResponse_Block); ok { + return x.Block + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*DeliverResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _DeliverResponse_OneofMarshaler, _DeliverResponse_OneofUnmarshaler, _DeliverResponse_OneofSizer, []interface{}{ + (*DeliverResponse_Status)(nil), + (*DeliverResponse_Block)(nil), + } +} + +func _DeliverResponse_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*DeliverResponse) + // Type + switch x := m.Type.(type) { + case *DeliverResponse_Status: + b.EncodeVarint(1<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.Status)) + case *DeliverResponse_Block: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Block); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("DeliverResponse.Type has unexpected type %T", x) + } + return nil +} + +func _DeliverResponse_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*DeliverResponse) + switch tag { + case 1: // Type.status + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Type = &DeliverResponse_Status{common.Status(x)} + return true, err + case 2: // Type.block + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(common.Block) + err := b.DecodeMessage(msg) + m.Type = &DeliverResponse_Block{msg} + return true, err + default: + return false, nil + } +} + +func _DeliverResponse_OneofSizer(msg proto.Message) (n int) { + m := msg.(*DeliverResponse) + // Type + switch x := m.Type.(type) { + case *DeliverResponse_Status: + n += 1 // tag and wire + n += proto.SizeVarint(uint64(x.Status)) + case *DeliverResponse_Block: + s := proto.Size(x.Block) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +func init() { + proto.RegisterType((*BroadcastResponse)(nil), "orderer.BroadcastResponse") + proto.RegisterType((*SeekNewest)(nil), "orderer.SeekNewest") + proto.RegisterType((*SeekOldest)(nil), "orderer.SeekOldest") + proto.RegisterType((*SeekSpecified)(nil), "orderer.SeekSpecified") + proto.RegisterType((*SeekPosition)(nil), "orderer.SeekPosition") + proto.RegisterType((*SeekInfo)(nil), "orderer.SeekInfo") + proto.RegisterType((*DeliverResponse)(nil), "orderer.DeliverResponse") + proto.RegisterEnum("orderer.SeekInfo_SeekBehavior", SeekInfo_SeekBehavior_name, SeekInfo_SeekBehavior_value) + proto.RegisterEnum("orderer.SeekInfo_SeekErrorResponse", SeekInfo_SeekErrorResponse_name, SeekInfo_SeekErrorResponse_value) +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// AtomicBroadcastClient is the client API for AtomicBroadcast service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type AtomicBroadcastClient interface { + // broadcast receives a reply of Acknowledgement for each common.Envelope in order, indicating success or type of failure + Broadcast(ctx context.Context, opts ...grpc.CallOption) (AtomicBroadcast_BroadcastClient, error) + // deliver first requires an Envelope of type DELIVER_SEEK_INFO with Payload data as a mashaled SeekInfo message, then a stream of block replies is received. + Deliver(ctx context.Context, opts ...grpc.CallOption) (AtomicBroadcast_DeliverClient, error) +} + +type atomicBroadcastClient struct { + cc *grpc.ClientConn +} + +func NewAtomicBroadcastClient(cc *grpc.ClientConn) AtomicBroadcastClient { + return &atomicBroadcastClient{cc} +} + +func (c *atomicBroadcastClient) Broadcast(ctx context.Context, opts ...grpc.CallOption) (AtomicBroadcast_BroadcastClient, error) { + stream, err := c.cc.NewStream(ctx, &_AtomicBroadcast_serviceDesc.Streams[0], "/orderer.AtomicBroadcast/Broadcast", opts...) + if err != nil { + return nil, err + } + x := &atomicBroadcastBroadcastClient{stream} + return x, nil +} + +type AtomicBroadcast_BroadcastClient interface { + Send(*common.Envelope) error + Recv() (*BroadcastResponse, error) + grpc.ClientStream +} + +type atomicBroadcastBroadcastClient struct { + grpc.ClientStream +} + +func (x *atomicBroadcastBroadcastClient) Send(m *common.Envelope) error { + return x.ClientStream.SendMsg(m) +} + +func (x *atomicBroadcastBroadcastClient) Recv() (*BroadcastResponse, error) { + m := new(BroadcastResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *atomicBroadcastClient) Deliver(ctx context.Context, opts ...grpc.CallOption) (AtomicBroadcast_DeliverClient, error) { + stream, err := c.cc.NewStream(ctx, &_AtomicBroadcast_serviceDesc.Streams[1], "/orderer.AtomicBroadcast/Deliver", opts...) + if err != nil { + return nil, err + } + x := &atomicBroadcastDeliverClient{stream} + return x, nil +} + +type AtomicBroadcast_DeliverClient interface { + Send(*common.Envelope) error + Recv() (*DeliverResponse, error) + grpc.ClientStream +} + +type atomicBroadcastDeliverClient struct { + grpc.ClientStream +} + +func (x *atomicBroadcastDeliverClient) Send(m *common.Envelope) error { + return x.ClientStream.SendMsg(m) +} + +func (x *atomicBroadcastDeliverClient) Recv() (*DeliverResponse, error) { + m := new(DeliverResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// AtomicBroadcastServer is the server API for AtomicBroadcast service. +type AtomicBroadcastServer interface { + // broadcast receives a reply of Acknowledgement for each common.Envelope in order, indicating success or type of failure + Broadcast(AtomicBroadcast_BroadcastServer) error + // deliver first requires an Envelope of type DELIVER_SEEK_INFO with Payload data as a mashaled SeekInfo message, then a stream of block replies is received. + Deliver(AtomicBroadcast_DeliverServer) error +} + +func RegisterAtomicBroadcastServer(s *grpc.Server, srv AtomicBroadcastServer) { + s.RegisterService(&_AtomicBroadcast_serviceDesc, srv) +} + +func _AtomicBroadcast_Broadcast_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(AtomicBroadcastServer).Broadcast(&atomicBroadcastBroadcastServer{stream}) +} + +type AtomicBroadcast_BroadcastServer interface { + Send(*BroadcastResponse) error + Recv() (*common.Envelope, error) + grpc.ServerStream +} + +type atomicBroadcastBroadcastServer struct { + grpc.ServerStream +} + +func (x *atomicBroadcastBroadcastServer) Send(m *BroadcastResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *atomicBroadcastBroadcastServer) Recv() (*common.Envelope, error) { + m := new(common.Envelope) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _AtomicBroadcast_Deliver_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(AtomicBroadcastServer).Deliver(&atomicBroadcastDeliverServer{stream}) +} + +type AtomicBroadcast_DeliverServer interface { + Send(*DeliverResponse) error + Recv() (*common.Envelope, error) + grpc.ServerStream +} + +type atomicBroadcastDeliverServer struct { + grpc.ServerStream +} + +func (x *atomicBroadcastDeliverServer) Send(m *DeliverResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *atomicBroadcastDeliverServer) Recv() (*common.Envelope, error) { + m := new(common.Envelope) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _AtomicBroadcast_serviceDesc = grpc.ServiceDesc{ + ServiceName: "orderer.AtomicBroadcast", + HandlerType: (*AtomicBroadcastServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Broadcast", + Handler: _AtomicBroadcast_Broadcast_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "Deliver", + Handler: _AtomicBroadcast_Deliver_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "orderer/ab.proto", +} + +func init() { proto.RegisterFile("orderer/ab.proto", fileDescriptor_ab_237e854d47750248) } + +var fileDescriptor_ab_237e854d47750248 = []byte{ + // 560 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0xdd, 0x6e, 0xd3, 0x30, + 0x14, 0xc7, 0x93, 0xd1, 0x65, 0xdb, 0xd9, 0xfa, 0xe5, 0x69, 0x53, 0xd5, 0x0b, 0x34, 0x05, 0x0d, + 0x8a, 0x80, 0x64, 0x2a, 0x12, 0x17, 0x80, 0x84, 0x9a, 0xad, 0x55, 0x0b, 0x55, 0x8b, 0xdc, 0xec, + 0x02, 0x6e, 0xa2, 0x24, 0x75, 0x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0x45, 0xe6, 0xd1, 0x8a, 0x6c, 0xf8, 0xc6, 0xff, 0xef, 0x27, 0x9f, 0xac, 0xba, 0xa1, 0xe7, 0xb0, + 0x1b, 0xcc, 0x69, 0x78, 0xa3, 0x0e, 0xb8, 0x98, 0x83, 0x0e, 0x4f, 0x76, 0x35, 0x2c, 0x57, 0xf3, + 0x41, 0x36, 0x7f, 0xe9, 0x50, 0x6e, 0x65, 0x74, 0x11, 0x85, 0xeb, 0x47, 0x81, 0x3e, 0xc1, 0xc1, + 0x26, 0xa8, 0xe4, 0x0d, 0xda, 0xf1, 0x8a, 0xcc, 0x69, 0x42, 0xea, 0xf5, 0xf5, 0x11, 0x3e, 0x78, + 0x47, 0xa6, 0xd6, 0xd0, 0x2f, 0x74, 0xf4, 0x01, 0xf6, 0xd4, 0x06, 0x1e, 0x29, 0xaf, 0xad, 0xcb, + 0xef, 0x6d, 0x52, 0x16, 0x3b, 0xd7, 0x70, 0x4e, 0xd9, 0xd4, 0x9a, 0xdd, 0x26, 0x84, 0xcd, 0xc9, + 0x78, 0x4a, 0x98, 0x35, 0xf1, 0x03, 0x16, 0x85, 0xf2, 0xfd, 0xa6, 0x79, 0xf9, 0xf7, 0xd7, 0xd3, + 0x28, 0x9b, 0x2d, 0x03, 0x2e, 0x60, 0xdf, 0xa1, 0x6d, 0x49, 0xdb, 0x92, 0xb6, 0x15, 0x1d, 0x18, + 0x22, 0x7e, 0xfb, 0x37, 0x00, 0x00, 0xff, 0xff, 0x48, 0x6c, 0xc9, 0x45, 0x2f, 0x04, 0x00, 0x00, +} diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/orderer/ab.proto b/integration/vendor/github.com/hyperledger/fabric/protos/orderer/ab.proto new file mode 100644 index 00000000..227060ec --- /dev/null +++ b/integration/vendor/github.com/hyperledger/fabric/protos/orderer/ab.proto @@ -0,0 +1,94 @@ +/* +Copyright IBM Corp. 2016 All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +syntax = "proto3"; + +import "common/common.proto"; + +option go_package = "github.com/hyperledger/fabric/protos/orderer"; +option java_package = "org.hyperledger.fabric.protos.orderer"; + +package orderer; + +message BroadcastResponse { + // Status code, which may be used to programatically respond to success/failure + common.Status status = 1; + // Info string which may contain additional information about the status returned + string info = 2; +} + +message SeekNewest { } + +message SeekOldest { } + +message SeekSpecified { + uint64 number = 1; +} + +message SeekPosition { + oneof Type { + SeekNewest newest = 1; + SeekOldest oldest = 2; + SeekSpecified specified = 3; + } +} + +// SeekInfo specifies the range of requested blocks to return +// If the start position is not found, an error is immediately returned +// Otherwise, blocks are returned until a missing block is encountered, then behavior is dictated +// by the SeekBehavior specified. +message SeekInfo { + // If BLOCK_UNTIL_READY is specified, the reply will block until the requested blocks are available, + // if FAIL_IF_NOT_READY is specified, the reply will return an error indicating that the block is not + // found. To request that all blocks be returned indefinitely as they are created, behavior should be + // set to BLOCK_UNTIL_READY and the stop should be set to specified with a number of MAX_UINT64 + enum SeekBehavior { + BLOCK_UNTIL_READY = 0; + FAIL_IF_NOT_READY = 1; + } + + // SeekErrorTolerance indicates to the server how block provider errors should be tolerated. By default, + // if the deliver service detects a problem in the underlying block source (typically, in the orderer, + // a consenter error), it will begin to reject deliver requests. This is to prevent a client from waiting + // for blocks from an orderer which is stuck in an errored state. This is almost always the desired behavior + // and clients should stick with the default STRICT checking behavior. However, in some scenarios, particularly + // when attempting to recover from a crash or other corruption, it's desirable to force an orderer to respond + // with blocks on a best effort basis, even if the backing consensus implementation is in an errored state. + // In this case, set the SeekErrorResponse to BEST_EFFORT to ignore the consenter errors. + enum SeekErrorResponse { + STRICT = 0; + BEST_EFFORT = 1; + } + SeekPosition start = 1; // The position to start the deliver from + SeekPosition stop = 2; // The position to stop the deliver + SeekBehavior behavior = 3; // The behavior when a missing block is encountered + SeekErrorResponse error_response = 4; // How to respond to errors reported to the deliver service +} + +message DeliverResponse { + oneof Type { + common.Status status = 1; + common.Block block = 2; + } +} + +service AtomicBroadcast { + // broadcast receives a reply of Acknowledgement for each common.Envelope in order, indicating success or type of failure + rpc Broadcast(stream common.Envelope) returns (stream BroadcastResponse) {} + + // deliver first requires an Envelope of type DELIVER_SEEK_INFO with Payload data as a mashaled SeekInfo message, then a stream of block replies is received. + rpc Deliver(stream common.Envelope) returns (stream DeliverResponse) {} +} diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/orderer/cluster.pb.go b/integration/vendor/github.com/hyperledger/fabric/protos/orderer/cluster.pb.go new file mode 100644 index 00000000..496dd980 --- /dev/null +++ b/integration/vendor/github.com/hyperledger/fabric/protos/orderer/cluster.pb.go @@ -0,0 +1,594 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: orderer/cluster.proto + +package orderer // import "github.com/hyperledger/fabric/protos/orderer" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import common "github.com/hyperledger/fabric/protos/common" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +// StepRequest wraps a message that is sent to a cluster member. +type StepRequest struct { + // Types that are valid to be assigned to Payload: + // *StepRequest_ConsensusRequest + // *StepRequest_SubmitRequest + Payload isStepRequest_Payload `protobuf_oneof:"payload"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StepRequest) Reset() { *m = StepRequest{} } +func (m *StepRequest) String() string { return proto.CompactTextString(m) } +func (*StepRequest) ProtoMessage() {} +func (*StepRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_cluster_d9833ceca5c79414, []int{0} +} +func (m *StepRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_StepRequest.Unmarshal(m, b) +} +func (m *StepRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_StepRequest.Marshal(b, m, deterministic) +} +func (dst *StepRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_StepRequest.Merge(dst, src) +} +func (m *StepRequest) XXX_Size() int { + return xxx_messageInfo_StepRequest.Size(m) +} +func (m *StepRequest) XXX_DiscardUnknown() { + xxx_messageInfo_StepRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_StepRequest proto.InternalMessageInfo + +type isStepRequest_Payload interface { + isStepRequest_Payload() +} + +type StepRequest_ConsensusRequest struct { + ConsensusRequest *ConsensusRequest `protobuf:"bytes,1,opt,name=consensus_request,json=consensusRequest,proto3,oneof"` +} + +type StepRequest_SubmitRequest struct { + SubmitRequest *SubmitRequest `protobuf:"bytes,2,opt,name=submit_request,json=submitRequest,proto3,oneof"` +} + +func (*StepRequest_ConsensusRequest) isStepRequest_Payload() {} + +func (*StepRequest_SubmitRequest) isStepRequest_Payload() {} + +func (m *StepRequest) GetPayload() isStepRequest_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (m *StepRequest) GetConsensusRequest() *ConsensusRequest { + if x, ok := m.GetPayload().(*StepRequest_ConsensusRequest); ok { + return x.ConsensusRequest + } + return nil +} + +func (m *StepRequest) GetSubmitRequest() *SubmitRequest { + if x, ok := m.GetPayload().(*StepRequest_SubmitRequest); ok { + return x.SubmitRequest + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*StepRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _StepRequest_OneofMarshaler, _StepRequest_OneofUnmarshaler, _StepRequest_OneofSizer, []interface{}{ + (*StepRequest_ConsensusRequest)(nil), + (*StepRequest_SubmitRequest)(nil), + } +} + +func _StepRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*StepRequest) + // payload + switch x := m.Payload.(type) { + case *StepRequest_ConsensusRequest: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ConsensusRequest); err != nil { + return err + } + case *StepRequest_SubmitRequest: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SubmitRequest); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("StepRequest.Payload has unexpected type %T", x) + } + return nil +} + +func _StepRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*StepRequest) + switch tag { + case 1: // payload.consensus_request + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ConsensusRequest) + err := b.DecodeMessage(msg) + m.Payload = &StepRequest_ConsensusRequest{msg} + return true, err + case 2: // payload.submit_request + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SubmitRequest) + err := b.DecodeMessage(msg) + m.Payload = &StepRequest_SubmitRequest{msg} + return true, err + default: + return false, nil + } +} + +func _StepRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*StepRequest) + // payload + switch x := m.Payload.(type) { + case *StepRequest_ConsensusRequest: + s := proto.Size(x.ConsensusRequest) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *StepRequest_SubmitRequest: + s := proto.Size(x.SubmitRequest) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// StepResponse is a message received from a cluster member. +type StepResponse struct { + // Types that are valid to be assigned to Payload: + // *StepResponse_SubmitRes + Payload isStepResponse_Payload `protobuf_oneof:"payload"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StepResponse) Reset() { *m = StepResponse{} } +func (m *StepResponse) String() string { return proto.CompactTextString(m) } +func (*StepResponse) ProtoMessage() {} +func (*StepResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_cluster_d9833ceca5c79414, []int{1} +} +func (m *StepResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_StepResponse.Unmarshal(m, b) +} +func (m *StepResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_StepResponse.Marshal(b, m, deterministic) +} +func (dst *StepResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_StepResponse.Merge(dst, src) +} +func (m *StepResponse) XXX_Size() int { + return xxx_messageInfo_StepResponse.Size(m) +} +func (m *StepResponse) XXX_DiscardUnknown() { + xxx_messageInfo_StepResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_StepResponse proto.InternalMessageInfo + +type isStepResponse_Payload interface { + isStepResponse_Payload() +} + +type StepResponse_SubmitRes struct { + SubmitRes *SubmitResponse `protobuf:"bytes,1,opt,name=submit_res,json=submitRes,proto3,oneof"` +} + +func (*StepResponse_SubmitRes) isStepResponse_Payload() {} + +func (m *StepResponse) GetPayload() isStepResponse_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (m *StepResponse) GetSubmitRes() *SubmitResponse { + if x, ok := m.GetPayload().(*StepResponse_SubmitRes); ok { + return x.SubmitRes + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*StepResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _StepResponse_OneofMarshaler, _StepResponse_OneofUnmarshaler, _StepResponse_OneofSizer, []interface{}{ + (*StepResponse_SubmitRes)(nil), + } +} + +func _StepResponse_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*StepResponse) + // payload + switch x := m.Payload.(type) { + case *StepResponse_SubmitRes: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SubmitRes); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("StepResponse.Payload has unexpected type %T", x) + } + return nil +} + +func _StepResponse_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*StepResponse) + switch tag { + case 1: // payload.submit_res + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SubmitResponse) + err := b.DecodeMessage(msg) + m.Payload = &StepResponse_SubmitRes{msg} + return true, err + default: + return false, nil + } +} + +func _StepResponse_OneofSizer(msg proto.Message) (n int) { + m := msg.(*StepResponse) + // payload + switch x := m.Payload.(type) { + case *StepResponse_SubmitRes: + s := proto.Size(x.SubmitRes) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// ConsensusRequest is a consensus specific message sent to a cluster member. +type ConsensusRequest struct { + Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"` + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ConsensusRequest) Reset() { *m = ConsensusRequest{} } +func (m *ConsensusRequest) String() string { return proto.CompactTextString(m) } +func (*ConsensusRequest) ProtoMessage() {} +func (*ConsensusRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_cluster_d9833ceca5c79414, []int{2} +} +func (m *ConsensusRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ConsensusRequest.Unmarshal(m, b) +} +func (m *ConsensusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ConsensusRequest.Marshal(b, m, deterministic) +} +func (dst *ConsensusRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsensusRequest.Merge(dst, src) +} +func (m *ConsensusRequest) XXX_Size() int { + return xxx_messageInfo_ConsensusRequest.Size(m) +} +func (m *ConsensusRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ConsensusRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ConsensusRequest proto.InternalMessageInfo + +func (m *ConsensusRequest) GetChannel() string { + if m != nil { + return m.Channel + } + return "" +} + +func (m *ConsensusRequest) GetPayload() []byte { + if m != nil { + return m.Payload + } + return nil +} + +// SubmitRequest wraps a transaction to be sent for ordering. +type SubmitRequest struct { + Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"` + // last_validation_seq denotes the last + // configuration sequence at which the + // sender validated this message. + LastValidationSeq uint64 `protobuf:"varint,2,opt,name=last_validation_seq,json=lastValidationSeq,proto3" json:"last_validation_seq,omitempty"` + // content is the fabric transaction + // that is forwarded to the cluster member. + Payload *common.Envelope `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SubmitRequest) Reset() { *m = SubmitRequest{} } +func (m *SubmitRequest) String() string { return proto.CompactTextString(m) } +func (*SubmitRequest) ProtoMessage() {} +func (*SubmitRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_cluster_d9833ceca5c79414, []int{3} +} +func (m *SubmitRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SubmitRequest.Unmarshal(m, b) +} +func (m *SubmitRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SubmitRequest.Marshal(b, m, deterministic) +} +func (dst *SubmitRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SubmitRequest.Merge(dst, src) +} +func (m *SubmitRequest) XXX_Size() int { + return xxx_messageInfo_SubmitRequest.Size(m) +} +func (m *SubmitRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SubmitRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_SubmitRequest proto.InternalMessageInfo + +func (m *SubmitRequest) GetChannel() string { + if m != nil { + return m.Channel + } + return "" +} + +func (m *SubmitRequest) GetLastValidationSeq() uint64 { + if m != nil { + return m.LastValidationSeq + } + return 0 +} + +func (m *SubmitRequest) GetPayload() *common.Envelope { + if m != nil { + return m.Payload + } + return nil +} + +// SubmitResponse returns a success +// or failure status to the sender. +type SubmitResponse struct { + Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"` + // Status code, which may be used to programatically respond to success/failure. + Status common.Status `protobuf:"varint,2,opt,name=status,proto3,enum=common.Status" json:"status,omitempty"` + // Info string which may contain additional information about the returned status. + Info string `protobuf:"bytes,3,opt,name=info,proto3" json:"info,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SubmitResponse) Reset() { *m = SubmitResponse{} } +func (m *SubmitResponse) String() string { return proto.CompactTextString(m) } +func (*SubmitResponse) ProtoMessage() {} +func (*SubmitResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_cluster_d9833ceca5c79414, []int{4} +} +func (m *SubmitResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SubmitResponse.Unmarshal(m, b) +} +func (m *SubmitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SubmitResponse.Marshal(b, m, deterministic) +} +func (dst *SubmitResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SubmitResponse.Merge(dst, src) +} +func (m *SubmitResponse) XXX_Size() int { + return xxx_messageInfo_SubmitResponse.Size(m) +} +func (m *SubmitResponse) XXX_DiscardUnknown() { + xxx_messageInfo_SubmitResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_SubmitResponse proto.InternalMessageInfo + +func (m *SubmitResponse) GetChannel() string { + if m != nil { + return m.Channel + } + return "" +} + +func (m *SubmitResponse) GetStatus() common.Status { + if m != nil { + return m.Status + } + return common.Status_UNKNOWN +} + +func (m *SubmitResponse) GetInfo() string { + if m != nil { + return m.Info + } + return "" +} + +func init() { + proto.RegisterType((*StepRequest)(nil), "orderer.StepRequest") + proto.RegisterType((*StepResponse)(nil), "orderer.StepResponse") + proto.RegisterType((*ConsensusRequest)(nil), "orderer.ConsensusRequest") + proto.RegisterType((*SubmitRequest)(nil), "orderer.SubmitRequest") + proto.RegisterType((*SubmitResponse)(nil), "orderer.SubmitResponse") +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// ClusterClient is the client API for Cluster service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ClusterClient interface { + // Step passes an implementation-specific message to another cluster member. + Step(ctx context.Context, opts ...grpc.CallOption) (Cluster_StepClient, error) +} + +type clusterClient struct { + cc *grpc.ClientConn +} + +func NewClusterClient(cc *grpc.ClientConn) ClusterClient { + return &clusterClient{cc} +} + +func (c *clusterClient) Step(ctx context.Context, opts ...grpc.CallOption) (Cluster_StepClient, error) { + stream, err := c.cc.NewStream(ctx, &_Cluster_serviceDesc.Streams[0], "/orderer.Cluster/Step", opts...) + if err != nil { + return nil, err + } + x := &clusterStepClient{stream} + return x, nil +} + +type Cluster_StepClient interface { + Send(*StepRequest) error + Recv() (*StepResponse, error) + grpc.ClientStream +} + +type clusterStepClient struct { + grpc.ClientStream +} + +func (x *clusterStepClient) Send(m *StepRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *clusterStepClient) Recv() (*StepResponse, error) { + m := new(StepResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// ClusterServer is the server API for Cluster service. +type ClusterServer interface { + // Step passes an implementation-specific message to another cluster member. + Step(Cluster_StepServer) error +} + +func RegisterClusterServer(s *grpc.Server, srv ClusterServer) { + s.RegisterService(&_Cluster_serviceDesc, srv) +} + +func _Cluster_Step_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ClusterServer).Step(&clusterStepServer{stream}) +} + +type Cluster_StepServer interface { + Send(*StepResponse) error + Recv() (*StepRequest, error) + grpc.ServerStream +} + +type clusterStepServer struct { + grpc.ServerStream +} + +func (x *clusterStepServer) Send(m *StepResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *clusterStepServer) Recv() (*StepRequest, error) { + m := new(StepRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _Cluster_serviceDesc = grpc.ServiceDesc{ + ServiceName: "orderer.Cluster", + HandlerType: (*ClusterServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Step", + Handler: _Cluster_Step_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "orderer/cluster.proto", +} + +func init() { proto.RegisterFile("orderer/cluster.proto", fileDescriptor_cluster_d9833ceca5c79414) } + +var fileDescriptor_cluster_d9833ceca5c79414 = []byte{ + // 399 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xd1, 0xee, 0xd2, 0x30, + 0x14, 0xc6, 0xff, 0x53, 0xc2, 0xb2, 0x03, 0x2c, 0x50, 0x44, 0x91, 0x2b, 0x43, 0xa2, 0x21, 0xc6, + 0x6c, 0x06, 0x2f, 0xf4, 0xce, 0x04, 0xa2, 0xe1, 0xba, 0x8b, 0x5e, 0x78, 0x43, 0xba, 0xad, 0xc0, + 0x92, 0xd1, 0x8e, 0xb6, 0x23, 0xe1, 0x01, 0x7c, 0x12, 0x5f, 0xd4, 0xac, 0xed, 0x36, 0xe0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0xb6, 0x95, 0xf4, 0xa4, 0x89, 0x1d, 0x3c, 0xaa, 0xa4, 0xdf, + 0x8d, 0x12, 0xd1, 0x13, 0xfa, 0xd8, 0x76, 0x7d, 0xa9, 0xa7, 0x1c, 0x06, 0xf6, 0xf9, 0x7e, 0xb0, + 0x33, 0xcd, 0x79, 0x41, 0xdb, 0x1c, 0x3b, 0xf0, 0x6f, 0x27, 0x7f, 0x90, 0xe3, 0x03, 0x74, 0xa5, + 0x22, 0xaa, 0x94, 0xba, 0xb5, 0xbf, 0xf4, 0x6b, 0x6c, 0xa4, 0xab, 0xd8, 0xaa, 0x08, 0x41, 0x27, + 0x63, 0x3b, 0xae, 0x9b, 0x7b, 0x58, 0xff, 0x5f, 0xae, 0xc0, 0x5d, 0x9b, 0x0d, 0x43, 0x5f, 0xa1, + 0x53, 0xbd, 0x0b, 0x7a, 0xd5, 0x7e, 0xfb, 0x76, 0x97, 0x66, 0x93, 0xbb, 0xaa, 0x49, 0xb5, 0x70, + 0x3e, 0x3b, 0xab, 0x5f, 0xf0, 0x9e, 0x8b, 0x7d, 0x70, 0xb8, 0x14, 0x54, 0xe4, 0x34, 0xdd, 0x53, + 0x11, 0xec, 0x48, 0x2c, 0xb2, 0xc4, 0xac, 0xa5, 0xac, 0x6f, 0xfe, 0xf9, 0xb4, 0xcf, 0xd4, 0xa1, + 0x8c, 0xab, 0x78, 0xe1, 0x95, 0x3b, 0x34, 0xee, 0xd0, 0xb8, 0x43, 0xeb, 0x8e, 0xbb, 0xfa, 0xfc, + 0xe5, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xcc, 0xe7, 0xa4, 0xe2, 0x0b, 0x03, 0x00, 0x00, +} diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/orderer/cluster.proto b/integration/vendor/github.com/hyperledger/fabric/protos/orderer/cluster.proto new file mode 100644 index 00000000..8440a85a --- /dev/null +++ b/integration/vendor/github.com/hyperledger/fabric/protos/orderer/cluster.proto @@ -0,0 +1,65 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +syntax = "proto3"; + +import "common/common.proto"; + +option go_package = "github.com/hyperledger/fabric/protos/orderer"; +option java_package = "org.hyperledger.fabric.protos.orderer"; + +package orderer; + +// Cluster defines communication between cluster members. +service Cluster { + // Step passes an implementation-specific message to another cluster member. + rpc Step(stream StepRequest) returns (stream StepResponse); +} + +// StepRequest wraps a message that is sent to a cluster member. +message StepRequest { + oneof payload { + // consensus_request is a consensus specific message. + ConsensusRequest consensus_request = 1; + // submit_request is a relay of a transaction. + SubmitRequest submit_request = 2; + } +} + +// StepResponse is a message received from a cluster member. +message StepResponse { + oneof payload { + SubmitResponse submit_res = 1; + } +} + +// ConsensusRequest is a consensus specific message sent to a cluster member. +message ConsensusRequest { + string channel = 1; + bytes payload = 2; +} + +// SubmitRequest wraps a transaction to be sent for ordering. +message SubmitRequest { + string channel = 1; + // last_validation_seq denotes the last + // configuration sequence at which the + // sender validated this message. + uint64 last_validation_seq = 2; + // content is the fabric transaction + // that is forwarded to the cluster member. + common.Envelope payload = 3; +} + +// SubmitResponse returns a success +// or failure status to the sender. +message SubmitResponse { + string channel = 1; + // Status code, which may be used to programatically respond to success/failure. + common.Status status = 2; + // Info string which may contain additional information about the returned status. + string info = 3; +} \ No newline at end of file diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/orderer/configuration.go b/integration/vendor/github.com/hyperledger/fabric/protos/orderer/configuration.go new file mode 100644 index 00000000..09201a37 --- /dev/null +++ b/integration/vendor/github.com/hyperledger/fabric/protos/orderer/configuration.go @@ -0,0 +1,149 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package orderer + +import ( + "fmt" + + "github.com/golang/protobuf/proto" + "github.com/golang/protobuf/ptypes/empty" + "github.com/hyperledger/fabric/protos/common" + "github.com/hyperledger/fabric/protos/msp" +) + +func init() { + common.ChannelGroupMap["Orderer"] = DynamicOrdererGroupFactory{} +} + +type DynamicOrdererGroupFactory struct{} + +func (dogf DynamicOrdererGroupFactory) DynamicConfigGroup(cg *common.ConfigGroup) proto.Message { + return &DynamicOrdererGroup{ + ConfigGroup: cg, + } +} + +type DynamicOrdererGroup struct { + *common.ConfigGroup +} + +func (dcg *DynamicOrdererGroup) DynamicMapFieldProto(name string, key string, base proto.Message) (proto.Message, error) { + switch name { + case "groups": + cg, ok := base.(*common.ConfigGroup) + if !ok { + return nil, fmt.Errorf("ConfigGroup groups can only contain ConfigGroup messages") + } + + return &DynamicOrdererOrgGroup{ + ConfigGroup: cg, + }, nil + case "values": + cv, ok := base.(*common.ConfigValue) + if !ok { + return nil, fmt.Errorf("ConfigGroup values can only contain ConfigValue messages") + } + return &DynamicOrdererConfigValue{ + ConfigValue: cv, + name: key, + }, nil + default: + return nil, fmt.Errorf("ConfigGroup does not have a dynamic field: %s", name) + } +} + +type ConsensusTypeMetadataFactory interface { + NewMessage() proto.Message +} + +// ConsensuTypeMetadataMap should have consensus implementations register their metadata message factories +var ConsensusTypeMetadataMap = map[string]ConsensusTypeMetadataFactory{} + +func (ct *ConsensusType) VariablyOpaqueFields() []string { + return []string{"metadata"} +} + +func (ct *ConsensusType) VariablyOpaqueFieldProto(name string) (proto.Message, error) { + if name != "metadata" { + return nil, fmt.Errorf("not a valid opaque field: %s", name) + } + ctmf, ok := ConsensusTypeMetadataMap[ct.Type] + if ok { + return ctmf.NewMessage(), nil + } + return &empty.Empty{}, nil + +} + +type DynamicOrdererOrgGroup struct { + *common.ConfigGroup +} + +func (dcg *DynamicOrdererOrgGroup) DynamicMapFieldProto(name string, key string, base proto.Message) (proto.Message, error) { + switch name { + case "groups": + return nil, fmt.Errorf("the orderer orgs do not support sub-groups") + case "values": + cv, ok := base.(*common.ConfigValue) + if !ok { + return nil, fmt.Errorf("ConfigGroup values can only contain ConfigValue messages") + } + + return &DynamicOrdererOrgConfigValue{ + ConfigValue: cv, + name: key, + }, nil + default: + return nil, fmt.Errorf("not a dynamic orderer map field: %s", name) + } +} + +type DynamicOrdererConfigValue struct { + *common.ConfigValue + name string +} + +func (docv *DynamicOrdererConfigValue) VariablyOpaqueFieldProto(name string) (proto.Message, error) { + if name != docv.VariablyOpaqueFields()[0] { + return nil, fmt.Errorf("not a marshaled field: %s", name) + } + switch docv.name { + case "ConsensusType": + return &ConsensusType{}, nil + case "BatchSize": + return &BatchSize{}, nil + case "BatchTimeout": + return &BatchTimeout{}, nil + case "KafkaBrokers": + return &KafkaBrokers{}, nil + case "ChannelRestrictions": + return &ChannelRestrictions{}, nil + case "Capabilities": + return &common.Capabilities{}, nil + default: + return nil, fmt.Errorf("unknown Orderer ConfigValue name: %s", docv.name) + } +} + +type DynamicOrdererOrgConfigValue struct { + *common.ConfigValue + name string +} + +func (doocv *DynamicOrdererOrgConfigValue) VariablyOpaqueFieldProto(name string) (proto.Message, error) { + if name != doocv.VariablyOpaqueFields()[0] { + return nil, fmt.Errorf("not a marshaled field: %s", name) + } + switch doocv.name { + case "MSP": + return &msp.MSPConfig{}, nil + case "Endpoints": + return &common.OrdererAddresses{}, nil + default: + return nil, fmt.Errorf("unknown Orderer Org ConfigValue name: %s", doocv.name) + } +} diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/orderer/configuration.pb.go b/integration/vendor/github.com/hyperledger/fabric/protos/orderer/configuration.pb.go new file mode 100644 index 00000000..77f7215c --- /dev/null +++ b/integration/vendor/github.com/hyperledger/fabric/protos/orderer/configuration.pb.go @@ -0,0 +1,326 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: orderer/configuration.proto + +package orderer // import "github.com/hyperledger/fabric/protos/orderer" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +// State defines the orderer mode of operation, typically for consensus-type migration. +// NORMAL is during normal operation, when consensus-type migration is not, and can not, take place. +// MAINTENANCE is when the consensus-type can be changed. +type ConsensusType_State int32 + +const ( + ConsensusType_STATE_NORMAL ConsensusType_State = 0 + ConsensusType_STATE_MAINTENANCE ConsensusType_State = 1 +) + +var ConsensusType_State_name = map[int32]string{ + 0: "STATE_NORMAL", + 1: "STATE_MAINTENANCE", +} +var ConsensusType_State_value = map[string]int32{ + "STATE_NORMAL": 0, + "STATE_MAINTENANCE": 1, +} + +func (x ConsensusType_State) String() string { + return proto.EnumName(ConsensusType_State_name, int32(x)) +} +func (ConsensusType_State) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_configuration_3a2420d24de6d468, []int{0, 0} +} + +type ConsensusType struct { + // The consensus type: "solo", "kafka" or "etcdraft". + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + // Opaque metadata, dependent on the consensus type. + Metadata []byte `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` + // The state signals the ordering service to go into maintenance mode, typically for consensus-type migration. + State ConsensusType_State `protobuf:"varint,3,opt,name=state,proto3,enum=orderer.ConsensusType_State" json:"state,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ConsensusType) Reset() { *m = ConsensusType{} } +func (m *ConsensusType) String() string { return proto.CompactTextString(m) } +func (*ConsensusType) ProtoMessage() {} +func (*ConsensusType) Descriptor() ([]byte, []int) { + return fileDescriptor_configuration_3a2420d24de6d468, []int{0} +} +func (m *ConsensusType) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ConsensusType.Unmarshal(m, b) +} +func (m *ConsensusType) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ConsensusType.Marshal(b, m, deterministic) +} +func (dst *ConsensusType) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsensusType.Merge(dst, src) +} +func (m *ConsensusType) XXX_Size() int { + return xxx_messageInfo_ConsensusType.Size(m) +} +func (m *ConsensusType) XXX_DiscardUnknown() { + xxx_messageInfo_ConsensusType.DiscardUnknown(m) +} + +var xxx_messageInfo_ConsensusType proto.InternalMessageInfo + +func (m *ConsensusType) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *ConsensusType) GetMetadata() []byte { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *ConsensusType) GetState() ConsensusType_State { + if m != nil { + return m.State + } + return ConsensusType_STATE_NORMAL +} + +type BatchSize struct { + // Simply specified as number of messages for now, in the future + // we may want to allow this to be specified by size in bytes + MaxMessageCount uint32 `protobuf:"varint,1,opt,name=max_message_count,json=maxMessageCount,proto3" json:"max_message_count,omitempty"` + // The byte count of the serialized messages in a batch cannot + // exceed this value. + AbsoluteMaxBytes uint32 `protobuf:"varint,2,opt,name=absolute_max_bytes,json=absoluteMaxBytes,proto3" json:"absolute_max_bytes,omitempty"` + // The byte count of the serialized messages in a batch should not + // exceed this value. + PreferredMaxBytes uint32 `protobuf:"varint,3,opt,name=preferred_max_bytes,json=preferredMaxBytes,proto3" json:"preferred_max_bytes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BatchSize) Reset() { *m = BatchSize{} } +func (m *BatchSize) String() string { return proto.CompactTextString(m) } +func (*BatchSize) ProtoMessage() {} +func (*BatchSize) Descriptor() ([]byte, []int) { + return fileDescriptor_configuration_3a2420d24de6d468, []int{1} +} +func (m *BatchSize) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BatchSize.Unmarshal(m, b) +} +func (m *BatchSize) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BatchSize.Marshal(b, m, deterministic) +} +func (dst *BatchSize) XXX_Merge(src proto.Message) { + xxx_messageInfo_BatchSize.Merge(dst, src) +} +func (m *BatchSize) XXX_Size() int { + return xxx_messageInfo_BatchSize.Size(m) +} +func (m *BatchSize) XXX_DiscardUnknown() { + xxx_messageInfo_BatchSize.DiscardUnknown(m) +} + +var xxx_messageInfo_BatchSize proto.InternalMessageInfo + +func (m *BatchSize) GetMaxMessageCount() uint32 { + if m != nil { + return m.MaxMessageCount + } + return 0 +} + +func (m *BatchSize) GetAbsoluteMaxBytes() uint32 { + if m != nil { + return m.AbsoluteMaxBytes + } + return 0 +} + +func (m *BatchSize) GetPreferredMaxBytes() uint32 { + if m != nil { + return m.PreferredMaxBytes + } + return 0 +} + +type BatchTimeout struct { + // Any duration string parseable by ParseDuration(): + // https://golang.org/pkg/time/#ParseDuration + Timeout string `protobuf:"bytes,1,opt,name=timeout,proto3" json:"timeout,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BatchTimeout) Reset() { *m = BatchTimeout{} } +func (m *BatchTimeout) String() string { return proto.CompactTextString(m) } +func (*BatchTimeout) ProtoMessage() {} +func (*BatchTimeout) Descriptor() ([]byte, []int) { + return fileDescriptor_configuration_3a2420d24de6d468, []int{2} +} +func (m *BatchTimeout) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BatchTimeout.Unmarshal(m, b) +} +func (m *BatchTimeout) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BatchTimeout.Marshal(b, m, deterministic) +} +func (dst *BatchTimeout) XXX_Merge(src proto.Message) { + xxx_messageInfo_BatchTimeout.Merge(dst, src) +} +func (m *BatchTimeout) XXX_Size() int { + return xxx_messageInfo_BatchTimeout.Size(m) +} +func (m *BatchTimeout) XXX_DiscardUnknown() { + xxx_messageInfo_BatchTimeout.DiscardUnknown(m) +} + +var xxx_messageInfo_BatchTimeout proto.InternalMessageInfo + +func (m *BatchTimeout) GetTimeout() string { + if m != nil { + return m.Timeout + } + return "" +} + +// Carries a list of bootstrap brokers, i.e. this is not the exclusive set of +// brokers an ordering service +type KafkaBrokers struct { + // Each broker here should be identified using the (IP|host):port notation, + // e.g. 127.0.0.1:7050, or localhost:7050 are valid entries + Brokers []string `protobuf:"bytes,1,rep,name=brokers,proto3" json:"brokers,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *KafkaBrokers) Reset() { *m = KafkaBrokers{} } +func (m *KafkaBrokers) String() string { return proto.CompactTextString(m) } +func (*KafkaBrokers) ProtoMessage() {} +func (*KafkaBrokers) Descriptor() ([]byte, []int) { + return fileDescriptor_configuration_3a2420d24de6d468, []int{3} +} +func (m *KafkaBrokers) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_KafkaBrokers.Unmarshal(m, b) +} +func (m *KafkaBrokers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_KafkaBrokers.Marshal(b, m, deterministic) +} +func (dst *KafkaBrokers) XXX_Merge(src proto.Message) { + xxx_messageInfo_KafkaBrokers.Merge(dst, src) +} +func (m *KafkaBrokers) XXX_Size() int { + return xxx_messageInfo_KafkaBrokers.Size(m) +} +func (m *KafkaBrokers) XXX_DiscardUnknown() { + xxx_messageInfo_KafkaBrokers.DiscardUnknown(m) +} + +var xxx_messageInfo_KafkaBrokers proto.InternalMessageInfo + +func (m *KafkaBrokers) GetBrokers() []string { + if m != nil { + return m.Brokers + } + return nil +} + +// ChannelRestrictions is the mssage which conveys restrictions on channel creation for an orderer +type ChannelRestrictions struct { + MaxCount uint64 `protobuf:"varint,1,opt,name=max_count,json=maxCount,proto3" json:"max_count,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ChannelRestrictions) Reset() { *m = ChannelRestrictions{} } +func (m *ChannelRestrictions) String() string { return proto.CompactTextString(m) } +func (*ChannelRestrictions) ProtoMessage() {} +func (*ChannelRestrictions) Descriptor() ([]byte, []int) { + return fileDescriptor_configuration_3a2420d24de6d468, []int{4} +} +func (m *ChannelRestrictions) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ChannelRestrictions.Unmarshal(m, b) +} +func (m *ChannelRestrictions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ChannelRestrictions.Marshal(b, m, deterministic) +} +func (dst *ChannelRestrictions) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChannelRestrictions.Merge(dst, src) +} +func (m *ChannelRestrictions) XXX_Size() int { + return xxx_messageInfo_ChannelRestrictions.Size(m) +} +func (m *ChannelRestrictions) XXX_DiscardUnknown() { + xxx_messageInfo_ChannelRestrictions.DiscardUnknown(m) +} + +var xxx_messageInfo_ChannelRestrictions proto.InternalMessageInfo + +func (m *ChannelRestrictions) GetMaxCount() uint64 { + if m != nil { + return m.MaxCount + } + return 0 +} + +func init() { + proto.RegisterType((*ConsensusType)(nil), "orderer.ConsensusType") + proto.RegisterType((*BatchSize)(nil), "orderer.BatchSize") + proto.RegisterType((*BatchTimeout)(nil), "orderer.BatchTimeout") + proto.RegisterType((*KafkaBrokers)(nil), "orderer.KafkaBrokers") + proto.RegisterType((*ChannelRestrictions)(nil), "orderer.ChannelRestrictions") + proto.RegisterEnum("orderer.ConsensusType_State", ConsensusType_State_name, ConsensusType_State_value) +} + +func init() { + proto.RegisterFile("orderer/configuration.proto", fileDescriptor_configuration_3a2420d24de6d468) +} + +var fileDescriptor_configuration_3a2420d24de6d468 = []byte{ + // 403 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0xc1, 0x8a, 0xdb, 0x30, + 0x10, 0x86, 0xeb, 0x66, 0xb7, 0xbb, 0x19, 0x92, 0x36, 0xd1, 0x52, 0x30, 0xdd, 0x1e, 0x82, 0xa1, + 0x10, 0xca, 0x22, 0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0x02, 0x00, 0x00, +} diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/orderer/configuration.proto b/integration/vendor/github.com/hyperledger/fabric/protos/orderer/configuration.proto new file mode 100644 index 00000000..8a15e24a --- /dev/null +++ b/integration/vendor/github.com/hyperledger/fabric/protos/orderer/configuration.proto @@ -0,0 +1,77 @@ +/* +Copyright IBM Corp. 2016 All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +syntax = "proto3"; + +option go_package = "github.com/hyperledger/fabric/protos/orderer"; +option java_package = "org.hyperledger.fabric.protos.orderer"; + +package orderer; + + +// The orderer config is specified by the following convention: +// For a configuration item with key "Key" +// the encoded value is a a proto message of type "Key" +// For example, for the configuration item of name "ConsensusType" +// the encoded value is the proto message "ConsensusType" + +message ConsensusType { + // The consensus type: "solo", "kafka" or "etcdraft". + string type = 1; + // Opaque metadata, dependent on the consensus type. + bytes metadata = 2; + + // State defines the orderer mode of operation, typically for consensus-type migration. + // NORMAL is during normal operation, when consensus-type migration is not, and can not, take place. + // MAINTENANCE is when the consensus-type can be changed. + enum State { + STATE_NORMAL = 0; + STATE_MAINTENANCE = 1; + } + // The state signals the ordering service to go into maintenance mode, typically for consensus-type migration. + State state = 3; +} + +message BatchSize { + // Simply specified as number of messages for now, in the future + // we may want to allow this to be specified by size in bytes + uint32 max_message_count = 1; + // The byte count of the serialized messages in a batch cannot + // exceed this value. + uint32 absolute_max_bytes = 2; + // The byte count of the serialized messages in a batch should not + // exceed this value. + uint32 preferred_max_bytes = 3; +} + +message BatchTimeout { + // Any duration string parseable by ParseDuration(): + // https://golang.org/pkg/time/#ParseDuration + string timeout = 1; +} + +// Carries a list of bootstrap brokers, i.e. this is not the exclusive set of +// brokers an ordering service +message KafkaBrokers { + // Each broker here should be identified using the (IP|host):port notation, + // e.g. 127.0.0.1:7050, or localhost:7050 are valid entries + repeated string brokers = 1; +} + +// ChannelRestrictions is the mssage which conveys restrictions on channel creation for an orderer +message ChannelRestrictions { + uint64 max_count = 1; // The max count of channels to allow to be created, a value of 0 indicates no limit +} diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/orderer/etcdraft/configuration.go b/integration/vendor/github.com/hyperledger/fabric/protos/orderer/etcdraft/configuration.go new file mode 100644 index 00000000..6c51037b --- /dev/null +++ b/integration/vendor/github.com/hyperledger/fabric/protos/orderer/etcdraft/configuration.go @@ -0,0 +1,53 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package etcdraft + +import ( + "fmt" + "io/ioutil" + + "github.com/golang/protobuf/proto" + "github.com/hyperledger/fabric/protos/orderer" +) + +// TypeKey is the string with which this consensus implementation is identified across Fabric. +const TypeKey = "etcdraft" + +func init() { + orderer.ConsensusTypeMetadataMap[TypeKey] = ConsensusTypeMetadataFactory{} +} + +// ConsensusTypeMetadataFactory allows this implementation's proto messages to register +// their type with the orderer's proto messages. This is needed for protolator to work. +type ConsensusTypeMetadataFactory struct{} + +// NewMessage implements the Orderer.ConsensusTypeMetadataFactory interface. +func (dogf ConsensusTypeMetadataFactory) NewMessage() proto.Message { + return &ConfigMetadata{} +} + +// Marshal serializes this implementation's proto messages. It is called by the encoder package +// during the creation of the Orderer ConfigGroup. +func Marshal(md *ConfigMetadata) ([]byte, error) { + copyMd := proto.Clone(md).(*ConfigMetadata) + for _, c := range copyMd.Consenters { + // Expect the user to set the config value for client/server certs to the + // path where they are persisted locally, then load these files to memory. + clientCert, err := ioutil.ReadFile(string(c.GetClientTlsCert())) + if err != nil { + return nil, fmt.Errorf("cannot load client cert for consenter %s:%d: %s", c.GetHost(), c.GetPort(), err) + } + c.ClientTlsCert = clientCert + + serverCert, err := ioutil.ReadFile(string(c.GetServerTlsCert())) + if err != nil { + return nil, fmt.Errorf("cannot load server cert for consenter %s:%d: %s", c.GetHost(), c.GetPort(), err) + } + c.ServerTlsCert = serverCert + } + return proto.Marshal(copyMd) +} diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/orderer/etcdraft/configuration.pb.go b/integration/vendor/github.com/hyperledger/fabric/protos/orderer/etcdraft/configuration.pb.go new file mode 100644 index 00000000..0c24c006 --- /dev/null +++ b/integration/vendor/github.com/hyperledger/fabric/protos/orderer/etcdraft/configuration.pb.go @@ -0,0 +1,308 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: orderer/etcdraft/configuration.proto + +package etcdraft // import "github.com/hyperledger/fabric/protos/orderer/etcdraft" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +// ConfigMetadata is serialized and set as the value of ConsensusType.Metadata in +// a channel configuration when the ConsensusType.Type is set "etcdraft". +type ConfigMetadata struct { + Consenters []*Consenter `protobuf:"bytes,1,rep,name=consenters,proto3" json:"consenters,omitempty"` + Options *Options `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ConfigMetadata) Reset() { *m = ConfigMetadata{} } +func (m *ConfigMetadata) String() string { return proto.CompactTextString(m) } +func (*ConfigMetadata) ProtoMessage() {} +func (*ConfigMetadata) Descriptor() ([]byte, []int) { + return fileDescriptor_configuration_780531726dd41db7, []int{0} +} +func (m *ConfigMetadata) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ConfigMetadata.Unmarshal(m, b) +} +func (m *ConfigMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ConfigMetadata.Marshal(b, m, deterministic) +} +func (dst *ConfigMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigMetadata.Merge(dst, src) +} +func (m *ConfigMetadata) XXX_Size() int { + return xxx_messageInfo_ConfigMetadata.Size(m) +} +func (m *ConfigMetadata) XXX_DiscardUnknown() { + xxx_messageInfo_ConfigMetadata.DiscardUnknown(m) +} + +var xxx_messageInfo_ConfigMetadata proto.InternalMessageInfo + +func (m *ConfigMetadata) GetConsenters() []*Consenter { + if m != nil { + return m.Consenters + } + return nil +} + +func (m *ConfigMetadata) GetOptions() *Options { + if m != nil { + return m.Options + } + return nil +} + +// Consenter represents a consenting node (i.e. replica). +type Consenter struct { + Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` + Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` + ClientTlsCert []byte `protobuf:"bytes,3,opt,name=client_tls_cert,json=clientTlsCert,proto3" json:"client_tls_cert,omitempty"` + ServerTlsCert []byte `protobuf:"bytes,4,opt,name=server_tls_cert,json=serverTlsCert,proto3" json:"server_tls_cert,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Consenter) Reset() { *m = Consenter{} } +func (m *Consenter) String() string { return proto.CompactTextString(m) } +func (*Consenter) ProtoMessage() {} +func (*Consenter) Descriptor() ([]byte, []int) { + return fileDescriptor_configuration_780531726dd41db7, []int{1} +} +func (m *Consenter) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Consenter.Unmarshal(m, b) +} +func (m *Consenter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Consenter.Marshal(b, m, deterministic) +} +func (dst *Consenter) XXX_Merge(src proto.Message) { + xxx_messageInfo_Consenter.Merge(dst, src) +} +func (m *Consenter) XXX_Size() int { + return xxx_messageInfo_Consenter.Size(m) +} +func (m *Consenter) XXX_DiscardUnknown() { + xxx_messageInfo_Consenter.DiscardUnknown(m) +} + +var xxx_messageInfo_Consenter proto.InternalMessageInfo + +func (m *Consenter) GetHost() string { + if m != nil { + return m.Host + } + return "" +} + +func (m *Consenter) GetPort() uint32 { + if m != nil { + return m.Port + } + return 0 +} + +func (m *Consenter) GetClientTlsCert() []byte { + if m != nil { + return m.ClientTlsCert + } + return nil +} + +func (m *Consenter) GetServerTlsCert() []byte { + if m != nil { + return m.ServerTlsCert + } + return nil +} + +// Options to be specified for all the etcd/raft nodes. These can be modified on a +// per-channel basis. +type Options struct { + TickInterval string `protobuf:"bytes,1,opt,name=tick_interval,json=tickInterval,proto3" json:"tick_interval,omitempty"` + ElectionTick uint32 `protobuf:"varint,2,opt,name=election_tick,json=electionTick,proto3" json:"election_tick,omitempty"` + HeartbeatTick uint32 `protobuf:"varint,3,opt,name=heartbeat_tick,json=heartbeatTick,proto3" json:"heartbeat_tick,omitempty"` + MaxInflightBlocks uint32 `protobuf:"varint,4,opt,name=max_inflight_blocks,json=maxInflightBlocks,proto3" json:"max_inflight_blocks,omitempty"` + // Take snapshot when cumulative data exceeds certain size in bytes. + SnapshotIntervalSize uint32 `protobuf:"varint,5,opt,name=snapshot_interval_size,json=snapshotIntervalSize,proto3" json:"snapshot_interval_size,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Options) Reset() { *m = Options{} } +func (m *Options) String() string { return proto.CompactTextString(m) } +func (*Options) ProtoMessage() {} +func (*Options) Descriptor() ([]byte, []int) { + return fileDescriptor_configuration_780531726dd41db7, []int{2} +} +func (m *Options) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Options.Unmarshal(m, b) +} +func (m *Options) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Options.Marshal(b, m, deterministic) +} +func (dst *Options) XXX_Merge(src proto.Message) { + xxx_messageInfo_Options.Merge(dst, src) +} +func (m *Options) XXX_Size() int { + return xxx_messageInfo_Options.Size(m) +} +func (m *Options) XXX_DiscardUnknown() { + xxx_messageInfo_Options.DiscardUnknown(m) +} + +var xxx_messageInfo_Options proto.InternalMessageInfo + +func (m *Options) GetTickInterval() string { + if m != nil { + return m.TickInterval + } + return "" +} + +func (m *Options) GetElectionTick() uint32 { + if m != nil { + return m.ElectionTick + } + return 0 +} + +func (m *Options) GetHeartbeatTick() uint32 { + if m != nil { + return m.HeartbeatTick + } + return 0 +} + +func (m *Options) GetMaxInflightBlocks() uint32 { + if m != nil { + return m.MaxInflightBlocks + } + return 0 +} + +func (m *Options) GetSnapshotIntervalSize() uint32 { + if m != nil { + return m.SnapshotIntervalSize + } + return 0 +} + +// BlockMetadata stores data used by the Raft OSNs when +// coordinating with each other, to be serialized into +// block meta dta field and used after failres and restarts. +type BlockMetadata struct { + // Maintains a mapping between the cluster's OSNs + // and their Raft IDs. + ConsenterIds []uint64 `protobuf:"varint,1,rep,packed,name=consenter_ids,json=consenterIds,proto3" json:"consenter_ids,omitempty"` + // Carries the Raft ID value that will be assigned + // to the next OSN that will join this cluster. + NextConsenterId uint64 `protobuf:"varint,2,opt,name=next_consenter_id,json=nextConsenterId,proto3" json:"next_consenter_id,omitempty"` + // Index of etcd/raft entry for current block. + RaftIndex uint64 `protobuf:"varint,3,opt,name=raft_index,json=raftIndex,proto3" json:"raft_index,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BlockMetadata) Reset() { *m = BlockMetadata{} } +func (m *BlockMetadata) String() string { return proto.CompactTextString(m) } +func (*BlockMetadata) ProtoMessage() {} +func (*BlockMetadata) Descriptor() ([]byte, []int) { + return fileDescriptor_configuration_780531726dd41db7, []int{3} +} +func (m *BlockMetadata) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BlockMetadata.Unmarshal(m, b) +} +func (m *BlockMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BlockMetadata.Marshal(b, m, deterministic) +} +func (dst *BlockMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockMetadata.Merge(dst, src) +} +func (m *BlockMetadata) XXX_Size() int { + return xxx_messageInfo_BlockMetadata.Size(m) +} +func (m *BlockMetadata) XXX_DiscardUnknown() { + xxx_messageInfo_BlockMetadata.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockMetadata proto.InternalMessageInfo + +func (m *BlockMetadata) GetConsenterIds() []uint64 { + if m != nil { + return m.ConsenterIds + } + return nil +} + +func (m *BlockMetadata) GetNextConsenterId() uint64 { + if m != nil { + return m.NextConsenterId + } + return 0 +} + +func (m *BlockMetadata) GetRaftIndex() uint64 { + if m != nil { + return m.RaftIndex + } + return 0 +} + +func init() { + proto.RegisterType((*ConfigMetadata)(nil), "etcdraft.ConfigMetadata") + proto.RegisterType((*Consenter)(nil), "etcdraft.Consenter") + proto.RegisterType((*Options)(nil), "etcdraft.Options") + proto.RegisterType((*BlockMetadata)(nil), "etcdraft.BlockMetadata") +} + +func init() { + proto.RegisterFile("orderer/etcdraft/configuration.proto", fileDescriptor_configuration_780531726dd41db7) +} + +var fileDescriptor_configuration_780531726dd41db7 = []byte{ + // 448 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x92, 0xc1, 0x6f, 0xd3, 0x30, + 0x14, 0xc6, 0x15, 0x56, 0x18, 0x7d, 0x6b, 0x36, 0xd5, 0x43, 0x28, 0x17, 0xa4, 0xaa, 0x03, 0x54, + 0x81, 0x94, 0x48, 0x1b, 0xfc, 0x03, 0xeb, 0xa9, 0x07, 0x84, 0x14, 0x76, 0xe2, 0x62, 0x39, 0xce, + 0x6b, 0x62, 0x35, 0x8d, 0x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x2c, + 0x52, 0xa9, 0xf7, 0xd9, 0x49, 0x2c, 0x0b, 0xb1, 0x2c, 0xc4, 0xb2, 0xff, 0x97, 0xbc, 0x78, 0xe5, + 0x8d, 0xbb, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x7e, 0x1e, 0x2b, 0x0a, 0xff, 0x02, 0x00, 0x00, +} diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/orderer/etcdraft/configuration.proto b/integration/vendor/github.com/hyperledger/fabric/protos/orderer/etcdraft/configuration.proto new file mode 100644 index 00000000..46eb1344 --- /dev/null +++ b/integration/vendor/github.com/hyperledger/fabric/protos/orderer/etcdraft/configuration.proto @@ -0,0 +1,52 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +syntax = "proto3"; + +option go_package = "github.com/hyperledger/fabric/protos/orderer/etcdraft"; +option java_package = "org.hyperledger.fabric.protos.orderer.etcdraft"; + +package etcdraft; + +// ConfigMetadata is serialized and set as the value of ConsensusType.Metadata in +// a channel configuration when the ConsensusType.Type is set "etcdraft". +message ConfigMetadata { + repeated Consenter consenters = 1; + Options options = 2; +} + +// Consenter represents a consenting node (i.e. replica). +message Consenter { + string host = 1; + uint32 port = 2; + bytes client_tls_cert = 3; + bytes server_tls_cert = 4; +} + +// Options to be specified for all the etcd/raft nodes. These can be modified on a +// per-channel basis. +message Options { + string tick_interval = 1; // time duration format, e.g. 500ms + uint32 election_tick = 2; + uint32 heartbeat_tick = 3; + uint32 max_inflight_blocks = 4; + // Take snapshot when cumulative data exceeds certain size in bytes. + uint32 snapshot_interval_size = 5; +} + +// BlockMetadata stores data used by the Raft OSNs when +// coordinating with each other, to be serialized into +// block meta dta field and used after failres and restarts. +message BlockMetadata { + // Maintains a mapping between the cluster's OSNs + // and their Raft IDs. + repeated uint64 consenter_ids = 1; + // Carries the Raft ID value that will be assigned + // to the next OSN that will join this cluster. + uint64 next_consenter_id = 2; + // Index of etcd/raft entry for current block. + uint64 raft_index = 3; +} diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/orderer/kafka.pb.go b/integration/vendor/github.com/hyperledger/fabric/protos/orderer/kafka.pb.go new file mode 100644 index 00000000..d84ead49 --- /dev/null +++ b/integration/vendor/github.com/hyperledger/fabric/protos/orderer/kafka.pb.go @@ -0,0 +1,485 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: orderer/kafka.proto + +package orderer // import "github.com/hyperledger/fabric/protos/orderer" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type KafkaMessageRegular_Class int32 + +const ( + KafkaMessageRegular_UNKNOWN KafkaMessageRegular_Class = 0 + KafkaMessageRegular_NORMAL KafkaMessageRegular_Class = 1 + KafkaMessageRegular_CONFIG KafkaMessageRegular_Class = 2 +) + +var KafkaMessageRegular_Class_name = map[int32]string{ + 0: "UNKNOWN", + 1: "NORMAL", + 2: "CONFIG", +} +var KafkaMessageRegular_Class_value = map[string]int32{ + "UNKNOWN": 0, + "NORMAL": 1, + "CONFIG": 2, +} + +func (x KafkaMessageRegular_Class) String() string { + return proto.EnumName(KafkaMessageRegular_Class_name, int32(x)) +} +func (KafkaMessageRegular_Class) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_kafka_d6fc97ca114dc767, []int{1, 0} +} + +// KafkaMessage is a wrapper type for the messages +// that the Kafka-based orderer deals with. +type KafkaMessage struct { + // Types that are valid to be assigned to Type: + // *KafkaMessage_Regular + // *KafkaMessage_TimeToCut + // *KafkaMessage_Connect + Type isKafkaMessage_Type `protobuf_oneof:"Type"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *KafkaMessage) Reset() { *m = KafkaMessage{} } +func (m *KafkaMessage) String() string { return proto.CompactTextString(m) } +func (*KafkaMessage) ProtoMessage() {} +func (*KafkaMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_kafka_d6fc97ca114dc767, []int{0} +} +func (m *KafkaMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_KafkaMessage.Unmarshal(m, b) +} +func (m *KafkaMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_KafkaMessage.Marshal(b, m, deterministic) +} +func (dst *KafkaMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_KafkaMessage.Merge(dst, src) +} +func (m *KafkaMessage) XXX_Size() int { + return xxx_messageInfo_KafkaMessage.Size(m) +} +func (m *KafkaMessage) XXX_DiscardUnknown() { + xxx_messageInfo_KafkaMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_KafkaMessage proto.InternalMessageInfo + +type isKafkaMessage_Type interface { + isKafkaMessage_Type() +} + +type KafkaMessage_Regular struct { + Regular *KafkaMessageRegular `protobuf:"bytes,1,opt,name=regular,proto3,oneof"` +} + +type KafkaMessage_TimeToCut struct { + TimeToCut *KafkaMessageTimeToCut `protobuf:"bytes,2,opt,name=time_to_cut,json=timeToCut,proto3,oneof"` +} + +type KafkaMessage_Connect struct { + Connect *KafkaMessageConnect `protobuf:"bytes,3,opt,name=connect,proto3,oneof"` +} + +func (*KafkaMessage_Regular) isKafkaMessage_Type() {} + +func (*KafkaMessage_TimeToCut) isKafkaMessage_Type() {} + +func (*KafkaMessage_Connect) isKafkaMessage_Type() {} + +func (m *KafkaMessage) GetType() isKafkaMessage_Type { + if m != nil { + return m.Type + } + return nil +} + +func (m *KafkaMessage) GetRegular() *KafkaMessageRegular { + if x, ok := m.GetType().(*KafkaMessage_Regular); ok { + return x.Regular + } + return nil +} + +func (m *KafkaMessage) GetTimeToCut() *KafkaMessageTimeToCut { + if x, ok := m.GetType().(*KafkaMessage_TimeToCut); ok { + return x.TimeToCut + } + return nil +} + +func (m *KafkaMessage) GetConnect() *KafkaMessageConnect { + if x, ok := m.GetType().(*KafkaMessage_Connect); ok { + return x.Connect + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*KafkaMessage) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _KafkaMessage_OneofMarshaler, _KafkaMessage_OneofUnmarshaler, _KafkaMessage_OneofSizer, []interface{}{ + (*KafkaMessage_Regular)(nil), + (*KafkaMessage_TimeToCut)(nil), + (*KafkaMessage_Connect)(nil), + } +} + +func _KafkaMessage_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*KafkaMessage) + // Type + switch x := m.Type.(type) { + case *KafkaMessage_Regular: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Regular); err != nil { + return err + } + case *KafkaMessage_TimeToCut: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TimeToCut); err != nil { + return err + } + case *KafkaMessage_Connect: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Connect); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("KafkaMessage.Type has unexpected type %T", x) + } + return nil +} + +func _KafkaMessage_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*KafkaMessage) + switch tag { + case 1: // Type.regular + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(KafkaMessageRegular) + err := b.DecodeMessage(msg) + m.Type = &KafkaMessage_Regular{msg} + return true, err + case 2: // Type.time_to_cut + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(KafkaMessageTimeToCut) + err := b.DecodeMessage(msg) + m.Type = &KafkaMessage_TimeToCut{msg} + return true, err + case 3: // Type.connect + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(KafkaMessageConnect) + err := b.DecodeMessage(msg) + m.Type = &KafkaMessage_Connect{msg} + return true, err + default: + return false, nil + } +} + +func _KafkaMessage_OneofSizer(msg proto.Message) (n int) { + m := msg.(*KafkaMessage) + // Type + switch x := m.Type.(type) { + case *KafkaMessage_Regular: + s := proto.Size(x.Regular) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *KafkaMessage_TimeToCut: + s := proto.Size(x.TimeToCut) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *KafkaMessage_Connect: + s := proto.Size(x.Connect) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// KafkaMessageRegular wraps a marshalled envelope. +type KafkaMessageRegular struct { + Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + ConfigSeq uint64 `protobuf:"varint,2,opt,name=config_seq,json=configSeq,proto3" json:"config_seq,omitempty"` + Class KafkaMessageRegular_Class `protobuf:"varint,3,opt,name=class,proto3,enum=orderer.KafkaMessageRegular_Class" json:"class,omitempty"` + OriginalOffset int64 `protobuf:"varint,4,opt,name=original_offset,json=originalOffset,proto3" json:"original_offset,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *KafkaMessageRegular) Reset() { *m = KafkaMessageRegular{} } +func (m *KafkaMessageRegular) String() string { return proto.CompactTextString(m) } +func (*KafkaMessageRegular) ProtoMessage() {} +func (*KafkaMessageRegular) Descriptor() ([]byte, []int) { + return fileDescriptor_kafka_d6fc97ca114dc767, []int{1} +} +func (m *KafkaMessageRegular) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_KafkaMessageRegular.Unmarshal(m, b) +} +func (m *KafkaMessageRegular) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_KafkaMessageRegular.Marshal(b, m, deterministic) +} +func (dst *KafkaMessageRegular) XXX_Merge(src proto.Message) { + xxx_messageInfo_KafkaMessageRegular.Merge(dst, src) +} +func (m *KafkaMessageRegular) XXX_Size() int { + return xxx_messageInfo_KafkaMessageRegular.Size(m) +} +func (m *KafkaMessageRegular) XXX_DiscardUnknown() { + xxx_messageInfo_KafkaMessageRegular.DiscardUnknown(m) +} + +var xxx_messageInfo_KafkaMessageRegular proto.InternalMessageInfo + +func (m *KafkaMessageRegular) GetPayload() []byte { + if m != nil { + return m.Payload + } + return nil +} + +func (m *KafkaMessageRegular) GetConfigSeq() uint64 { + if m != nil { + return m.ConfigSeq + } + return 0 +} + +func (m *KafkaMessageRegular) GetClass() KafkaMessageRegular_Class { + if m != nil { + return m.Class + } + return KafkaMessageRegular_UNKNOWN +} + +func (m *KafkaMessageRegular) GetOriginalOffset() int64 { + if m != nil { + return m.OriginalOffset + } + return 0 +} + +// KafkaMessageTimeToCut is used to signal to the orderers +// that it is time to cut block . +type KafkaMessageTimeToCut struct { + BlockNumber uint64 `protobuf:"varint,1,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *KafkaMessageTimeToCut) Reset() { *m = KafkaMessageTimeToCut{} } +func (m *KafkaMessageTimeToCut) String() string { return proto.CompactTextString(m) } +func (*KafkaMessageTimeToCut) ProtoMessage() {} +func (*KafkaMessageTimeToCut) Descriptor() ([]byte, []int) { + return fileDescriptor_kafka_d6fc97ca114dc767, []int{2} +} +func (m *KafkaMessageTimeToCut) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_KafkaMessageTimeToCut.Unmarshal(m, b) +} +func (m *KafkaMessageTimeToCut) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_KafkaMessageTimeToCut.Marshal(b, m, deterministic) +} +func (dst *KafkaMessageTimeToCut) XXX_Merge(src proto.Message) { + xxx_messageInfo_KafkaMessageTimeToCut.Merge(dst, src) +} +func (m *KafkaMessageTimeToCut) XXX_Size() int { + return xxx_messageInfo_KafkaMessageTimeToCut.Size(m) +} +func (m *KafkaMessageTimeToCut) XXX_DiscardUnknown() { + xxx_messageInfo_KafkaMessageTimeToCut.DiscardUnknown(m) +} + +var xxx_messageInfo_KafkaMessageTimeToCut proto.InternalMessageInfo + +func (m *KafkaMessageTimeToCut) GetBlockNumber() uint64 { + if m != nil { + return m.BlockNumber + } + return 0 +} + +// KafkaMessageConnect is posted by an orderer upon booting up. +// It is used to prevent the panic that would be caused if we +// were to consume an empty partition. It is ignored by all +// orderers when processing the partition. +type KafkaMessageConnect struct { + Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *KafkaMessageConnect) Reset() { *m = KafkaMessageConnect{} } +func (m *KafkaMessageConnect) String() string { return proto.CompactTextString(m) } +func (*KafkaMessageConnect) ProtoMessage() {} +func (*KafkaMessageConnect) Descriptor() ([]byte, []int) { + return fileDescriptor_kafka_d6fc97ca114dc767, []int{3} +} +func (m *KafkaMessageConnect) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_KafkaMessageConnect.Unmarshal(m, b) +} +func (m *KafkaMessageConnect) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_KafkaMessageConnect.Marshal(b, m, deterministic) +} +func (dst *KafkaMessageConnect) XXX_Merge(src proto.Message) { + xxx_messageInfo_KafkaMessageConnect.Merge(dst, src) +} +func (m *KafkaMessageConnect) XXX_Size() int { + return xxx_messageInfo_KafkaMessageConnect.Size(m) +} +func (m *KafkaMessageConnect) XXX_DiscardUnknown() { + xxx_messageInfo_KafkaMessageConnect.DiscardUnknown(m) +} + +var xxx_messageInfo_KafkaMessageConnect proto.InternalMessageInfo + +func (m *KafkaMessageConnect) GetPayload() []byte { + if m != nil { + return m.Payload + } + return nil +} + +// KafkaMetadata is encoded into the ORDERER block to keep track of +// Kafka-related metadata associated with this block. +type KafkaMetadata struct { + // LastOffsetPersisted is the encoded value for the Metadata message + // which is encoded in the ORDERER block metadata index for the case + // of the Kafka-based orderer. + LastOffsetPersisted int64 `protobuf:"varint,1,opt,name=last_offset_persisted,json=lastOffsetPersisted,proto3" json:"last_offset_persisted,omitempty"` + // LastOriginalOffsetProcessed is used to keep track of the newest + // offset processed if a message is re-validated and re-ordered. + // This value is used to deduplicate re-submitted messages from + // multiple orderer so that we don't bother re-processing it again. + LastOriginalOffsetProcessed int64 `protobuf:"varint,2,opt,name=last_original_offset_processed,json=lastOriginalOffsetProcessed,proto3" json:"last_original_offset_processed,omitempty"` + // LastResubmittedConfigOffset is used to capture the newest offset of + // CONFIG kafka message, which is revalidated and resubmitted. By comparing + // this with LastOriginalOffsetProcessed, we could detemine whether there + // are still CONFIG messages that have been resubmitted but NOT processed + // yet. It's used as condition to block ingress messages, so we could reduce + // the overhead of repeatedly resubmitting messages as config seq keeps + // advancing. + LastResubmittedConfigOffset int64 `protobuf:"varint,3,opt,name=last_resubmitted_config_offset,json=lastResubmittedConfigOffset,proto3" json:"last_resubmitted_config_offset,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *KafkaMetadata) Reset() { *m = KafkaMetadata{} } +func (m *KafkaMetadata) String() string { return proto.CompactTextString(m) } +func (*KafkaMetadata) ProtoMessage() {} +func (*KafkaMetadata) Descriptor() ([]byte, []int) { + return fileDescriptor_kafka_d6fc97ca114dc767, []int{4} +} +func (m *KafkaMetadata) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_KafkaMetadata.Unmarshal(m, b) +} +func (m *KafkaMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_KafkaMetadata.Marshal(b, m, deterministic) +} +func (dst *KafkaMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_KafkaMetadata.Merge(dst, src) +} +func (m *KafkaMetadata) XXX_Size() int { + return xxx_messageInfo_KafkaMetadata.Size(m) +} +func (m *KafkaMetadata) XXX_DiscardUnknown() { + xxx_messageInfo_KafkaMetadata.DiscardUnknown(m) +} + +var xxx_messageInfo_KafkaMetadata proto.InternalMessageInfo + +func (m *KafkaMetadata) GetLastOffsetPersisted() int64 { + if m != nil { + return m.LastOffsetPersisted + } + return 0 +} + +func (m *KafkaMetadata) GetLastOriginalOffsetProcessed() int64 { + if m != nil { + return m.LastOriginalOffsetProcessed + } + return 0 +} + +func (m *KafkaMetadata) GetLastResubmittedConfigOffset() int64 { + if m != nil { + return m.LastResubmittedConfigOffset + } + return 0 +} + +func init() { + proto.RegisterType((*KafkaMessage)(nil), "orderer.KafkaMessage") + proto.RegisterType((*KafkaMessageRegular)(nil), "orderer.KafkaMessageRegular") + proto.RegisterType((*KafkaMessageTimeToCut)(nil), "orderer.KafkaMessageTimeToCut") + proto.RegisterType((*KafkaMessageConnect)(nil), "orderer.KafkaMessageConnect") + proto.RegisterType((*KafkaMetadata)(nil), "orderer.KafkaMetadata") + proto.RegisterEnum("orderer.KafkaMessageRegular_Class", KafkaMessageRegular_Class_name, KafkaMessageRegular_Class_value) +} + +func init() { proto.RegisterFile("orderer/kafka.proto", fileDescriptor_kafka_d6fc97ca114dc767) } + +var fileDescriptor_kafka_d6fc97ca114dc767 = []byte{ + // 476 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0xd1, 0x6a, 0xdb, 0x30, + 0x14, 0x86, 0xe3, 0x26, 0x4d, 0xe8, 0x49, 0xd6, 0x05, 0x85, 0x42, 0x60, 0x5b, 0xe9, 0x0c, 0x63, + 0xbd, 0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, 0x18, + 0x07, 0xed, 0xe2, 0xda, 0x74, 0xfb, 0x0f, 0x8f, 0xd0, 0x07, 0xc8, 0xd3, 0x8c, 0x79, 0xed, 0xe2, + 0x16, 0xde, 0x71, 0x91, 0x3a, 0x77, 0x9b, 0x0a, 0x45, 0x8e, 0x71, 0x8a, 0xc2, 0x49, 0x58, 0x28, + 0xb2, 0xc8, 0xfc, 0x16, 0xb2, 0xdb, 0xee, 0xaf, 0xb3, 0x34, 0x53, 0x77, 0x75, 0xe8, 0x44, 0xbc, + 0x70, 0x1f, 0xd1, 0xae, 0xa1, 0x5d, 0x43, 0xbb, 0x2d, 0x1d, 0x0e, 0xf5, 0xf9, 0xc3, 0xbf, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x41, 0xa5, 0x96, 0xb1, 0x6b, 0x03, 0x00, 0x00, +} diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/orderer/kafka.proto b/integration/vendor/github.com/hyperledger/fabric/protos/orderer/kafka.proto new file mode 100644 index 00000000..462d157e --- /dev/null +++ b/integration/vendor/github.com/hyperledger/fabric/protos/orderer/kafka.proto @@ -0,0 +1,83 @@ +/* +Copyright IBM Corp. 2016 All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +syntax = "proto3"; + +option go_package = "github.com/hyperledger/fabric/protos/orderer"; +option java_package = "org.hyperledger.fabric.protos.orderer"; + +package orderer; + +// KafkaMessage is a wrapper type for the messages +// that the Kafka-based orderer deals with. +message KafkaMessage { + oneof Type { + KafkaMessageRegular regular = 1; + KafkaMessageTimeToCut time_to_cut = 2; + KafkaMessageConnect connect = 3; + } +} + +// KafkaMessageRegular wraps a marshalled envelope. +message KafkaMessageRegular { + enum Class { + UNKNOWN = 0; + NORMAL = 1; + CONFIG = 2; + } + bytes payload = 1; + uint64 config_seq = 2; + Class class = 3; + int64 original_offset = 4; +} + +// KafkaMessageTimeToCut is used to signal to the orderers +// that it is time to cut block . +message KafkaMessageTimeToCut { + uint64 block_number = 1; +} + +// KafkaMessageConnect is posted by an orderer upon booting up. +// It is used to prevent the panic that would be caused if we +// were to consume an empty partition. It is ignored by all +// orderers when processing the partition. +message KafkaMessageConnect { + bytes payload = 1; +} + +// KafkaMetadata is encoded into the ORDERER block to keep track of +// Kafka-related metadata associated with this block. +message KafkaMetadata { + // LastOffsetPersisted is the encoded value for the Metadata message + // which is encoded in the ORDERER block metadata index for the case + // of the Kafka-based orderer. + int64 last_offset_persisted = 1; + + // LastOriginalOffsetProcessed is used to keep track of the newest + // offset processed if a message is re-validated and re-ordered. + // This value is used to deduplicate re-submitted messages from + // multiple orderer so that we don't bother re-processing it again. + int64 last_original_offset_processed = 2; + + // LastResubmittedConfigOffset is used to capture the newest offset of + // CONFIG kafka message, which is revalidated and resubmitted. By comparing + // this with LastOriginalOffsetProcessed, we could detemine whether there + // are still CONFIG messages that have been resubmitted but NOT processed + // yet. It's used as condition to block ingress messages, so we could reduce + // the overhead of repeatedly resubmitting messages as config seq keeps + // advancing. + int64 last_resubmitted_config_offset = 3; +} diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/peer/chaincode_shim.pb.go b/integration/vendor/github.com/hyperledger/fabric/protos/peer/chaincode_shim.pb.go index e708d1e7..d6b416d2 100644 --- a/integration/vendor/github.com/hyperledger/fabric/protos/peer/chaincode_shim.pb.go +++ b/integration/vendor/github.com/hyperledger/fabric/protos/peer/chaincode_shim.pb.go @@ -27,27 +27,28 @@ const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type ChaincodeMessage_Type int32 const ( - ChaincodeMessage_UNDEFINED ChaincodeMessage_Type = 0 - ChaincodeMessage_REGISTER ChaincodeMessage_Type = 1 - ChaincodeMessage_REGISTERED ChaincodeMessage_Type = 2 - ChaincodeMessage_INIT ChaincodeMessage_Type = 3 - ChaincodeMessage_READY ChaincodeMessage_Type = 4 - ChaincodeMessage_TRANSACTION ChaincodeMessage_Type = 5 - ChaincodeMessage_COMPLETED ChaincodeMessage_Type = 6 - ChaincodeMessage_ERROR ChaincodeMessage_Type = 7 - ChaincodeMessage_GET_STATE ChaincodeMessage_Type = 8 - ChaincodeMessage_PUT_STATE ChaincodeMessage_Type = 9 - ChaincodeMessage_DEL_STATE ChaincodeMessage_Type = 10 - ChaincodeMessage_INVOKE_CHAINCODE ChaincodeMessage_Type = 11 - ChaincodeMessage_RESPONSE ChaincodeMessage_Type = 13 - ChaincodeMessage_GET_STATE_BY_RANGE ChaincodeMessage_Type = 14 - ChaincodeMessage_GET_QUERY_RESULT ChaincodeMessage_Type = 15 - ChaincodeMessage_QUERY_STATE_NEXT ChaincodeMessage_Type = 16 - ChaincodeMessage_QUERY_STATE_CLOSE ChaincodeMessage_Type = 17 - ChaincodeMessage_KEEPALIVE ChaincodeMessage_Type = 18 - ChaincodeMessage_GET_HISTORY_FOR_KEY ChaincodeMessage_Type = 19 - ChaincodeMessage_GET_STATE_METADATA ChaincodeMessage_Type = 20 - ChaincodeMessage_PUT_STATE_METADATA ChaincodeMessage_Type = 21 + ChaincodeMessage_UNDEFINED ChaincodeMessage_Type = 0 + ChaincodeMessage_REGISTER ChaincodeMessage_Type = 1 + ChaincodeMessage_REGISTERED ChaincodeMessage_Type = 2 + ChaincodeMessage_INIT ChaincodeMessage_Type = 3 + ChaincodeMessage_READY ChaincodeMessage_Type = 4 + ChaincodeMessage_TRANSACTION ChaincodeMessage_Type = 5 + ChaincodeMessage_COMPLETED ChaincodeMessage_Type = 6 + ChaincodeMessage_ERROR ChaincodeMessage_Type = 7 + ChaincodeMessage_GET_STATE ChaincodeMessage_Type = 8 + ChaincodeMessage_PUT_STATE ChaincodeMessage_Type = 9 + ChaincodeMessage_DEL_STATE ChaincodeMessage_Type = 10 + ChaincodeMessage_INVOKE_CHAINCODE ChaincodeMessage_Type = 11 + ChaincodeMessage_RESPONSE ChaincodeMessage_Type = 13 + ChaincodeMessage_GET_STATE_BY_RANGE ChaincodeMessage_Type = 14 + ChaincodeMessage_GET_QUERY_RESULT ChaincodeMessage_Type = 15 + ChaincodeMessage_QUERY_STATE_NEXT ChaincodeMessage_Type = 16 + ChaincodeMessage_QUERY_STATE_CLOSE ChaincodeMessage_Type = 17 + ChaincodeMessage_KEEPALIVE ChaincodeMessage_Type = 18 + ChaincodeMessage_GET_HISTORY_FOR_KEY ChaincodeMessage_Type = 19 + ChaincodeMessage_GET_STATE_METADATA ChaincodeMessage_Type = 20 + ChaincodeMessage_PUT_STATE_METADATA ChaincodeMessage_Type = 21 + ChaincodeMessage_GET_PRIVATE_DATA_HASH ChaincodeMessage_Type = 22 ) var ChaincodeMessage_Type_name = map[int32]string{ @@ -72,36 +73,38 @@ var ChaincodeMessage_Type_name = map[int32]string{ 19: "GET_HISTORY_FOR_KEY", 20: "GET_STATE_METADATA", 21: "PUT_STATE_METADATA", + 22: "GET_PRIVATE_DATA_HASH", } var ChaincodeMessage_Type_value = map[string]int32{ - "UNDEFINED": 0, - "REGISTER": 1, - "REGISTERED": 2, - "INIT": 3, - "READY": 4, - "TRANSACTION": 5, - "COMPLETED": 6, - "ERROR": 7, - "GET_STATE": 8, - "PUT_STATE": 9, - "DEL_STATE": 10, - "INVOKE_CHAINCODE": 11, - "RESPONSE": 13, - "GET_STATE_BY_RANGE": 14, - "GET_QUERY_RESULT": 15, - "QUERY_STATE_NEXT": 16, - "QUERY_STATE_CLOSE": 17, - "KEEPALIVE": 18, - "GET_HISTORY_FOR_KEY": 19, - "GET_STATE_METADATA": 20, - "PUT_STATE_METADATA": 21, + "UNDEFINED": 0, + "REGISTER": 1, + "REGISTERED": 2, + "INIT": 3, + "READY": 4, + "TRANSACTION": 5, + "COMPLETED": 6, + "ERROR": 7, + "GET_STATE": 8, + "PUT_STATE": 9, + "DEL_STATE": 10, + "INVOKE_CHAINCODE": 11, + "RESPONSE": 13, + "GET_STATE_BY_RANGE": 14, + "GET_QUERY_RESULT": 15, + "QUERY_STATE_NEXT": 16, + "QUERY_STATE_CLOSE": 17, + "KEEPALIVE": 18, + "GET_HISTORY_FOR_KEY": 19, + "GET_STATE_METADATA": 20, + "PUT_STATE_METADATA": 21, + "GET_PRIVATE_DATA_HASH": 22, } func (x ChaincodeMessage_Type) String() string { return proto.EnumName(ChaincodeMessage_Type_name, int32(x)) } func (ChaincodeMessage_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_chaincode_shim_3c6cdf1ba834f673, []int{0, 0} + return fileDescriptor_chaincode_shim_b04d3028f86b65a2, []int{0, 0} } type ChaincodeMessage struct { @@ -125,7 +128,7 @@ func (m *ChaincodeMessage) Reset() { *m = ChaincodeMessage{} } func (m *ChaincodeMessage) String() string { return proto.CompactTextString(m) } func (*ChaincodeMessage) ProtoMessage() {} func (*ChaincodeMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_chaincode_shim_3c6cdf1ba834f673, []int{0} + return fileDescriptor_chaincode_shim_b04d3028f86b65a2, []int{0} } func (m *ChaincodeMessage) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ChaincodeMessage.Unmarshal(m, b) @@ -209,7 +212,7 @@ func (m *GetState) Reset() { *m = GetState{} } func (m *GetState) String() string { return proto.CompactTextString(m) } func (*GetState) ProtoMessage() {} func (*GetState) Descriptor() ([]byte, []int) { - return fileDescriptor_chaincode_shim_3c6cdf1ba834f673, []int{1} + return fileDescriptor_chaincode_shim_b04d3028f86b65a2, []int{1} } func (m *GetState) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetState.Unmarshal(m, b) @@ -255,7 +258,7 @@ func (m *GetStateMetadata) Reset() { *m = GetStateMetadata{} } func (m *GetStateMetadata) String() string { return proto.CompactTextString(m) } func (*GetStateMetadata) ProtoMessage() {} func (*GetStateMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_chaincode_shim_3c6cdf1ba834f673, []int{2} + return fileDescriptor_chaincode_shim_b04d3028f86b65a2, []int{2} } func (m *GetStateMetadata) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetStateMetadata.Unmarshal(m, b) @@ -306,7 +309,7 @@ func (m *PutState) Reset() { *m = PutState{} } func (m *PutState) String() string { return proto.CompactTextString(m) } func (*PutState) ProtoMessage() {} func (*PutState) Descriptor() ([]byte, []int) { - return fileDescriptor_chaincode_shim_3c6cdf1ba834f673, []int{3} + return fileDescriptor_chaincode_shim_b04d3028f86b65a2, []int{3} } func (m *PutState) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PutState.Unmarshal(m, b) @@ -360,7 +363,7 @@ func (m *PutStateMetadata) Reset() { *m = PutStateMetadata{} } func (m *PutStateMetadata) String() string { return proto.CompactTextString(m) } func (*PutStateMetadata) ProtoMessage() {} func (*PutStateMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_chaincode_shim_3c6cdf1ba834f673, []int{4} + return fileDescriptor_chaincode_shim_b04d3028f86b65a2, []int{4} } func (m *PutStateMetadata) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PutStateMetadata.Unmarshal(m, b) @@ -417,7 +420,7 @@ func (m *DelState) Reset() { *m = DelState{} } func (m *DelState) String() string { return proto.CompactTextString(m) } func (*DelState) ProtoMessage() {} func (*DelState) Descriptor() ([]byte, []int) { - return fileDescriptor_chaincode_shim_3c6cdf1ba834f673, []int{5} + return fileDescriptor_chaincode_shim_b04d3028f86b65a2, []int{5} } func (m *DelState) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DelState.Unmarshal(m, b) @@ -469,7 +472,7 @@ func (m *GetStateByRange) Reset() { *m = GetStateByRange{} } func (m *GetStateByRange) String() string { return proto.CompactTextString(m) } func (*GetStateByRange) ProtoMessage() {} func (*GetStateByRange) Descriptor() ([]byte, []int) { - return fileDescriptor_chaincode_shim_3c6cdf1ba834f673, []int{6} + return fileDescriptor_chaincode_shim_b04d3028f86b65a2, []int{6} } func (m *GetStateByRange) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetStateByRange.Unmarshal(m, b) @@ -534,7 +537,7 @@ func (m *GetQueryResult) Reset() { *m = GetQueryResult{} } func (m *GetQueryResult) String() string { return proto.CompactTextString(m) } func (*GetQueryResult) ProtoMessage() {} func (*GetQueryResult) Descriptor() ([]byte, []int) { - return fileDescriptor_chaincode_shim_3c6cdf1ba834f673, []int{7} + return fileDescriptor_chaincode_shim_b04d3028f86b65a2, []int{7} } func (m *GetQueryResult) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetQueryResult.Unmarshal(m, b) @@ -590,7 +593,7 @@ func (m *QueryMetadata) Reset() { *m = QueryMetadata{} } func (m *QueryMetadata) String() string { return proto.CompactTextString(m) } func (*QueryMetadata) ProtoMessage() {} func (*QueryMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_chaincode_shim_3c6cdf1ba834f673, []int{8} + return fileDescriptor_chaincode_shim_b04d3028f86b65a2, []int{8} } func (m *QueryMetadata) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_QueryMetadata.Unmarshal(m, b) @@ -637,7 +640,7 @@ func (m *GetHistoryForKey) Reset() { *m = GetHistoryForKey{} } func (m *GetHistoryForKey) String() string { return proto.CompactTextString(m) } func (*GetHistoryForKey) ProtoMessage() {} func (*GetHistoryForKey) Descriptor() ([]byte, []int) { - return fileDescriptor_chaincode_shim_3c6cdf1ba834f673, []int{9} + return fileDescriptor_chaincode_shim_b04d3028f86b65a2, []int{9} } func (m *GetHistoryForKey) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetHistoryForKey.Unmarshal(m, b) @@ -675,7 +678,7 @@ func (m *QueryStateNext) Reset() { *m = QueryStateNext{} } func (m *QueryStateNext) String() string { return proto.CompactTextString(m) } func (*QueryStateNext) ProtoMessage() {} func (*QueryStateNext) Descriptor() ([]byte, []int) { - return fileDescriptor_chaincode_shim_3c6cdf1ba834f673, []int{10} + return fileDescriptor_chaincode_shim_b04d3028f86b65a2, []int{10} } func (m *QueryStateNext) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_QueryStateNext.Unmarshal(m, b) @@ -713,7 +716,7 @@ func (m *QueryStateClose) Reset() { *m = QueryStateClose{} } func (m *QueryStateClose) String() string { return proto.CompactTextString(m) } func (*QueryStateClose) ProtoMessage() {} func (*QueryStateClose) Descriptor() ([]byte, []int) { - return fileDescriptor_chaincode_shim_3c6cdf1ba834f673, []int{11} + return fileDescriptor_chaincode_shim_b04d3028f86b65a2, []int{11} } func (m *QueryStateClose) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_QueryStateClose.Unmarshal(m, b) @@ -752,7 +755,7 @@ func (m *QueryResultBytes) Reset() { *m = QueryResultBytes{} } func (m *QueryResultBytes) String() string { return proto.CompactTextString(m) } func (*QueryResultBytes) ProtoMessage() {} func (*QueryResultBytes) Descriptor() ([]byte, []int) { - return fileDescriptor_chaincode_shim_3c6cdf1ba834f673, []int{12} + return fileDescriptor_chaincode_shim_b04d3028f86b65a2, []int{12} } func (m *QueryResultBytes) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_QueryResultBytes.Unmarshal(m, b) @@ -798,7 +801,7 @@ func (m *QueryResponse) Reset() { *m = QueryResponse{} } func (m *QueryResponse) String() string { return proto.CompactTextString(m) } func (*QueryResponse) ProtoMessage() {} func (*QueryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_chaincode_shim_3c6cdf1ba834f673, []int{13} + return fileDescriptor_chaincode_shim_b04d3028f86b65a2, []int{13} } func (m *QueryResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_QueryResponse.Unmarshal(m, b) @@ -860,7 +863,7 @@ func (m *QueryResponseMetadata) Reset() { *m = QueryResponseMetadata{} } func (m *QueryResponseMetadata) String() string { return proto.CompactTextString(m) } func (*QueryResponseMetadata) ProtoMessage() {} func (*QueryResponseMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_chaincode_shim_3c6cdf1ba834f673, []int{14} + return fileDescriptor_chaincode_shim_b04d3028f86b65a2, []int{14} } func (m *QueryResponseMetadata) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_QueryResponseMetadata.Unmarshal(m, b) @@ -906,7 +909,7 @@ func (m *StateMetadata) Reset() { *m = StateMetadata{} } func (m *StateMetadata) String() string { return proto.CompactTextString(m) } func (*StateMetadata) ProtoMessage() {} func (*StateMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_chaincode_shim_3c6cdf1ba834f673, []int{15} + return fileDescriptor_chaincode_shim_b04d3028f86b65a2, []int{15} } func (m *StateMetadata) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_StateMetadata.Unmarshal(m, b) @@ -951,7 +954,7 @@ func (m *StateMetadataResult) Reset() { *m = StateMetadataResult{} } func (m *StateMetadataResult) String() string { return proto.CompactTextString(m) } func (*StateMetadataResult) ProtoMessage() {} func (*StateMetadataResult) Descriptor() ([]byte, []int) { - return fileDescriptor_chaincode_shim_3c6cdf1ba834f673, []int{16} + return fileDescriptor_chaincode_shim_b04d3028f86b65a2, []int{16} } func (m *StateMetadataResult) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_StateMetadataResult.Unmarshal(m, b) @@ -1104,73 +1107,74 @@ var _ChaincodeSupport_serviceDesc = grpc.ServiceDesc{ } func init() { - proto.RegisterFile("peer/chaincode_shim.proto", fileDescriptor_chaincode_shim_3c6cdf1ba834f673) + proto.RegisterFile("peer/chaincode_shim.proto", fileDescriptor_chaincode_shim_b04d3028f86b65a2) } -var fileDescriptor_chaincode_shim_3c6cdf1ba834f673 = []byte{ - // 1010 bytes of a gzipped FileDescriptorProto +var fileDescriptor_chaincode_shim_b04d3028f86b65a2 = []byte{ + // 1027 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcf, 0x73, 0xda, 0x46, - 0x14, 0x0e, 0x06, 0x8c, 0x78,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 0x86, 0xe4, 0x7c, 0x3c, 0x21, 0x43, 0xf4, 0x02, 0x1f, 0x80, 0x42, 0xc9, 0x68, 0xac, 0x6a, 0x84, + 0xa2, 0x1c, 0xae, 0x02, 0xa4, 0x88, 0x0c, 0xd1, 0x1e, 0x56, 0xa0, 0x30, 0x9e, 0x8c, 0x35, 0x94, + 0xc7, 0x65, 0x28, 0x52, 0xd2, 0x1f, 0xde, 0xa1, 0x02, 0x3e, 0x82, 0x8a, 0x46, 0xfb, 0x13, 0xb5, + 0x3f, 0xd0, 0xc6, 0xd3, 0x09, 0x2a, 0x4a, 0xc9, 0xc1, 0xf4, 0x7a, 0x76, 0x45, 0x34, 0x32, 0x44, + 0xfb, 0x92, 0x4a, 0x28, 0x9d, 0x52, 0x54, 0x92, 0x9e, 0x11, 0xd1, 0x74, 0x55, 0xeb, 0x6b, 0x04, + 0x29, 0x12, 0xce, 0x6e, 0x52, 0x58, 0x96, 0x70, 0x48, 0xae, 0x12, 0x08, 0xf8, 0x15, 0xa0, 0xf1, + 0xe4, 0x76, 0x7a, 0x49, 0xf4, 0xc1, 0x45, 0x7f, 0x3c, 0x19, 0x4c, 0x87, 0x04, 0x55, 0xe2, 0x04, + 0xd5, 0xd9, 0x74, 0xa2, 0x12, 0x74, 0x88, 0x4f, 0x00, 0x67, 0x82, 0xfa, 0xd9, 0x9d, 0x4e, 0xfb, + 0x93, 0x11, 0x41, 0x55, 0x79, 0x56, 0xda, 0xdf, 0xdd, 0x10, 0x7a, 0xa7, 0x53, 0xa2, 0xde, 0x5c, + 0x69, 0xe8, 0x48, 0x5a, 0x63, 0x4b, 0xcc, 0x9f, 0x90, 0xf7, 0x1a, 0x42, 0xb8, 0x06, 0x2f, 0x37, + 0xad, 0x83, 0xab, 0xa9, 0x4a, 0xd0, 0x4b, 0x99, 0xcd, 0x25, 0x21, 0xb3, 0xfe, 0xd5, 0xf8, 0x96, + 0x20, 0x8c, 0xbf, 0x82, 0x63, 0xa9, 0x78, 0x31, 0x56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2d, + 0xac, 0xb1, 0x53, 0xd8, 0xc1, 0x46, 0x05, 0x73, 0xa8, 0x8e, 0x98, 0x78, 0xb7, 0x62, 0xc1, 0x9a, + 0xb2, 0x70, 0xe5, 0x0a, 0x39, 0x82, 0xdf, 0x24, 0x4c, 0xc2, 0xc7, 0xe0, 0x73, 0xb5, 0x6c, 0xc5, + 0xc8, 0xef, 0xc4, 0x18, 0xc1, 0x61, 0x14, 0x20, 0x9b, 0x4d, 0x03, 0x14, 0xdf, 0xb0, 0x99, 0xea, + 0xfc, 0x11, 0xff, 0x9f, 0x16, 0x69, 0x86, 0xa5, 0x6f, 0xce, 0xf9, 0xc3, 0xd2, 0x08, 0x1e, 0x92, + 0x30, 0x19, 0x6e, 0x7d, 0x17, 0xdd, 0xc0, 0x0b, 0x27, 0x14, 0x3c, 0x58, 0x9f, 0xf3, 0x40, 0x16, + 0xff, 0xa4, 0xed, 0xad, 0x26, 0x54, 0xa3, 0x70, 0x51, 0x5f, 0x27, 0xec, 0xa3, 0xc0, 0x55, 0xd8, + 0x73, 0xac, 0x84, 0xb2, 0xe7, 0x58, 0xad, 0x6f, 0xe1, 0xe8, 0x91, 0x31, 0x70, 0x79, 0xc8, 0x9e, + 0x50, 0x7e, 0x02, 0xb4, 0xd1, 0x94, 0xb3, 0xb5, 0x60, 0x21, 0x6e, 0x42, 0x25, 0x78, 0x84, 0x11, + 0xf9, 0x80, 0x6e, 0x9a, 0x5a, 0x7f, 0xe5, 0x92, 0x52, 0x29, 0x0b, 0x7d, 0xee, 0x85, 0x0c, 0xf7, + 0xa0, 0x14, 0x13, 0x24, 0x3f, 0xdf, 0xae, 0xf4, 0xea, 0xe9, 0x9d, 0xda, 0x95, 0xa7, 0x29, 0x11, + 0x9f, 0x82, 0xb2, 0x30, 0x42, 0x7d, 0xc9, 0x83, 0x78, 0x0f, 0x14, 0x5a, 0x5a, 0x18, 0xe1, 0x35, + 0x0f, 0xd2, 0x34, 0xf3, 0x69, 0x9a, 0x9f, 0x1c, 0xad, 0x0d, 0xb5, 0xad, 0x5c, 0xb2, 0xf6, 0xf7, + 0xa0, 0x76, 0xcf, 0x84, 0xb9, 0x60, 0x96, 0x1e, 0x30, 0x93, 0x07, 0x56, 0xa8, 0x9b, 0x7c, 0xe5, + 0x89, 0x64, 0x16, 0xc7, 0x89, 0x93, 0xc6, 0xbe, 0x81, 0x74, 0x7d, 0x72, 0x2c, 0x6f, 0xe1, 0x70, + 0x7b, 0xf7, 0xea, 0x50, 0x92, 0x59, 0x3c, 0xce, 0x25, 0x85, 0xff, 0xbd, 0xdf, 0xad, 0x73, 0x38, + 0xde, 0xde, 0xb0, 0xf8, 0x26, 0x76, 0xa1, 0xc4, 0x3c, 0x11, 0x38, 0x2c, 0xed, 0xdd, 0x33, 0xfb, + 0x98, 0xb2, 0x7a, 0xef, 0x37, 0xde, 0xdb, 0xea, 0xca, 0xf7, 0x79, 0x20, 0xf0, 0x10, 0x14, 0xca, + 0x6c, 0x27, 0x14, 0x2c, 0xc0, 0xf5, 0xe7, 0xde, 0xda, 0x8d, 0x67, 0x3d, 0xad, 0x17, 0xed, 0xdc, + 0x0f, 0xb9, 0xb3, 0x29, 0xb4, 0x78, 0x60, 0x77, 0x16, 0x6b, 0x9f, 0x05, 0x2e, 0xb3, 0x6c, 0x16, + 0x74, 0xee, 0x8d, 0x79, 0xe0, 0x98, 0xe9, 0x39, 0xf9, 0xa1, 0xf1, 0xeb, 0xf7, 0xb6, 0x23, 0x16, + 0xab, 0x79, 0xc7, 0xe4, 0xcb, 0xee, 0x06, 0xb5, 0x1b, 0x53, 0xe3, 0x0f, 0x8e, 0xb0, 0x2b, 0xa9, + 0xf3, 0xf8, 0xeb, 0xe5, 0xc7, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x3e, 0x82, 0x3d, 0x52, 0xe1, + 0x08, 0x00, 0x00, } diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/peer/chaincode_shim.proto b/integration/vendor/github.com/hyperledger/fabric/protos/peer/chaincode_shim.proto index 85a0e0c1..e49e573f 100644 --- a/integration/vendor/github.com/hyperledger/fabric/protos/peer/chaincode_shim.proto +++ b/integration/vendor/github.com/hyperledger/fabric/protos/peer/chaincode_shim.proto @@ -38,6 +38,7 @@ message ChaincodeMessage { GET_HISTORY_FOR_KEY = 19; GET_STATE_METADATA = 20; PUT_STATE_METADATA = 21; + GET_PRIVATE_DATA_HASH = 22; } Type type = 1; diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/token/transaction.proto b/integration/vendor/github.com/hyperledger/fabric/protos/token/transaction.proto index c5aa4e91..2c47324b 100644 --- a/integration/vendor/github.com/hyperledger/fabric/protos/token/transaction.proto +++ b/integration/vendor/github.com/hyperledger/fabric/protos/token/transaction.proto @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; option go_package = "github.com/hyperledger/fabric/protos/token"; - +option java_package = "org.hyperledger.fabric.protos.token"; // ================ Existing Fabric Transaction structure =============== // diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/utils/blockutils.go b/integration/vendor/github.com/hyperledger/fabric/protos/utils/blockutils.go index 9e028b8b..88521b62 100644 --- a/integration/vendor/github.com/hyperledger/fabric/protos/utils/blockutils.go +++ b/integration/vendor/github.com/hyperledger/fabric/protos/utils/blockutils.go @@ -115,9 +115,9 @@ func CopyBlockMetadata(src *cb.Block, dst *cb.Block) { // InitBlockMetadata copies metadata from one block into another func InitBlockMetadata(block *cb.Block) { if block.Metadata == nil { - block.Metadata = &cb.BlockMetadata{Metadata: [][]byte{{}, {}, {}}} - } else if len(block.Metadata.Metadata) < int(cb.BlockMetadataIndex_TRANSACTIONS_FILTER+1) { - for i := int(len(block.Metadata.Metadata)); i <= int(cb.BlockMetadataIndex_TRANSACTIONS_FILTER); i++ { + block.Metadata = &cb.BlockMetadata{Metadata: [][]byte{{}, {}, {}, {}, {}}} + } else if len(block.Metadata.Metadata) < int(cb.BlockMetadataIndex_COMMIT_HASH+1) { + for i := int(len(block.Metadata.Metadata)); i <= int(cb.BlockMetadataIndex_COMMIT_HASH); i++ { block.Metadata.Metadata = append(block.Metadata.Metadata, []byte{}) } } diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/utils/commonutils.go b/integration/vendor/github.com/hyperledger/fabric/protos/utils/commonutils.go index b1ac84b3..65838ee6 100644 --- a/integration/vendor/github.com/hyperledger/fabric/protos/utils/commonutils.go +++ b/integration/vendor/github.com/hyperledger/fabric/protos/utils/commonutils.go @@ -13,6 +13,7 @@ import ( "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes/timestamp" "github.com/hyperledger/fabric/common/crypto" + "github.com/hyperledger/fabric/protos/common" cb "github.com/hyperledger/fabric/protos/common" pb "github.com/hyperledger/fabric/protos/peer" "github.com/pkg/errors" @@ -225,6 +226,7 @@ func NewSignatureHeaderOrPanic(signer crypto.LocalSigner) *cb.SignatureHeader { if err != nil { panic(fmt.Errorf("failed generating a new SignatureHeader: %s", err)) } + return signatureHeader } @@ -269,6 +271,24 @@ func UnmarshalChaincodeID(bytes []byte) (*pb.ChaincodeID, error) { return ccid, nil } +// UnmarshalSignatureHeader unmarshals bytes to a SignatureHeader. +func UnmarshalSignatureHeader(bytes []byte) (*cb.SignatureHeader, error) { + sh := &common.SignatureHeader{} + if err := proto.Unmarshal(bytes, sh); err != nil { + return nil, errors.Wrap(err, "error unmarshaling SignatureHeader") + } + return sh, nil +} + +// UnmarshalSignatureHeaderOrPanic unmarshals bytes to a SignatureHeader. +func UnmarshalSignatureHeaderOrPanic(bytes []byte) *cb.SignatureHeader { + sighdr, err := UnmarshalSignatureHeader(bytes) + if err != nil { + panic(err) + } + return sighdr +} + // IsConfigBlock validates whenever given block contains configuration // update transaction func IsConfigBlock(block *cb.Block) bool { diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/utils/proputils.go b/integration/vendor/github.com/hyperledger/fabric/protos/utils/proputils.go index adca246d..af46f209 100644 --- a/integration/vendor/github.com/hyperledger/fabric/protos/utils/proputils.go +++ b/integration/vendor/github.com/hyperledger/fabric/protos/utils/proputils.go @@ -227,9 +227,7 @@ func GetChaincodeProposalPayload(bytes []byte) (*peer.ChaincodeProposalPayload, // GetSignatureHeader Get SignatureHeader from bytes func GetSignatureHeader(bytes []byte) (*common.SignatureHeader, error) { - sh := &common.SignatureHeader{} - err := proto.Unmarshal(bytes, sh) - return sh, errors.Wrap(err, "error unmarshaling SignatureHeader") + return UnmarshalSignatureHeader(bytes) } // CreateChaincodeProposal creates a proposal from given input. diff --git a/integration/vendor/github.com/hyperledger/fabric/protos/utils/txutils.go b/integration/vendor/github.com/hyperledger/fabric/protos/utils/txutils.go index e222b562..8d603dca 100644 --- a/integration/vendor/github.com/hyperledger/fabric/protos/utils/txutils.go +++ b/integration/vendor/github.com/hyperledger/fabric/protos/utils/txutils.go @@ -451,3 +451,38 @@ func GetProposalHash1(header *common.Header, ccPropPayl []byte, visibility []byt hash2.Write(ppBytes) return hash2.Sum(nil), nil } + +// GetOrComputeTxIDFromEnvelope gets the txID present in a given transaction +// envelope. If the txID is empty, it constructs the txID from nonce and +// creator fields in the envelope. +func GetOrComputeTxIDFromEnvelope(txEnvelopBytes []byte) (string, error) { + txEnvelope, err := UnmarshalEnvelope(txEnvelopBytes) + if err != nil { + return "", errors.WithMessage(err, "error getting txID from envelope") + } + + txPayload, err := UnmarshalPayload(txEnvelope.Payload) + if err != nil { + return "", errors.WithMessage(err, "error getting txID from payload") + } + + if txPayload.Header == nil { + return "", errors.New("error getting txID from header: payload header is nil") + } + + chdr, err := UnmarshalChannelHeader(txPayload.Header.ChannelHeader) + if err != nil { + return "", errors.WithMessage(err, "error getting txID from channel header") + } + + if chdr.TxId != "" { + return chdr.TxId, nil + } + + sighdr, err := UnmarshalSignatureHeader(txPayload.Header.SignatureHeader) + if err != nil { + return "", errors.WithMessage(err, "error getting nonce and creator for computing txID") + } + + return ComputeTxID(sighdr.Nonce, sighdr.Creator) +} diff --git a/integration/vendor/github.com/sykesm/zap-logfmt/.gitignore b/integration/vendor/github.com/sykesm/zap-logfmt/.gitignore new file mode 100644 index 00000000..7a6353d6 --- /dev/null +++ b/integration/vendor/github.com/sykesm/zap-logfmt/.gitignore @@ -0,0 +1 @@ +.envrc diff --git a/integration/vendor/github.com/sykesm/zap-logfmt/.travis.yml b/integration/vendor/github.com/sykesm/zap-logfmt/.travis.yml new file mode 100644 index 00000000..0c6417db --- /dev/null +++ b/integration/vendor/github.com/sykesm/zap-logfmt/.travis.yml @@ -0,0 +1,10 @@ +language: go + +matrix: + include: + - go: "1.10.x" + - go: "1.11.x" + install: true + env: GO111MODULE=on + +script: go test -race ./... diff --git a/integration/vendor/github.com/sykesm/zap-logfmt/LICENSE b/integration/vendor/github.com/sykesm/zap-logfmt/LICENSE new file mode 100644 index 00000000..43a1c326 --- /dev/null +++ b/integration/vendor/github.com/sykesm/zap-logfmt/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017 Jonathan Sternberg +Copyright (c) 2019 Matthew Sykes + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/integration/vendor/github.com/sykesm/zap-logfmt/README.md b/integration/vendor/github.com/sykesm/zap-logfmt/README.md new file mode 100644 index 00000000..751f2880 --- /dev/null +++ b/integration/vendor/github.com/sykesm/zap-logfmt/README.md @@ -0,0 +1,76 @@ +# Logfmt Encoder + +This package provides a logfmt encoder for [zap][zap]. + +It is a fork of [github.com/jsternberg/zap-logfmt][jsternberg] that improves +the handling of reflected fields and encodes arrays and objects instead of +dropping them from logs. While logging simple fields is preferred for many +reasons, having ugly data is often better than missing data. + +[![Build Status](https://travis-ci.org/sykesm/zap-logfmt.svg?branch=master)](https://travis-ci.org/sykesm/zap-logfmt) +[![GoDoc](https://godoc.org/github.com/sykesm/zap-logfmt?status.svg)](https://godoc.org/github.com/sykesm/zap-logfmt) + +## Usage + +The encoder is easy to configure. Simply create a new core with an instance of +the logfmt encoder and use it with your preferred logging interface. + +```go +package main + +import ( + "os" + + "github.com/sykesm/zap-logfmt" + "go.uber.org/zap" + "go.uber.org/zap/zapcore" +) + +func main() { + config := zap.NewProductionEncoderConfig() + logger := zap.New(zapcore.NewCore( + zaplogfmt.NewEncoder(config), + os.Stdout, + zapcore.DebugLevel, + )) + logger.Info("Hello World") +} +``` + +## Arrays, Objects, and Reflected Fields + +While it's best to avoid complex data types in log fields, there are times +when they sneak in. When complex fields are included in log records, they will +be encoded, but they won't be very pretty. + +### Arrays + +Arrays are encoded as a comma separated list of values within square brackets. +This format is very similar to JSON encoding. Arrays of simple scalars remain +quite readable but including elements that require quoting will result in very +ugly records. + +### Objects + +Objects are encoded as a space separated list of _key=value_ pairs. Because +this format includes an equals sign, the encoded object will require quoting. +If any value in the object requires quoting, the required escapes will make +the encoded field pretty difficult for humans to read. + +### Channels and Functions + +Channels and functions are encoded as their type and their address. There +aren't many meaningful ways to log channels and functions... + +### Maps and Structs + +Maps and structs are encoded as strings that contain the result of `fmt.Sprint`. + +## Namespaces + +Namespaces are supported. If a namespace is opened, all of the keys will +be prepended with the namespace name. For example, with the namespace +`foo` and the key `bar`, you would get a key of `foo.bar`. + +[zap]: https://github.com/uber-go/zap +[jsternberg]: https://github.com/jsternberg/zap-logfmt diff --git a/integration/vendor/github.com/sykesm/zap-logfmt/encoder.go b/integration/vendor/github.com/sykesm/zap-logfmt/encoder.go new file mode 100644 index 00000000..330554fc --- /dev/null +++ b/integration/vendor/github.com/sykesm/zap-logfmt/encoder.go @@ -0,0 +1,520 @@ +// Package zaplogfmt provides a zap encoder that formats log entries in +// "logfmt" format. +package zaplogfmt + +import ( + "bytes" + "encoding" + "encoding/base64" + "fmt" + "math" + "reflect" + "strings" + "sync" + "time" + "unicode/utf8" + + "go.uber.org/zap/buffer" + "go.uber.org/zap/zapcore" +) + +var ( + logfmtPool = sync.Pool{ + New: func() interface{} { return &logfmtEncoder{} }, + } + bufferpool = buffer.NewPool() +) + +func getEncoder() *logfmtEncoder { + return logfmtPool.Get().(*logfmtEncoder) +} + +func putEncoder(enc *logfmtEncoder) { + enc.EncoderConfig = nil + enc.buf = nil + enc.namespaces = nil + enc.arrayLiteral = false + logfmtPool.Put(enc) +} + +type logfmtEncoder struct { + *zapcore.EncoderConfig + buf *buffer.Buffer + namespaces []string + arrayLiteral bool +} + +// NewEncoder creates an encoder writes logfmt formatted log entries. +func NewEncoder(cfg zapcore.EncoderConfig) zapcore.Encoder { + return &logfmtEncoder{ + EncoderConfig: &cfg, + buf: bufferpool.Get(), + } +} + +func (enc *logfmtEncoder) AddArray(key string, arr zapcore.ArrayMarshaler) error { + enc.addKey(key) + return enc.AppendArray(arr) +} + +func (enc *logfmtEncoder) AddBinary(key string, value []byte) { + enc.AddString(key, base64.StdEncoding.EncodeToString(value)) +} + +func (enc *logfmtEncoder) AddBool(key string, value bool) { + enc.addKey(key) + enc.AppendBool(value) +} + +func (enc *logfmtEncoder) AddByteString(key string, value []byte) { + enc.addKey(key) + enc.AppendByteString(value) +} + +func (enc *logfmtEncoder) AddComplex64(k string, v complex64) { enc.AddComplex128(k, complex128(v)) } +func (enc *logfmtEncoder) AddComplex128(key string, value complex128) { + enc.addKey(key) + enc.AppendComplex128(value) +} + +func (enc *logfmtEncoder) AddDuration(key string, value time.Duration) { + enc.addKey(key) + enc.AppendDuration(value) +} + +func (enc *logfmtEncoder) AddFloat32(key string, value float32) { + enc.addKey(key) + enc.AppendFloat32(value) +} + +func (enc *logfmtEncoder) AddFloat64(key string, value float64) { + enc.addKey(key) + enc.AppendFloat64(value) +} + +func (enc *logfmtEncoder) AddInt(k string, v int) { enc.AddInt64(k, int64(v)) } +func (enc *logfmtEncoder) AddInt8(k string, v int8) { enc.AddInt64(k, int64(v)) } +func (enc *logfmtEncoder) AddInt32(k string, v int32) { enc.AddInt64(k, int64(v)) } +func (enc *logfmtEncoder) AddInt16(k string, v int16) { enc.AddInt64(k, int64(v)) } +func (enc *logfmtEncoder) AddInt64(key string, value int64) { + enc.addKey(key) + enc.AppendInt64(value) +} + +func (enc *logfmtEncoder) AddObject(key string, obj zapcore.ObjectMarshaler) error { + enc.addKey(key) + return enc.AppendObject(obj) +} + +func (enc *logfmtEncoder) AddReflected(key string, value interface{}) error { + enc.addKey(key) + return enc.AppendReflected(value) +} + +func (enc *logfmtEncoder) AddString(key, value string) { + enc.addKey(key) + enc.AppendString(value) +} + +func (enc *logfmtEncoder) AddTime(key string, value time.Time) { + enc.addKey(key) + enc.AppendTime(value) +} + +func (enc *logfmtEncoder) AddUint(k string, v uint) { enc.AddUint64(k, uint64(v)) } +func (enc *logfmtEncoder) AddUint8(k string, v uint8) { enc.AddUint64(k, uint64(v)) } +func (enc *logfmtEncoder) AddUint32(k string, v uint32) { enc.AddUint64(k, uint64(v)) } +func (enc *logfmtEncoder) AddUint16(k string, v uint16) { enc.AddUint64(k, uint64(v)) } +func (enc *logfmtEncoder) AddUintptr(k string, v uintptr) { enc.AddUint64(k, uint64(v)) } +func (enc *logfmtEncoder) AddUint64(key string, value uint64) { + enc.addKey(key) + enc.AppendUint64(value) +} + +func (enc *logfmtEncoder) AppendArray(arr zapcore.ArrayMarshaler) error { + marshaler := enc.clone() + marshaler.namespaces = nil + marshaler.arrayLiteral = true + + marshaler.buf.AppendByte('[') + err := arr.MarshalLogArray(marshaler) + if err == nil { + marshaler.buf.AppendByte(']') + enc.AppendByteString(marshaler.buf.Bytes()) + } else { + enc.AppendByteString(nil) + } + marshaler.buf.Free() + putEncoder(marshaler) + return err +} + +func (enc *logfmtEncoder) AppendBool(value bool) { + if value { + enc.AppendString("true") + } else { + enc.AppendString("false") + } +} + +func (enc *logfmtEncoder) AppendByteString(value []byte) { + enc.addSeparator() + + needsQuotes := bytes.IndexFunc(value, needsQuotedValueRune) != -1 + if needsQuotes { + enc.buf.AppendByte('"') + } + enc.safeAddByteString(value) + if needsQuotes { + enc.buf.AppendByte('"') + } +} + +func (enc *logfmtEncoder) AppendComplex64(v complex64) { enc.AppendComplex128(complex128(v)) } +func (enc *logfmtEncoder) AppendComplex128(value complex128) { + enc.addSeparator() + + // Cast to a platform-independent, fixed-size type. + r, i := float64(real(value)), float64(imag(value)) + enc.buf.AppendFloat(r, 64) + enc.buf.AppendByte('+') + enc.buf.AppendFloat(i, 64) + enc.buf.AppendByte('i') +} + +func (enc *logfmtEncoder) AppendDuration(value time.Duration) { + cur := enc.buf.Len() + if enc.EncodeDuration != nil { + enc.EncodeDuration(value, enc) + } + if cur == enc.buf.Len() { + enc.AppendInt64(int64(value)) + } +} + +func (enc *logfmtEncoder) AppendFloat32(v float32) { enc.appendFloat(float64(v), 32) } +func (enc *logfmtEncoder) AppendFloat64(v float64) { enc.appendFloat(v, 64) } +func (enc *logfmtEncoder) appendFloat(val float64, bitSize int) { + enc.addSeparator() + + switch { + case math.IsNaN(val): + enc.buf.AppendString(`NaN`) + case math.IsInf(val, 1): + enc.buf.AppendString(`+Inf`) + case math.IsInf(val, -1): + enc.buf.AppendString(`-Inf`) + default: + enc.buf.AppendFloat(val, bitSize) + } +} + +func (enc *logfmtEncoder) AppendInt(v int) { enc.AppendInt64(int64(v)) } +func (enc *logfmtEncoder) AppendInt8(v int8) { enc.AppendInt64(int64(v)) } +func (enc *logfmtEncoder) AppendInt16(v int16) { enc.AppendInt64(int64(v)) } +func (enc *logfmtEncoder) AppendInt32(v int32) { enc.AppendInt64(int64(v)) } +func (enc *logfmtEncoder) AppendInt64(value int64) { + enc.addSeparator() + enc.buf.AppendInt(value) +} + +func (enc *logfmtEncoder) AppendObject(obj zapcore.ObjectMarshaler) error { + marshaler := enc.clone() + marshaler.namespaces = nil + + err := obj.MarshalLogObject(marshaler) + if err == nil { + enc.AppendByteString(marshaler.buf.Bytes()) + } else { + enc.AppendByteString(nil) + } + marshaler.buf.Free() + putEncoder(marshaler) + return err +} + +func (enc *logfmtEncoder) AppendReflected(value interface{}) error { + switch v := value.(type) { + case nil: + enc.AppendString("null") + case error: + enc.AppendString(v.Error()) + case []byte: + enc.AppendByteString(v) + case fmt.Stringer: + enc.AppendString(v.String()) + case encoding.TextMarshaler: + b, err := v.MarshalText() + if err != nil { + return err + } + enc.AppendString(string(b)) + default: + rvalue := reflect.ValueOf(value) + switch rvalue.Kind() { + case reflect.Bool: + enc.AppendBool(rvalue.Bool()) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + enc.AppendInt64(rvalue.Int()) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + enc.AppendUint64(rvalue.Uint()) + case reflect.Float32: + enc.appendFloat(rvalue.Float(), 32) + case reflect.Float64: + enc.AppendFloat64(rvalue.Float()) + case reflect.String: + enc.AppendString(rvalue.String()) + case reflect.Complex64, reflect.Complex128: + enc.AppendComplex128(rvalue.Complex()) + case reflect.Chan, reflect.Func: + enc.AppendString(fmt.Sprintf("%T(%p)", value, value)) + case reflect.Map, reflect.Struct: + enc.AppendString(fmt.Sprint(value)) + case reflect.Array, reflect.Slice: + enc.AppendArray(zapcore.ArrayMarshalerFunc(func(ae zapcore.ArrayEncoder) error { + for i := 0; i < rvalue.Len(); i++ { + ae.AppendReflected(rvalue.Index(i).Interface()) + } + return nil + })) + case reflect.Interface, reflect.Ptr: + return enc.AppendReflected(rvalue.Elem().Interface()) + } + } + return nil +} + +func (enc *logfmtEncoder) AppendString(value string) { + enc.addSeparator() + + needsQuotes := strings.IndexFunc(value, needsQuotedValueRune) != -1 + if needsQuotes { + enc.buf.AppendByte('"') + } + enc.safeAddString(value) + if needsQuotes { + enc.buf.AppendByte('"') + } +} + +func (enc *logfmtEncoder) AppendTime(value time.Time) { + cur := enc.buf.Len() + if enc.EncodeTime != nil { + enc.EncodeTime(value, enc) + } + if cur == enc.buf.Len() { + enc.AppendInt64(value.UnixNano()) + } +} + +func (enc *logfmtEncoder) AppendUint(v uint) { enc.AppendUint64(uint64(v)) } +func (enc *logfmtEncoder) AppendUint8(v uint8) { enc.AppendUint64(uint64(v)) } +func (enc *logfmtEncoder) AppendUint16(v uint16) { enc.AppendUint64(uint64(v)) } +func (enc *logfmtEncoder) AppendUint32(v uint32) { enc.AppendUint64(uint64(v)) } +func (enc *logfmtEncoder) AppendUintptr(v uintptr) { enc.AppendUint64(uint64(v)) } +func (enc *logfmtEncoder) AppendUint64(value uint64) { + enc.addSeparator() + enc.buf.AppendUint(value) +} + +func (enc *logfmtEncoder) Clone() zapcore.Encoder { + clone := enc.clone() + clone.buf.Write(enc.buf.Bytes()) + return clone +} + +func (enc *logfmtEncoder) clone() *logfmtEncoder { + clone := getEncoder() + clone.EncoderConfig = enc.EncoderConfig + clone.buf = bufferpool.Get() + clone.namespaces = enc.namespaces + return clone +} + +func (enc *logfmtEncoder) OpenNamespace(key string) { + key = strings.Map(keyRuneFilter, key) + enc.namespaces = append(enc.namespaces, key) +} + +func (enc *logfmtEncoder) EncodeEntry(ent zapcore.Entry, fields []zapcore.Field) (*buffer.Buffer, error) { + final := enc.clone() + if final.TimeKey != "" { + final.AddTime(final.TimeKey, ent.Time) + } + if final.LevelKey != "" { + final.addKey(final.LevelKey) + cur := final.buf.Len() + if final.EncodeLevel != nil { + final.EncodeLevel(ent.Level, final) + } + if cur == final.buf.Len() { + // User-supplied EncodeLevel was a no-op. Fall back to strings to keep + // output valid. + final.AppendString(ent.Level.String()) + } + } + if ent.LoggerName != "" && final.NameKey != "" { + final.addKey(final.NameKey) + cur := final.buf.Len() + if final.EncodeName != nil { + final.EncodeName(ent.LoggerName, final) + } + if cur == final.buf.Len() { + // User-supplied EncodeName was a no-op. Fall back to strings to + // keep output valid. + final.AppendString(ent.LoggerName) + } + } + if ent.Caller.Defined && final.CallerKey != "" { + final.addKey(final.CallerKey) + cur := final.buf.Len() + if final.EncodeCaller != nil { + final.EncodeCaller(ent.Caller, final) + } + if cur == final.buf.Len() { + // User-supplied EncodeCaller was a no-op. Fall back to strings to + // keep output valid. + final.AppendString(ent.Caller.String()) + } + } + if final.MessageKey != "" { + final.addKey(enc.MessageKey) + final.AppendString(ent.Message) + } + if enc.buf.Len() > 0 { + if final.buf.Len() > 0 { + final.buf.AppendByte(' ') + } + final.buf.Write(enc.buf.Bytes()) + } + addFields(final, fields) + if ent.Stack != "" && final.StacktraceKey != "" { + final.AddString(final.StacktraceKey, ent.Stack) + } + if final.LineEnding != "" { + final.buf.AppendString(final.LineEnding) + } else { + final.buf.AppendString(zapcore.DefaultLineEnding) + } + + ret := final.buf + putEncoder(final) + return ret, nil +} + +func (enc *logfmtEncoder) addSeparator() { + if !enc.arrayLiteral { + return + } + + last := enc.buf.Len() - 1 + if last >= 0 && enc.buf.Bytes()[last] != '[' { + enc.buf.AppendByte(',') + } +} + +func (enc *logfmtEncoder) addKey(key string) { + key = strings.Map(keyRuneFilter, key) + if enc.buf.Len() > 0 { + enc.buf.AppendByte(' ') + } + for _, ns := range enc.namespaces { + enc.safeAddString(ns) + enc.buf.AppendByte('.') + } + enc.safeAddString(key) + enc.buf.AppendByte('=') +} + +// safeAddString JSON-escapes a string and appends it to the internal buffer. +// Unlike the standard library's encoder, it doesn't attempt to protect the +// user from browser vulnerabilities or JSONP-related problems. +func (enc *logfmtEncoder) safeAddString(s string) { + for i := 0; i < len(s); { + if enc.tryAddRuneSelf(s[i]) { + i++ + continue + } + r, size := utf8.DecodeRuneInString(s[i:]) + if enc.tryAddRuneError(r, size) { + i++ + continue + } + enc.buf.AppendString(s[i : i+size]) + i += size + } +} + +// safeAddByteString is no-alloc equivalent of safeAddString(string(s)) for s []byte. +func (enc *logfmtEncoder) safeAddByteString(s []byte) { + for i := 0; i < len(s); { + if enc.tryAddRuneSelf(s[i]) { + i++ + continue + } + r, size := utf8.DecodeRune(s[i:]) + if enc.tryAddRuneError(r, size) { + i++ + continue + } + enc.buf.Write(s[i : i+size]) + i += size + } +} + +// tryAddRuneSelf appends b if it is valid UTF-8 character represented in a single byte. +func (enc *logfmtEncoder) tryAddRuneSelf(b byte) bool { + if b >= utf8.RuneSelf { + return false + } + if 0x20 <= b && b != '\\' && b != '"' { + enc.buf.AppendByte(b) + return true + } + switch b { + case '\\', '"': + enc.buf.AppendByte('\\') + enc.buf.AppendByte(b) + case '\n': + enc.buf.AppendByte('\\') + enc.buf.AppendByte('n') + case '\r': + enc.buf.AppendByte('\\') + enc.buf.AppendByte('r') + case '\t': + enc.buf.AppendByte('\\') + enc.buf.AppendByte('t') + default: + // Encode bytes < 0x20, except for the escape sequences above. + const _hex = "0123456789abcdef" + enc.buf.AppendString(`\u00`) + enc.buf.AppendByte(_hex[b>>4]) + enc.buf.AppendByte(_hex[b&0xF]) + } + return true +} + +func (enc *logfmtEncoder) tryAddRuneError(r rune, size int) bool { + if r == utf8.RuneError && size == 1 { + enc.buf.AppendString(`\ufffd`) + return true + } + return false +} + +func needsQuotedValueRune(r rune) bool { + return r <= ' ' || r == '=' || r == '"' || r == utf8.RuneError +} + +func keyRuneFilter(r rune) rune { + if needsQuotedValueRune(r) { + return -1 + } + return r +} + +func addFields(enc zapcore.ObjectEncoder, fields []zapcore.Field) { + for i := range fields { + fields[i].AddTo(enc) + } +} diff --git a/integration/vendor/github.com/sykesm/zap-logfmt/go.mod b/integration/vendor/github.com/sykesm/zap-logfmt/go.mod new file mode 100644 index 00000000..1c7c5b8d --- /dev/null +++ b/integration/vendor/github.com/sykesm/zap-logfmt/go.mod @@ -0,0 +1,9 @@ +module github.com/sykesm/zap-logfmt + +require ( + github.com/pkg/errors v0.8.1 // indirect + github.com/stretchr/testify v1.3.0 + go.uber.org/atomic v1.3.2 // indirect + go.uber.org/multierr v1.1.0 // indirect + go.uber.org/zap v1.9.1 +) diff --git a/integration/vendor/github.com/sykesm/zap-logfmt/go.sum b/integration/vendor/github.com/sykesm/zap-logfmt/go.sum new file mode 100644 index 00000000..62ccfe0a --- /dev/null +++ b/integration/vendor/github.com/sykesm/zap-logfmt/go.sum @@ -0,0 +1,15 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.9.1 h1:XCJQEf3W6eZaVwhRBof6ImoYGJSITeKWsyeh3HFu/5o= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= diff --git a/integration/vendor/modules.txt b/integration/vendor/modules.txt index 365c035b..c994a996 100644 --- a/integration/vendor/modules.txt +++ b/integration/vendor/modules.txt @@ -69,7 +69,7 @@ github.com/hpcloud/tail/ratelimiter github.com/hpcloud/tail/util github.com/hpcloud/tail/watch github.com/hpcloud/tail/winfile -# github.com/hyperledger/fabric v1.4.0 +# github.com/hyperledger/fabric v1.4.0 => github.com/hyperledger/fabric v1.4.4-0.20200211223613-5eaae3a9940d github.com/hyperledger/fabric/integration/nwo github.com/hyperledger/fabric/integration/nwo/commands github.com/hyperledger/fabric/common/tools/configtxlator/update @@ -77,9 +77,11 @@ github.com/hyperledger/fabric/integration/helpers github.com/hyperledger/fabric/integration/nwo/fabricconfig github.com/hyperledger/fabric/integration/runner github.com/hyperledger/fabric/protos/common +github.com/hyperledger/fabric/protos/msp +github.com/hyperledger/fabric/protos/orderer +github.com/hyperledger/fabric/protos/orderer/etcdraft github.com/hyperledger/fabric/protos/utils github.com/hyperledger/fabric/common/util -github.com/hyperledger/fabric/protos/msp github.com/hyperledger/fabric/bccsp github.com/hyperledger/fabric/bccsp/factory github.com/hyperledger/fabric/common/crypto @@ -176,6 +178,8 @@ github.com/spf13/jwalterweatherman github.com/spf13/pflag # github.com/spf13/viper v1.4.0 github.com/spf13/viper +# github.com/sykesm/zap-logfmt v0.0.2 +github.com/sykesm/zap-logfmt # github.com/tedsuo/ifrit v0.0.0-20191009134036-9a97d0632f00 github.com/tedsuo/ifrit/ginkgomon github.com/tedsuo/ifrit @@ -195,14 +199,14 @@ go.uber.org/zap/internal/exit # golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 golang.org/x/crypto/sha3 # golang.org/x/net v0.0.0-20190628185345-da137c7871d7 -golang.org/x/net/html/charset golang.org/x/net/context -golang.org/x/net/html +golang.org/x/net/html/charset golang.org/x/net/trace -golang.org/x/net/html/atom +golang.org/x/net/html golang.org/x/net/internal/timeseries golang.org/x/net/http2 golang.org/x/net/http2/hpack +golang.org/x/net/html/atom golang.org/x/net/http/httpguts golang.org/x/net/idna # golang.org/x/sys v0.0.0-20191020212454-3e7259c5e7c2 @@ -225,22 +229,22 @@ golang.org/x/text/language golang.org/x/text/internal/utf8internal golang.org/x/text/runes golang.org/x/text/internal/tag -golang.org/x/text/unicode/norm golang.org/x/text/secure/bidirule golang.org/x/text/unicode/bidi +golang.org/x/text/unicode/norm # google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 google.golang.org/genproto/googleapis/rpc/status # google.golang.org/grpc v1.24.0 -google.golang.org/grpc/peer google.golang.org/grpc -google.golang.org/grpc/credentials -google.golang.org/grpc/grpclog +google.golang.org/grpc/peer google.golang.org/grpc/balancer google.golang.org/grpc/balancer/roundrobin google.golang.org/grpc/codes google.golang.org/grpc/connectivity +google.golang.org/grpc/credentials google.golang.org/grpc/encoding google.golang.org/grpc/encoding/proto +google.golang.org/grpc/grpclog google.golang.org/grpc/internal google.golang.org/grpc/internal/backoff google.golang.org/grpc/internal/balancerload @@ -260,8 +264,8 @@ google.golang.org/grpc/serviceconfig google.golang.org/grpc/stats google.golang.org/grpc/status google.golang.org/grpc/tap -google.golang.org/grpc/credentials/internal google.golang.org/grpc/balancer/base +google.golang.org/grpc/credentials/internal google.golang.org/grpc/binarylog/grpc_binarylog_v1 google.golang.org/grpc/internal/syscall # gopkg.in/fsnotify.v1 v1.4.7 diff --git a/scripts/run-integration-tests.sh b/scripts/run-integration-tests.sh index dbeee957..db6009c0 100755 --- a/scripts/run-integration-tests.sh +++ b/scripts/run-integration-tests.sh @@ -38,11 +38,11 @@ main() { #Check if Fabric is in the gopath. Fabric needs to be in the gopath for the integration tests if [ ! -d "${FABRIC_DIR}" ]; then echo "Downloading Fabric Branch v1.4.0" - git clone https://github.com/hyperledger/fabric $FABRIC_DIR --branch v1.4.0 --single-branch --depth 1 + git clone https://github.com/hyperledger/fabric $FABRIC_DIR --branch release-1.4 --single-branch --depth 1 else - FABRIC_VERSION=$(git -C ${FABRIC_DIR} describe --abbrev=0) - if [[ ${FABRIC_VERSION} != "v1.4.0" ]]; then - echo "Please switch Fabric Repository to tag v1.4.0 before running these tests" + FABRIC_VERSION=$(git -C ${FABRIC_DIR} rev-parse --abbrev-ref HEAD) + if [[ ${FABRIC_VERSION} != "release-1.4" ]]; then + echo "Please switch Fabric Repository to release v1.4.0 before running these tests, it currently is on ${FABRIC_VERSION}" echo "You can run in the Fabric Directory: git checkout v1.4.0" exit 1 fi