From 8d75f70060009b2d9975c4dc7b5ea21774052946 Mon Sep 17 00:00:00 2001 From: Rolson Quadras Date: Mon, 6 May 2019 16:45:58 -0400 Subject: [PATCH] [#3] Fabric extension module with protos (#4) - Created Fabric extension module with protos - Added Makefile - Updated CI file to invoke make target Signed-off-by: Rolson Quadras --- .travis.yml | 2 +- Makefile | 19 + README.md | 16 +- fabric/Makefile | 17 + fabric/go.mod | 12 + fabric/go.sum | 28 + fabric/protos/common/collection.pb.go | 564 ++++++ fabric/protos/common/common.pb.go | 857 +++++++++ fabric/protos/common/configtx.pb.go | 668 +++++++ fabric/protos/common/configuration.pb.go | 325 ++++ fabric/protos/common/ledger.pb.go | 101 ++ fabric/protos/common/policies.pb.go | 474 +++++ fabric/protos/common/signed_data.go | 115 ++ .../ledger/rwset/kvrwset/kv_rwset.pb.go | 884 ++++++++++ fabric/protos/ledger/rwset/rwset.pb.go | 386 ++++ fabric/protos/msp/identities.pb.go | 183 ++ fabric/protos/msp/msp_config.pb.go | 747 ++++++++ fabric/protos/msp/msp_principal.pb.go | 441 +++++ fabric/protos/orderer/configuration.pb.go | 288 +++ fabric/protos/peer/chaincode.pb.go | 473 +++++ fabric/protos/peer/chaincode_event.pb.go | 113 ++ fabric/protos/peer/configuration.pb.go | 227 +++ fabric/protos/peer/events.pb.go | 707 ++++++++ fabric/protos/peer/peer.pb.go | 211 +++ fabric/protos/peer/proposal.pb.go | 424 +++++ fabric/protos/peer/proposal_response.pb.go | 336 ++++ fabric/protos/peer/query.pb.go | 277 +++ fabric/protos/peer/signed_cc_dep_spec.pb.go | 114 ++ fabric/protos/peer/transaction.pb.go | 539 ++++++ fabric/protos/token/expectations.pb.go | 357 ++++ fabric/protos/token/prover.pb.go | 1563 +++++++++++++++++ fabric/protos/token/transaction.pb.go | 819 +++++++++ fabric/protos/utils/commonutils.go | 118 ++ fabric/protos/utils/proputils.go | 214 +++ fabric/protos/utils/txutils.go | 85 + 35 files changed, 12702 insertions(+), 2 deletions(-) create mode 100644 Makefile create mode 100644 fabric/Makefile create mode 100644 fabric/go.mod create mode 100644 fabric/go.sum create mode 100644 fabric/protos/common/collection.pb.go create mode 100644 fabric/protos/common/common.pb.go create mode 100644 fabric/protos/common/configtx.pb.go create mode 100644 fabric/protos/common/configuration.pb.go create mode 100644 fabric/protos/common/ledger.pb.go create mode 100644 fabric/protos/common/policies.pb.go create mode 100644 fabric/protos/common/signed_data.go create mode 100644 fabric/protos/ledger/rwset/kvrwset/kv_rwset.pb.go create mode 100644 fabric/protos/ledger/rwset/rwset.pb.go create mode 100644 fabric/protos/msp/identities.pb.go create mode 100644 fabric/protos/msp/msp_config.pb.go create mode 100644 fabric/protos/msp/msp_principal.pb.go create mode 100644 fabric/protos/orderer/configuration.pb.go create mode 100644 fabric/protos/peer/chaincode.pb.go create mode 100644 fabric/protos/peer/chaincode_event.pb.go create mode 100644 fabric/protos/peer/configuration.pb.go create mode 100644 fabric/protos/peer/events.pb.go create mode 100644 fabric/protos/peer/peer.pb.go create mode 100644 fabric/protos/peer/proposal.pb.go create mode 100644 fabric/protos/peer/proposal_response.pb.go create mode 100644 fabric/protos/peer/query.pb.go create mode 100644 fabric/protos/peer/signed_cc_dep_spec.pb.go create mode 100644 fabric/protos/peer/transaction.pb.go create mode 100644 fabric/protos/token/expectations.pb.go create mode 100644 fabric/protos/token/prover.pb.go create mode 100644 fabric/protos/token/transaction.pb.go create mode 100644 fabric/protos/utils/commonutils.go create mode 100644 fabric/protos/utils/proputils.go create mode 100644 fabric/protos/utils/txutils.go diff --git a/.travis.yml b/.travis.yml index b1a8c2c..5e4156c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,4 +3,4 @@ language: go go: - 1.11.x -script: date +script: make all diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b99a0ba --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +# Copyright SecureKey Technologies Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +# Supported Targets: +# all : build +# build: builds the modules + +GO_CMD ?= go +GO111MODULE=on + +all: build + +build: build-fabric-module + +build-fabric-module: + $(MAKE) -C fabric/ all + +.PHONY: all build build-fabric-module diff --git a/README.md b/README.md index c83ab66..ff74e8a 100644 --- a/README.md +++ b/README.md @@ -1 +1,15 @@ -# fabric-sdk-go-ext [![Build Status](https://travis-ci.com/trustbloc/fabric-sdk-go-ext.svg?branch=master)](https://travis-ci.com/trustbloc/fabric-sdk-go-ext) \ No newline at end of file +# fabric-sdk-go-ext [![Build Status](https://travis-ci.com/trustbloc/fabric-sdk-go-ext.svg?branch=master)](https://travis-ci.com/trustbloc/fabric-sdk-go-ext) + +The project contains the set of extensions that can be used as module substitution with Hyperledger Fabric SDK Go +([fabric-sdk-go](https://github.com/hyperledger/fabric-sdk-go)). + +The project contains following modules: +1. **fabric** : [Hyperledger Fabric](https://github.com/hyperledger/fabric) related extensions including protos used by Hyperledger Fabric SDK Go. + + +##### Build + +To compile the project, please run the following command from root directory +``` +$ make build +``` diff --git a/fabric/Makefile b/fabric/Makefile new file mode 100644 index 0000000..c125bcb --- /dev/null +++ b/fabric/Makefile @@ -0,0 +1,17 @@ +# Copyright SecureKey Technologies Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +# Supported Targets: +# all : build +# build: builds the module + +GO_CMD ?= go +GO111MODULE=on + +all: build + +build: + $(GO_CMD) build ./... + +.PHONY: all build diff --git a/fabric/go.mod b/fabric/go.mod new file mode 100644 index 0000000..8c890a9 --- /dev/null +++ b/fabric/go.mod @@ -0,0 +1,12 @@ +// Copyright SecureKey Technologies Inc. All Rights Reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +module github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric + +require ( + github.com/golang/protobuf v1.2.0 + github.com/pkg/errors v0.8.1 + golang.org/x/net v0.0.0-20190213061140-3a22650c66bd + google.golang.org/grpc v1.19.0 +) diff --git a/fabric/go.sum b/fabric/go.sum new file mode 100644 index 0000000..46809a4 --- /dev/null +++ b/fabric/go.sum @@ -0,0 +1,28 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd h1:HuTn7WObtcDo9uEEU7rEqL0jYthdXAmZ6PP+meazmaU= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522 h1:Ve1ORMCxvRmSXBwJK+t3Oy+V2vRW2OetUQBq4rJIkZE= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/fabric/protos/common/collection.pb.go b/fabric/protos/common/collection.pb.go new file mode 100644 index 0000000..573285f --- /dev/null +++ b/fabric/protos/common/collection.pb.go @@ -0,0 +1,564 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: common/collection.proto + +package common // import "github.com/hyperledger/fabric/protos/common" + +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 + +// CollectionType enumerates the various types of private data collections. +type CollectionType int32 + +const ( + CollectionType_UNKNOWN CollectionType = 0 + CollectionType_PRIVATE CollectionType = 1 + CollectionType_TRANSIENT CollectionType = 2 + CollectionType_DCAS CollectionType = 3 +) + +var CollectionType_name = map[int32]string{ + 0: "UNKNOWN", + 1: "PRIVATE", + 2: "TRANSIENT", + 3: "DCAS", +} +var CollectionType_value = map[string]int32{ + "UNKNOWN": 0, + "PRIVATE": 1, + "TRANSIENT": 2, + "DCAS": 3, +} + +func (x CollectionType) String() string { + return proto.EnumName(CollectionType_name, int32(x)) +} +func (CollectionType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_collection_c912aa7b45171da9, []int{0} +} + +// CollectionConfigPackage represents an array of CollectionConfig +// messages; the extra struct is required because repeated oneof is +// forbidden by the protobuf syntax +type CollectionConfigPackage struct { + Config []*CollectionConfig `protobuf:"bytes,1,rep,name=config,proto3" json:"config,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CollectionConfigPackage) Reset() { *m = CollectionConfigPackage{} } +func (m *CollectionConfigPackage) String() string { return proto.CompactTextString(m) } +func (*CollectionConfigPackage) ProtoMessage() {} +func (*CollectionConfigPackage) Descriptor() ([]byte, []int) { + return fileDescriptor_collection_c912aa7b45171da9, []int{0} +} +func (m *CollectionConfigPackage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CollectionConfigPackage.Unmarshal(m, b) +} +func (m *CollectionConfigPackage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CollectionConfigPackage.Marshal(b, m, deterministic) +} +func (dst *CollectionConfigPackage) XXX_Merge(src proto.Message) { + xxx_messageInfo_CollectionConfigPackage.Merge(dst, src) +} +func (m *CollectionConfigPackage) XXX_Size() int { + return xxx_messageInfo_CollectionConfigPackage.Size(m) +} +func (m *CollectionConfigPackage) XXX_DiscardUnknown() { + xxx_messageInfo_CollectionConfigPackage.DiscardUnknown(m) +} + +var xxx_messageInfo_CollectionConfigPackage proto.InternalMessageInfo + +func (m *CollectionConfigPackage) GetConfig() []*CollectionConfig { + if m != nil { + return m.Config + } + return nil +} + +// CollectionConfig defines the configuration of a collection object; +// it currently contains a single, static type. +// Dynamic collections are deferred. +type CollectionConfig struct { + // Types that are valid to be assigned to Payload: + // *CollectionConfig_StaticCollectionConfig + // *CollectionConfig_TransientCollectionConfig + Payload isCollectionConfig_Payload `protobuf_oneof:"payload"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CollectionConfig) Reset() { *m = CollectionConfig{} } +func (m *CollectionConfig) String() string { return proto.CompactTextString(m) } +func (*CollectionConfig) ProtoMessage() {} +func (*CollectionConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_collection_c912aa7b45171da9, []int{1} +} +func (m *CollectionConfig) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CollectionConfig.Unmarshal(m, b) +} +func (m *CollectionConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CollectionConfig.Marshal(b, m, deterministic) +} +func (dst *CollectionConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_CollectionConfig.Merge(dst, src) +} +func (m *CollectionConfig) XXX_Size() int { + return xxx_messageInfo_CollectionConfig.Size(m) +} +func (m *CollectionConfig) XXX_DiscardUnknown() { + xxx_messageInfo_CollectionConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_CollectionConfig proto.InternalMessageInfo + +type isCollectionConfig_Payload interface { + isCollectionConfig_Payload() +} + +type CollectionConfig_StaticCollectionConfig struct { + StaticCollectionConfig *StaticCollectionConfig `protobuf:"bytes,1,opt,name=static_collection_config,json=staticCollectionConfig,oneof"` +} + +func (*CollectionConfig_StaticCollectionConfig) isCollectionConfig_Payload() {} + +func (m *CollectionConfig) GetPayload() isCollectionConfig_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (m *CollectionConfig) GetStaticCollectionConfig() *StaticCollectionConfig { + if x, ok := m.GetPayload().(*CollectionConfig_StaticCollectionConfig); ok { + return x.StaticCollectionConfig + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*CollectionConfig) 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 _CollectionConfig_OneofMarshaler, _CollectionConfig_OneofUnmarshaler, _CollectionConfig_OneofSizer, []interface{}{ + (*CollectionConfig_StaticCollectionConfig)(nil), + } +} + +func _CollectionConfig_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*CollectionConfig) + // payload + switch x := m.Payload.(type) { + case *CollectionConfig_StaticCollectionConfig: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.StaticCollectionConfig); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("CollectionConfig.Payload has unexpected type %T", x) + } + return nil +} + +func _CollectionConfig_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*CollectionConfig) + switch tag { + case 1: // payload.static_collection_config + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(StaticCollectionConfig) + err := b.DecodeMessage(msg) + m.Payload = &CollectionConfig_StaticCollectionConfig{msg} + return true, err + default: + return false, nil + } +} + +func _CollectionConfig_OneofSizer(msg proto.Message) (n int) { + m := msg.(*CollectionConfig) + // payload + switch x := m.Payload.(type) { + case *CollectionConfig_StaticCollectionConfig: + s := proto.Size(x.StaticCollectionConfig) + 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 +} + +// StaticCollectionConfig constitutes the configuration parameters of a +// static collection object. Static collections are collections that are +// known at chaincode instantiation time, and that cannot be changed. +// Dynamic collections are deferred. +type StaticCollectionConfig struct { + // the name of the collection inside the denoted chaincode + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // a reference to a policy residing / managed in the config block + // to define which orgs have access to this collection’s private data + MemberOrgsPolicy *CollectionPolicyConfig `protobuf:"bytes,2,opt,name=member_orgs_policy,json=memberOrgsPolicy,proto3" json:"member_orgs_policy,omitempty"` + // The minimum number of peers private data will be sent to upon + // endorsement. The endorsement would fail if dissemination to at least + // this number of peers is not achieved. + RequiredPeerCount int32 `protobuf:"varint,3,opt,name=required_peer_count,json=requiredPeerCount,proto3" json:"required_peer_count,omitempty"` + // The maximum number of peers that private data will be sent to + // upon endorsement. This number has to be bigger than required_peer_count. + MaximumPeerCount int32 `protobuf:"varint,4,opt,name=maximum_peer_count,json=maximumPeerCount,proto3" json:"maximum_peer_count,omitempty"` + // The number of blocks after which the collection data expires. + // For instance if the value is set to 10, a key last modified by block number 100 + // will be purged at block number 111. A zero value is treated same as MaxUint64 + BlockToLive uint64 `protobuf:"varint,5,opt,name=block_to_live,json=blockToLive,proto3" json:"block_to_live,omitempty"` + // The member only read access denotes whether only collection member clients + // can read the private data (if set to true), or even non members can + // read the data (if set to false, for example if you want to implement more granular + // access logic in the chaincode) + MemberOnlyRead bool `protobuf:"varint,6,opt,name=member_only_read,json=memberOnlyRead,proto3" json:"member_only_read,omitempty"` + // The member only write access denotes whether only collection member clients + // can write the private data (if set to true), or even non members can + // write the data (if set to false, for example if you want to implement more granular + // access logic in the chaincode) + MemberOnlyWrite bool `protobuf:"varint,7,opt,name=member_only_write,json=memberOnlyWrite,proto3" json:"member_only_write,omitempty"` + // The type of collection. + Type CollectionType `protobuf:"varint,9900,opt,name=type,enum=common.CollectionType" json:"type,omitempty"` + // The time after which the collection data expires. For example, + // if the value is set to "10m" then the data will be purged + // 10 minutes after it was stored. An empty value indicates that + // the data should never be purged. + // The format of this string must be parseable by time.ParseDuration + TimeToLive string `protobuf:"bytes,9901,opt,name=time_to_live,json=timeToLive" json:"time_to_live,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StaticCollectionConfig) Reset() { *m = StaticCollectionConfig{} } +func (m *StaticCollectionConfig) String() string { return proto.CompactTextString(m) } +func (*StaticCollectionConfig) ProtoMessage() {} +func (*StaticCollectionConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_collection_c912aa7b45171da9, []int{2} +} +func (m *StaticCollectionConfig) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_StaticCollectionConfig.Unmarshal(m, b) +} +func (m *StaticCollectionConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_StaticCollectionConfig.Marshal(b, m, deterministic) +} +func (dst *StaticCollectionConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_StaticCollectionConfig.Merge(dst, src) +} +func (m *StaticCollectionConfig) XXX_Size() int { + return xxx_messageInfo_StaticCollectionConfig.Size(m) +} +func (m *StaticCollectionConfig) XXX_DiscardUnknown() { + xxx_messageInfo_StaticCollectionConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_StaticCollectionConfig proto.InternalMessageInfo + +func (m *StaticCollectionConfig) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *StaticCollectionConfig) GetMemberOrgsPolicy() *CollectionPolicyConfig { + if m != nil { + return m.MemberOrgsPolicy + } + return nil +} + +func (m *StaticCollectionConfig) GetRequiredPeerCount() int32 { + if m != nil { + return m.RequiredPeerCount + } + return 0 +} + +func (m *StaticCollectionConfig) GetMaximumPeerCount() int32 { + if m != nil { + return m.MaximumPeerCount + } + return 0 +} + +func (m *StaticCollectionConfig) GetBlockToLive() uint64 { + if m != nil { + return m.BlockToLive + } + return 0 +} + +func (m *StaticCollectionConfig) GetMemberOnlyRead() bool { + if m != nil { + return m.MemberOnlyRead + } + return false +} + +func (m *StaticCollectionConfig) GetMemberOnlyWrite() bool { + if m != nil { + return m.MemberOnlyWrite + } + return false +} + +func (m *StaticCollectionConfig) GetType() CollectionType { + if m != nil { + return m.Type + } + return CollectionType_UNKNOWN +} + +func (m *StaticCollectionConfig) GetTimeToLive() string { + if m != nil { + return m.TimeToLive + } + return "" +} + +// Collection policy configuration. Initially, the configuration can only +// contain a SignaturePolicy. In the future, the SignaturePolicy may be a +// more general Policy. Instead of containing the actual policy, the +// configuration may in the future contain a string reference to a policy. +type CollectionPolicyConfig struct { + // Types that are valid to be assigned to Payload: + // *CollectionPolicyConfig_SignaturePolicy + Payload isCollectionPolicyConfig_Payload `protobuf_oneof:"payload"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CollectionPolicyConfig) Reset() { *m = CollectionPolicyConfig{} } +func (m *CollectionPolicyConfig) String() string { return proto.CompactTextString(m) } +func (*CollectionPolicyConfig) ProtoMessage() {} +func (*CollectionPolicyConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_collection_c912aa7b45171da9, []int{3} +} +func (m *CollectionPolicyConfig) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CollectionPolicyConfig.Unmarshal(m, b) +} +func (m *CollectionPolicyConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CollectionPolicyConfig.Marshal(b, m, deterministic) +} +func (dst *CollectionPolicyConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_CollectionPolicyConfig.Merge(dst, src) +} +func (m *CollectionPolicyConfig) XXX_Size() int { + return xxx_messageInfo_CollectionPolicyConfig.Size(m) +} +func (m *CollectionPolicyConfig) XXX_DiscardUnknown() { + xxx_messageInfo_CollectionPolicyConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_CollectionPolicyConfig proto.InternalMessageInfo + +type isCollectionPolicyConfig_Payload interface { + isCollectionPolicyConfig_Payload() +} + +type CollectionPolicyConfig_SignaturePolicy struct { + SignaturePolicy *SignaturePolicyEnvelope `protobuf:"bytes,1,opt,name=signature_policy,json=signaturePolicy,proto3,oneof"` +} + +func (*CollectionPolicyConfig_SignaturePolicy) isCollectionPolicyConfig_Payload() {} + +func (m *CollectionPolicyConfig) GetPayload() isCollectionPolicyConfig_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (m *CollectionPolicyConfig) GetSignaturePolicy() *SignaturePolicyEnvelope { + if x, ok := m.GetPayload().(*CollectionPolicyConfig_SignaturePolicy); ok { + return x.SignaturePolicy + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*CollectionPolicyConfig) 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 _CollectionPolicyConfig_OneofMarshaler, _CollectionPolicyConfig_OneofUnmarshaler, _CollectionPolicyConfig_OneofSizer, []interface{}{ + (*CollectionPolicyConfig_SignaturePolicy)(nil), + } +} + +func _CollectionPolicyConfig_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*CollectionPolicyConfig) + // payload + switch x := m.Payload.(type) { + case *CollectionPolicyConfig_SignaturePolicy: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SignaturePolicy); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("CollectionPolicyConfig.Payload has unexpected type %T", x) + } + return nil +} + +func _CollectionPolicyConfig_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*CollectionPolicyConfig) + switch tag { + case 1: // payload.signature_policy + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignaturePolicyEnvelope) + err := b.DecodeMessage(msg) + m.Payload = &CollectionPolicyConfig_SignaturePolicy{msg} + return true, err + default: + return false, nil + } +} + +func _CollectionPolicyConfig_OneofSizer(msg proto.Message) (n int) { + m := msg.(*CollectionPolicyConfig) + // payload + switch x := m.Payload.(type) { + case *CollectionPolicyConfig_SignaturePolicy: + s := proto.Size(x.SignaturePolicy) + 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 +} + +// CollectionCriteria defines an element of a private data that corresponds +// to a certain transaction and collection +type CollectionCriteria struct { + Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"` + TxId string `protobuf:"bytes,2,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` + Collection string `protobuf:"bytes,3,opt,name=collection,proto3" json:"collection,omitempty"` + Namespace string `protobuf:"bytes,4,opt,name=namespace,proto3" json:"namespace,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CollectionCriteria) Reset() { *m = CollectionCriteria{} } +func (m *CollectionCriteria) String() string { return proto.CompactTextString(m) } +func (*CollectionCriteria) ProtoMessage() {} +func (*CollectionCriteria) Descriptor() ([]byte, []int) { + return fileDescriptor_collection_c912aa7b45171da9, []int{4} +} +func (m *CollectionCriteria) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CollectionCriteria.Unmarshal(m, b) +} +func (m *CollectionCriteria) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CollectionCriteria.Marshal(b, m, deterministic) +} +func (dst *CollectionCriteria) XXX_Merge(src proto.Message) { + xxx_messageInfo_CollectionCriteria.Merge(dst, src) +} +func (m *CollectionCriteria) XXX_Size() int { + return xxx_messageInfo_CollectionCriteria.Size(m) +} +func (m *CollectionCriteria) XXX_DiscardUnknown() { + xxx_messageInfo_CollectionCriteria.DiscardUnknown(m) +} + +var xxx_messageInfo_CollectionCriteria proto.InternalMessageInfo + +func (m *CollectionCriteria) GetChannel() string { + if m != nil { + return m.Channel + } + return "" +} + +func (m *CollectionCriteria) GetTxId() string { + if m != nil { + return m.TxId + } + return "" +} + +func (m *CollectionCriteria) GetCollection() string { + if m != nil { + return m.Collection + } + return "" +} + +func (m *CollectionCriteria) GetNamespace() string { + if m != nil { + return m.Namespace + } + return "" +} + +func init() { + proto.RegisterType((*CollectionConfigPackage)(nil), "common.CollectionConfigPackage") + proto.RegisterType((*CollectionConfig)(nil), "common.CollectionConfig") + proto.RegisterType((*StaticCollectionConfig)(nil), "common.StaticCollectionConfig") + proto.RegisterType((*CollectionPolicyConfig)(nil), "common.CollectionPolicyConfig") + proto.RegisterType((*CollectionCriteria)(nil), "common.CollectionCriteria") + proto.RegisterEnum("common.CollectionType", CollectionType_name, CollectionType_value) +} + +func init() { proto.RegisterFile("common/collection.proto", fileDescriptor_collection_c912aa7b45171da9) } + +var fileDescriptor_collection_c912aa7b45171da9 = []byte{ + // 500 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x93, 0x5f, 0x6b, 0xdb, 0x3c, + 0x14, 0xc6, 0xeb, 0x36, 0x7f, 0x5e, 0x9f, 0xf0, 0xae, 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 0x71, 0x4a, 0x3c, 0xe8, 0xb3, 0x15, 0x15, 0x02, 0xd3, 0x2a, 0xc6, + 0xfa, 0x48, 0x2e, 0xa1, 0xab, 0xb7, 0x11, 0x8f, 0x4d, 0x78, 0x6e, 0xd8, 0xd1, 0xdb, 0x6f, 0x31, + 0xb9, 0x06, 0x68, 0x5e, 0x9b, 0xc9, 0xc1, 0x0d, 0x5b, 0x0a, 0x79, 0x0b, 0xee, 0xee, 0x19, 0x14, + 0x39, 0x65, 0x68, 0xf6, 0xee, 0x86, 0x8d, 0x70, 0x7b, 0x0f, 0xef, 0xa5, 0x4a, 0x82, 0x55, 0x99, + 0xa3, 0x4a, 0x31, 0x4e, 0x50, 0x05, 0x8f, 0x74, 0xa9, 0x38, 0xb3, 0xdf, 0x4c, 0x51, 0xdd, 0xf0, + 0xe1, 0x63, 0xc2, 0xf5, 0x6a, 0xbd, 0xdc, 0x1d, 0xa7, 0x2d, 0x78, 0x6a, 0xe1, 0xa9, 0x85, 0xa7, + 0x16, 0x5e, 0xf6, 0xcc, 0xf1, 0xcb, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb1, 0x4b, 0x91, 0x18, + 0xa9, 0x03, 0x00, 0x00, +} diff --git a/fabric/protos/common/common.pb.go b/fabric/protos/common/common.pb.go new file mode 100644 index 0000000..51ab5d2 --- /dev/null +++ b/fabric/protos/common/common.pb.go @@ -0,0 +1,857 @@ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: common/common.proto + +package common // import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/common" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import timestamp "github.com/golang/protobuf/ptypes/timestamp" + +// 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 + +// These status codes are intended to resemble selected HTTP status codes +type Status int32 + +const ( + Status_UNKNOWN Status = 0 + Status_SUCCESS Status = 200 + Status_BAD_REQUEST Status = 400 + Status_FORBIDDEN Status = 403 + Status_NOT_FOUND Status = 404 + Status_REQUEST_ENTITY_TOO_LARGE Status = 413 + Status_INTERNAL_SERVER_ERROR Status = 500 + Status_NOT_IMPLEMENTED Status = 501 + Status_SERVICE_UNAVAILABLE Status = 503 +) + +var Status_name = map[int32]string{ + 0: "UNKNOWN", + 200: "SUCCESS", + 400: "BAD_REQUEST", + 403: "FORBIDDEN", + 404: "NOT_FOUND", + 413: "REQUEST_ENTITY_TOO_LARGE", + 500: "INTERNAL_SERVER_ERROR", + 501: "NOT_IMPLEMENTED", + 503: "SERVICE_UNAVAILABLE", +} +var Status_value = map[string]int32{ + "UNKNOWN": 0, + "SUCCESS": 200, + "BAD_REQUEST": 400, + "FORBIDDEN": 403, + "NOT_FOUND": 404, + "REQUEST_ENTITY_TOO_LARGE": 413, + "INTERNAL_SERVER_ERROR": 500, + "NOT_IMPLEMENTED": 501, + "SERVICE_UNAVAILABLE": 503, +} + +func (x Status) String() string { + return proto.EnumName(Status_name, int32(x)) +} +func (Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_common_b374fafc5e1c956e, []int{0} +} + +type HeaderType int32 + +const ( + HeaderType_MESSAGE HeaderType = 0 + HeaderType_CONFIG HeaderType = 1 + HeaderType_CONFIG_UPDATE HeaderType = 2 + HeaderType_ENDORSER_TRANSACTION HeaderType = 3 + HeaderType_ORDERER_TRANSACTION HeaderType = 4 + HeaderType_DELIVER_SEEK_INFO HeaderType = 5 + HeaderType_CHAINCODE_PACKAGE HeaderType = 6 + HeaderType_PEER_ADMIN_OPERATION HeaderType = 8 + HeaderType_TOKEN_TRANSACTION HeaderType = 9 +) + +var HeaderType_name = map[int32]string{ + 0: "MESSAGE", + 1: "CONFIG", + 2: "CONFIG_UPDATE", + 3: "ENDORSER_TRANSACTION", + 4: "ORDERER_TRANSACTION", + 5: "DELIVER_SEEK_INFO", + 6: "CHAINCODE_PACKAGE", + 8: "PEER_ADMIN_OPERATION", + 9: "TOKEN_TRANSACTION", +} +var HeaderType_value = map[string]int32{ + "MESSAGE": 0, + "CONFIG": 1, + "CONFIG_UPDATE": 2, + "ENDORSER_TRANSACTION": 3, + "ORDERER_TRANSACTION": 4, + "DELIVER_SEEK_INFO": 5, + "CHAINCODE_PACKAGE": 6, + "PEER_ADMIN_OPERATION": 8, + "TOKEN_TRANSACTION": 9, +} + +func (x HeaderType) String() string { + return proto.EnumName(HeaderType_name, int32(x)) +} +func (HeaderType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_common_b374fafc5e1c956e, []int{1} +} + +// This enum enlists indexes of the block metadata array +type BlockMetadataIndex int32 + +const ( + BlockMetadataIndex_SIGNATURES BlockMetadataIndex = 0 + BlockMetadataIndex_LAST_CONFIG BlockMetadataIndex = 1 + BlockMetadataIndex_TRANSACTIONS_FILTER BlockMetadataIndex = 2 + BlockMetadataIndex_ORDERER BlockMetadataIndex = 3 +) + +var BlockMetadataIndex_name = map[int32]string{ + 0: "SIGNATURES", + 1: "LAST_CONFIG", + 2: "TRANSACTIONS_FILTER", + 3: "ORDERER", +} +var BlockMetadataIndex_value = map[string]int32{ + "SIGNATURES": 0, + "LAST_CONFIG": 1, + "TRANSACTIONS_FILTER": 2, + "ORDERER": 3, +} + +func (x BlockMetadataIndex) String() string { + return proto.EnumName(BlockMetadataIndex_name, int32(x)) +} +func (BlockMetadataIndex) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_common_b374fafc5e1c956e, []int{2} +} + +// LastConfig is the encoded value for the Metadata message which is encoded in the LAST_CONFIGURATION block metadata index +type LastConfig struct { + Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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} +} +func (m *LastConfig) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LastConfig.Unmarshal(m, b) +} +func (m *LastConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LastConfig.Marshal(b, m, deterministic) +} +func (dst *LastConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_LastConfig.Merge(dst, src) +} +func (m *LastConfig) XXX_Size() int { + return xxx_messageInfo_LastConfig.Size(m) +} +func (m *LastConfig) XXX_DiscardUnknown() { + xxx_messageInfo_LastConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_LastConfig proto.InternalMessageInfo + +func (m *LastConfig) GetIndex() uint64 { + if m != nil { + return m.Index + } + return 0 +} + +// Metadata is a common structure to be used to encode block metadata +type Metadata struct { + Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + Signatures []*MetadataSignature `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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} +} +func (m *Metadata) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Metadata.Unmarshal(m, b) +} +func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Metadata.Marshal(b, m, deterministic) +} +func (dst *Metadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_Metadata.Merge(dst, src) +} +func (m *Metadata) XXX_Size() int { + return xxx_messageInfo_Metadata.Size(m) +} +func (m *Metadata) XXX_DiscardUnknown() { + xxx_messageInfo_Metadata.DiscardUnknown(m) +} + +var xxx_messageInfo_Metadata proto.InternalMessageInfo + +func (m *Metadata) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +func (m *Metadata) GetSignatures() []*MetadataSignature { + if m != nil { + return m.Signatures + } + return nil +} + +type MetadataSignature struct { + SignatureHeader []byte `protobuf:"bytes,1,opt,name=signature_header,json=signatureHeader,proto3" json:"signature_header,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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} +} +func (m *MetadataSignature) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MetadataSignature.Unmarshal(m, b) +} +func (m *MetadataSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MetadataSignature.Marshal(b, m, deterministic) +} +func (dst *MetadataSignature) XXX_Merge(src proto.Message) { + xxx_messageInfo_MetadataSignature.Merge(dst, src) +} +func (m *MetadataSignature) XXX_Size() int { + return xxx_messageInfo_MetadataSignature.Size(m) +} +func (m *MetadataSignature) XXX_DiscardUnknown() { + xxx_messageInfo_MetadataSignature.DiscardUnknown(m) +} + +var xxx_messageInfo_MetadataSignature proto.InternalMessageInfo + +func (m *MetadataSignature) GetSignatureHeader() []byte { + if m != nil { + return m.SignatureHeader + } + return nil +} + +func (m *MetadataSignature) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +type Header struct { + ChannelHeader []byte `protobuf:"bytes,1,opt,name=channel_header,json=channelHeader,proto3" json:"channel_header,omitempty"` + SignatureHeader []byte `protobuf:"bytes,2,opt,name=signature_header,json=signatureHeader,proto3" json:"signature_header,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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} +} +func (m *Header) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Header.Unmarshal(m, b) +} +func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Header.Marshal(b, m, deterministic) +} +func (dst *Header) XXX_Merge(src proto.Message) { + xxx_messageInfo_Header.Merge(dst, src) +} +func (m *Header) XXX_Size() int { + return xxx_messageInfo_Header.Size(m) +} +func (m *Header) XXX_DiscardUnknown() { + xxx_messageInfo_Header.DiscardUnknown(m) +} + +var xxx_messageInfo_Header proto.InternalMessageInfo + +func (m *Header) GetChannelHeader() []byte { + if m != nil { + return m.ChannelHeader + } + return nil +} + +func (m *Header) GetSignatureHeader() []byte { + if m != nil { + return m.SignatureHeader + } + return nil +} + +// Header is a generic replay prevention and identity message to include in a signed payload +type ChannelHeader struct { + Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` + // Version indicates message protocol version + Version int32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + // Timestamp is the local time when the message was created + // by the sender + Timestamp *timestamp.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // Identifier of the channel this message is bound for + ChannelId string `protobuf:"bytes,4,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + // An unique identifier that is used end-to-end. + // - set by higher layers such as end user or SDK + // - passed to the endorser (which will check for uniqueness) + // - as the header is passed along unchanged, it will be + // be retrieved by the committer (uniqueness check here as well) + // - to be stored in the ledger + TxId string `protobuf:"bytes,5,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` + // The epoch in which this header was generated, where epoch is defined based on block height + // Epoch in which the response has been generated. This field identifies a + // logical window of time. A proposal response is accepted by a peer only if + // two conditions hold: + // 1. the epoch specified in the message is the current epoch + // 2. this message has been only seen once during this epoch (i.e. it hasn't + // been replayed) + Epoch uint64 `protobuf:"varint,6,opt,name=epoch,proto3" json:"epoch,omitempty"` + // Extension that may be attached based on the header type + Extension []byte `protobuf:"bytes,7,opt,name=extension,proto3" json:"extension,omitempty"` + // If mutual TLS is employed, this represents + // the hash of the client's TLS certificate + TlsCertHash []byte `protobuf:"bytes,8,opt,name=tls_cert_hash,json=tlsCertHash,proto3" json:"tls_cert_hash,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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} +} +func (m *ChannelHeader) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ChannelHeader.Unmarshal(m, b) +} +func (m *ChannelHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ChannelHeader.Marshal(b, m, deterministic) +} +func (dst *ChannelHeader) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChannelHeader.Merge(dst, src) +} +func (m *ChannelHeader) XXX_Size() int { + return xxx_messageInfo_ChannelHeader.Size(m) +} +func (m *ChannelHeader) XXX_DiscardUnknown() { + xxx_messageInfo_ChannelHeader.DiscardUnknown(m) +} + +var xxx_messageInfo_ChannelHeader proto.InternalMessageInfo + +func (m *ChannelHeader) GetType() int32 { + if m != nil { + return m.Type + } + return 0 +} + +func (m *ChannelHeader) GetVersion() int32 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *ChannelHeader) GetTimestamp() *timestamp.Timestamp { + if m != nil { + return m.Timestamp + } + return nil +} + +func (m *ChannelHeader) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +func (m *ChannelHeader) GetTxId() string { + if m != nil { + return m.TxId + } + return "" +} + +func (m *ChannelHeader) GetEpoch() uint64 { + if m != nil { + return m.Epoch + } + return 0 +} + +func (m *ChannelHeader) GetExtension() []byte { + if m != nil { + return m.Extension + } + return nil +} + +func (m *ChannelHeader) GetTlsCertHash() []byte { + if m != nil { + return m.TlsCertHash + } + return nil +} + +type SignatureHeader struct { + // Creator of the message, a marshaled msp.SerializedIdentity + Creator []byte `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + // Arbitrary number that may only be used once. Can be used to detect replay attacks. + Nonce []byte `protobuf:"bytes,2,opt,name=nonce,proto3" json:"nonce,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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} +} +func (m *SignatureHeader) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignatureHeader.Unmarshal(m, b) +} +func (m *SignatureHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignatureHeader.Marshal(b, m, deterministic) +} +func (dst *SignatureHeader) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignatureHeader.Merge(dst, src) +} +func (m *SignatureHeader) XXX_Size() int { + return xxx_messageInfo_SignatureHeader.Size(m) +} +func (m *SignatureHeader) XXX_DiscardUnknown() { + xxx_messageInfo_SignatureHeader.DiscardUnknown(m) +} + +var xxx_messageInfo_SignatureHeader proto.InternalMessageInfo + +func (m *SignatureHeader) GetCreator() []byte { + if m != nil { + return m.Creator + } + return nil +} + +func (m *SignatureHeader) GetNonce() []byte { + if m != nil { + return m.Nonce + } + return nil +} + +// Payload is the message contents (and header to allow for signing) +type Payload struct { + // Header is included to provide identity and prevent replay + Header *Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // Data, the encoding of which is defined by the type in the header + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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} +} +func (m *Payload) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Payload.Unmarshal(m, b) +} +func (m *Payload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Payload.Marshal(b, m, deterministic) +} +func (dst *Payload) XXX_Merge(src proto.Message) { + xxx_messageInfo_Payload.Merge(dst, src) +} +func (m *Payload) XXX_Size() int { + return xxx_messageInfo_Payload.Size(m) +} +func (m *Payload) XXX_DiscardUnknown() { + xxx_messageInfo_Payload.DiscardUnknown(m) +} + +var xxx_messageInfo_Payload proto.InternalMessageInfo + +func (m *Payload) GetHeader() *Header { + if m != nil { + return m.Header + } + return nil +} + +func (m *Payload) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +// Envelope wraps a Payload with a signature so that the message may be authenticated +type Envelope struct { + // A marshaled Payload + Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + // A signature by the creator specified in the Payload header + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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} +} +func (m *Envelope) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Envelope.Unmarshal(m, b) +} +func (m *Envelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Envelope.Marshal(b, m, deterministic) +} +func (dst *Envelope) XXX_Merge(src proto.Message) { + xxx_messageInfo_Envelope.Merge(dst, src) +} +func (m *Envelope) XXX_Size() int { + return xxx_messageInfo_Envelope.Size(m) +} +func (m *Envelope) XXX_DiscardUnknown() { + xxx_messageInfo_Envelope.DiscardUnknown(m) +} + +var xxx_messageInfo_Envelope proto.InternalMessageInfo + +func (m *Envelope) GetPayload() []byte { + if m != nil { + return m.Payload + } + return nil +} + +func (m *Envelope) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +// This is finalized block structure to be shared among the orderer and peer +// Note that the BlockHeader chains to the previous BlockHeader, and the BlockData hash is embedded +// in the BlockHeader. This makes it natural and obvious that the Data is included in the hash, but +// the Metadata is not. +type Block struct { + Header *BlockHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Data *BlockData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Metadata *BlockMetadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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} +} +func (m *Block) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Block.Unmarshal(m, b) +} +func (m *Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Block.Marshal(b, m, deterministic) +} +func (dst *Block) XXX_Merge(src proto.Message) { + xxx_messageInfo_Block.Merge(dst, src) +} +func (m *Block) XXX_Size() int { + return xxx_messageInfo_Block.Size(m) +} +func (m *Block) XXX_DiscardUnknown() { + xxx_messageInfo_Block.DiscardUnknown(m) +} + +var xxx_messageInfo_Block proto.InternalMessageInfo + +func (m *Block) GetHeader() *BlockHeader { + if m != nil { + return m.Header + } + return nil +} + +func (m *Block) GetData() *BlockData { + if m != nil { + return m.Data + } + return nil +} + +func (m *Block) GetMetadata() *BlockMetadata { + if m != nil { + return m.Metadata + } + return nil +} + +// BlockHeader is the element of the block which forms the block chain +// The block header is hashed using the configured chain hashing algorithm +// over the ASN.1 encoding of the BlockHeader +type BlockHeader struct { + Number uint64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` + PreviousHash []byte `protobuf:"bytes,2,opt,name=previous_hash,json=previousHash,proto3" json:"previous_hash,omitempty"` + DataHash []byte `protobuf:"bytes,3,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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} +} +func (m *BlockHeader) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BlockHeader.Unmarshal(m, b) +} +func (m *BlockHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BlockHeader.Marshal(b, m, deterministic) +} +func (dst *BlockHeader) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockHeader.Merge(dst, src) +} +func (m *BlockHeader) XXX_Size() int { + return xxx_messageInfo_BlockHeader.Size(m) +} +func (m *BlockHeader) XXX_DiscardUnknown() { + xxx_messageInfo_BlockHeader.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockHeader proto.InternalMessageInfo + +func (m *BlockHeader) GetNumber() uint64 { + if m != nil { + return m.Number + } + return 0 +} + +func (m *BlockHeader) GetPreviousHash() []byte { + if m != nil { + return m.PreviousHash + } + return nil +} + +func (m *BlockHeader) GetDataHash() []byte { + if m != nil { + return m.DataHash + } + return nil +} + +type BlockData struct { + Data [][]byte `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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} +} +func (m *BlockData) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BlockData.Unmarshal(m, b) +} +func (m *BlockData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BlockData.Marshal(b, m, deterministic) +} +func (dst *BlockData) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockData.Merge(dst, src) +} +func (m *BlockData) XXX_Size() int { + return xxx_messageInfo_BlockData.Size(m) +} +func (m *BlockData) XXX_DiscardUnknown() { + xxx_messageInfo_BlockData.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockData proto.InternalMessageInfo + +func (m *BlockData) GetData() [][]byte { + if m != nil { + return m.Data + } + return nil +} + +type BlockMetadata struct { + Metadata [][]byte `protobuf:"bytes,1,rep,name=metadata,proto3" json:"metadata,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_common_b374fafc5e1c956e, []int{11} +} +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) GetMetadata() [][]byte { + if m != nil { + return m.Metadata + } + return nil +} + +func init() { + proto.RegisterType((*LastConfig)(nil), "sdk.common.LastConfig") + proto.RegisterType((*Metadata)(nil), "sdk.common.Metadata") + proto.RegisterType((*MetadataSignature)(nil), "sdk.common.MetadataSignature") + proto.RegisterType((*Header)(nil), "sdk.common.Header") + proto.RegisterType((*ChannelHeader)(nil), "sdk.common.ChannelHeader") + proto.RegisterType((*SignatureHeader)(nil), "sdk.common.SignatureHeader") + proto.RegisterType((*Payload)(nil), "sdk.common.Payload") + proto.RegisterType((*Envelope)(nil), "sdk.common.Envelope") + proto.RegisterType((*Block)(nil), "sdk.common.Block") + proto.RegisterType((*BlockHeader)(nil), "sdk.common.BlockHeader") + proto.RegisterType((*BlockData)(nil), "sdk.common.BlockData") + proto.RegisterType((*BlockMetadata)(nil), "sdk.common.BlockMetadata") + proto.RegisterEnum("sdk.common.Status", Status_name, Status_value) + proto.RegisterEnum("sdk.common.HeaderType", HeaderType_name, HeaderType_value) + proto.RegisterEnum("sdk.common.BlockMetadataIndex", BlockMetadataIndex_name, BlockMetadataIndex_value) +} + +func init() { proto.RegisterFile("common/common.proto", fileDescriptor_common_b374fafc5e1c956e) } + +var fileDescriptor_common_b374fafc5e1c956e = []byte{ + // 959 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,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d, 0x68, 0xf5, 0x0d, 0xd7, 0xf3, 0x8b, 0xb3, 0x3d, 0x87, 0xce, 0x46, + 0x1d, 0xd7, 0xbf, 0xb4, 0xfb, 0x1e, 0xa6, 0x6a, 0x59, 0x4c, 0x23, 0x3b, 0x87, 0xaa, 0xf4, 0x5c, + 0xf8, 0x34, 0x8a, 0xa7, 0xdd, 0xd9, 0xe3, 0x8a, 0xc5, 0x0b, 0x36, 0x99, 0xb2, 0xb8, 0x7b, 0x17, + 0x8c, 0xe2, 0xf9, 0x58, 0xbe, 0xc6, 0x92, 0xec, 0x8e, 0xbf, 0x39, 0x9b, 0xce, 0xf9, 0x6c, 0x3d, + 0x12, 0xf0, 0x7c, 0x43, 0x7c, 0x2e, 0xc5, 0xf2, 0x1b, 0x95, 0x64, 0xdf, 0xb1, 0x51, 0x2d, 0x85, + 0x5f, 0xfe, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x63, 0x9b, 0x9f, 0x8b, 0xdf, 0x06, 0x00, 0x00, +} diff --git a/fabric/protos/common/configtx.pb.go b/fabric/protos/common/configtx.pb.go new file mode 100644 index 0000000..48ef16e --- /dev/null +++ b/fabric/protos/common/configtx.pb.go @@ -0,0 +1,668 @@ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: common/configtx.proto + +package common // import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/common" + +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 + +// ConfigEnvelope is designed to contain _all_ configuration for a chain with no dependency +// on previous configuration transactions. +// +// It is generated with the following scheme: +// 1. Retrieve the existing configuration +// 2. Note the config properties (ConfigValue, ConfigPolicy, ConfigGroup) to be modified +// 3. Add any intermediate ConfigGroups to the ConfigUpdate.read_set (sparsely) +// 4. Add any additional desired dependencies to ConfigUpdate.read_set (sparsely) +// 5. Modify the config properties, incrementing each version by 1, set them in the ConfigUpdate.write_set +// Note: any element not modified but specified should already be in the read_set, so may be specified sparsely +// 6. Create ConfigUpdate message and marshal it into ConfigUpdateEnvelope.update and encode the required signatures +// a) Each signature is of type ConfigSignature +// b) The ConfigSignature signature is over the concatenation of signature_header and the ConfigUpdate bytes (which includes a ChainHeader) +// 5. Submit new Config for ordering in Envelope signed by submitter +// a) The Envelope Payload has data set to the marshaled ConfigEnvelope +// b) The Envelope Payload has a header of type Header.Type.CONFIG_UPDATE +// +// The configuration manager will verify: +// 1. All items in the read_set exist at the read versions +// 2. All items in the write_set at a different version than, or not in, the read_set have been appropriately signed according to their mod_policy +// 3. The new configuration satisfies the ConfigSchema +type ConfigEnvelope struct { + Config *Config `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` + LastUpdate *Envelope `protobuf:"bytes,2,opt,name=last_update,json=lastUpdate,proto3" json:"last_update,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ConfigEnvelope) Reset() { *m = ConfigEnvelope{} } +func (m *ConfigEnvelope) String() string { return proto.CompactTextString(m) } +func (*ConfigEnvelope) ProtoMessage() {} +func (*ConfigEnvelope) Descriptor() ([]byte, []int) { + return fileDescriptor_configtx_f1e09584bdb3a224, []int{0} +} +func (m *ConfigEnvelope) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ConfigEnvelope.Unmarshal(m, b) +} +func (m *ConfigEnvelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ConfigEnvelope.Marshal(b, m, deterministic) +} +func (dst *ConfigEnvelope) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigEnvelope.Merge(dst, src) +} +func (m *ConfigEnvelope) XXX_Size() int { + return xxx_messageInfo_ConfigEnvelope.Size(m) +} +func (m *ConfigEnvelope) XXX_DiscardUnknown() { + xxx_messageInfo_ConfigEnvelope.DiscardUnknown(m) +} + +var xxx_messageInfo_ConfigEnvelope proto.InternalMessageInfo + +func (m *ConfigEnvelope) GetConfig() *Config { + if m != nil { + return m.Config + } + return nil +} + +func (m *ConfigEnvelope) GetLastUpdate() *Envelope { + if m != nil { + return m.LastUpdate + } + return nil +} + +type ConfigGroupSchema struct { + Groups map[string]*ConfigGroupSchema `protobuf:"bytes,1,rep,name=groups,proto3" json:"groups,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Values map[string]*ConfigValueSchema `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Policies map[string]*ConfigPolicySchema `protobuf:"bytes,3,rep,name=policies,proto3" json:"policies,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ConfigGroupSchema) Reset() { *m = ConfigGroupSchema{} } +func (m *ConfigGroupSchema) String() string { return proto.CompactTextString(m) } +func (*ConfigGroupSchema) ProtoMessage() {} +func (*ConfigGroupSchema) Descriptor() ([]byte, []int) { + return fileDescriptor_configtx_f1e09584bdb3a224, []int{1} +} +func (m *ConfigGroupSchema) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ConfigGroupSchema.Unmarshal(m, b) +} +func (m *ConfigGroupSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ConfigGroupSchema.Marshal(b, m, deterministic) +} +func (dst *ConfigGroupSchema) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigGroupSchema.Merge(dst, src) +} +func (m *ConfigGroupSchema) XXX_Size() int { + return xxx_messageInfo_ConfigGroupSchema.Size(m) +} +func (m *ConfigGroupSchema) XXX_DiscardUnknown() { + xxx_messageInfo_ConfigGroupSchema.DiscardUnknown(m) +} + +var xxx_messageInfo_ConfigGroupSchema proto.InternalMessageInfo + +func (m *ConfigGroupSchema) GetGroups() map[string]*ConfigGroupSchema { + if m != nil { + return m.Groups + } + return nil +} + +func (m *ConfigGroupSchema) GetValues() map[string]*ConfigValueSchema { + if m != nil { + return m.Values + } + return nil +} + +func (m *ConfigGroupSchema) GetPolicies() map[string]*ConfigPolicySchema { + if m != nil { + return m.Policies + } + return nil +} + +type ConfigValueSchema struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ConfigValueSchema) Reset() { *m = ConfigValueSchema{} } +func (m *ConfigValueSchema) String() string { return proto.CompactTextString(m) } +func (*ConfigValueSchema) ProtoMessage() {} +func (*ConfigValueSchema) Descriptor() ([]byte, []int) { + return fileDescriptor_configtx_f1e09584bdb3a224, []int{2} +} +func (m *ConfigValueSchema) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ConfigValueSchema.Unmarshal(m, b) +} +func (m *ConfigValueSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ConfigValueSchema.Marshal(b, m, deterministic) +} +func (dst *ConfigValueSchema) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigValueSchema.Merge(dst, src) +} +func (m *ConfigValueSchema) XXX_Size() int { + return xxx_messageInfo_ConfigValueSchema.Size(m) +} +func (m *ConfigValueSchema) XXX_DiscardUnknown() { + xxx_messageInfo_ConfigValueSchema.DiscardUnknown(m) +} + +var xxx_messageInfo_ConfigValueSchema proto.InternalMessageInfo + +type ConfigPolicySchema struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ConfigPolicySchema) Reset() { *m = ConfigPolicySchema{} } +func (m *ConfigPolicySchema) String() string { return proto.CompactTextString(m) } +func (*ConfigPolicySchema) ProtoMessage() {} +func (*ConfigPolicySchema) Descriptor() ([]byte, []int) { + return fileDescriptor_configtx_f1e09584bdb3a224, []int{3} +} +func (m *ConfigPolicySchema) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ConfigPolicySchema.Unmarshal(m, b) +} +func (m *ConfigPolicySchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ConfigPolicySchema.Marshal(b, m, deterministic) +} +func (dst *ConfigPolicySchema) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigPolicySchema.Merge(dst, src) +} +func (m *ConfigPolicySchema) XXX_Size() int { + return xxx_messageInfo_ConfigPolicySchema.Size(m) +} +func (m *ConfigPolicySchema) XXX_DiscardUnknown() { + xxx_messageInfo_ConfigPolicySchema.DiscardUnknown(m) +} + +var xxx_messageInfo_ConfigPolicySchema proto.InternalMessageInfo + +// Config represents the config for a particular channel +type Config struct { + Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` + ChannelGroup *ConfigGroup `protobuf:"bytes,2,opt,name=channel_group,json=channelGroup,proto3" json:"channel_group,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Config) Reset() { *m = Config{} } +func (m *Config) String() string { return proto.CompactTextString(m) } +func (*Config) ProtoMessage() {} +func (*Config) Descriptor() ([]byte, []int) { + return fileDescriptor_configtx_f1e09584bdb3a224, []int{4} +} +func (m *Config) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Config.Unmarshal(m, b) +} +func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Config.Marshal(b, m, deterministic) +} +func (dst *Config) XXX_Merge(src proto.Message) { + xxx_messageInfo_Config.Merge(dst, src) +} +func (m *Config) XXX_Size() int { + return xxx_messageInfo_Config.Size(m) +} +func (m *Config) XXX_DiscardUnknown() { + xxx_messageInfo_Config.DiscardUnknown(m) +} + +var xxx_messageInfo_Config proto.InternalMessageInfo + +func (m *Config) GetSequence() uint64 { + if m != nil { + return m.Sequence + } + return 0 +} + +func (m *Config) GetChannelGroup() *ConfigGroup { + if m != nil { + return m.ChannelGroup + } + return nil +} + +type ConfigUpdateEnvelope struct { + ConfigUpdate []byte `protobuf:"bytes,1,opt,name=config_update,json=configUpdate,proto3" json:"config_update,omitempty"` + Signatures []*ConfigSignature `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ConfigUpdateEnvelope) Reset() { *m = ConfigUpdateEnvelope{} } +func (m *ConfigUpdateEnvelope) String() string { return proto.CompactTextString(m) } +func (*ConfigUpdateEnvelope) ProtoMessage() {} +func (*ConfigUpdateEnvelope) Descriptor() ([]byte, []int) { + return fileDescriptor_configtx_f1e09584bdb3a224, []int{5} +} +func (m *ConfigUpdateEnvelope) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ConfigUpdateEnvelope.Unmarshal(m, b) +} +func (m *ConfigUpdateEnvelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ConfigUpdateEnvelope.Marshal(b, m, deterministic) +} +func (dst *ConfigUpdateEnvelope) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigUpdateEnvelope.Merge(dst, src) +} +func (m *ConfigUpdateEnvelope) XXX_Size() int { + return xxx_messageInfo_ConfigUpdateEnvelope.Size(m) +} +func (m *ConfigUpdateEnvelope) XXX_DiscardUnknown() { + xxx_messageInfo_ConfigUpdateEnvelope.DiscardUnknown(m) +} + +var xxx_messageInfo_ConfigUpdateEnvelope proto.InternalMessageInfo + +func (m *ConfigUpdateEnvelope) GetConfigUpdate() []byte { + if m != nil { + return m.ConfigUpdate + } + return nil +} + +func (m *ConfigUpdateEnvelope) GetSignatures() []*ConfigSignature { + if m != nil { + return m.Signatures + } + return nil +} + +// ConfigUpdate is used to submit a subset of config and to have the orderer apply to Config +// it is always submitted inside a ConfigUpdateEnvelope which allows the addition of signatures +// resulting in a new total configuration. The update is applied as follows: +// 1. The versions from all of the elements in the read_set is verified against the versions in the existing config. +// If there is a mismatch in the read versions, then the config update fails and is rejected. +// 2. Any elements in the write_set with the same version as the read_set are ignored. +// 3. The corresponding mod_policy for every remaining element in the write_set is collected. +// 4. Each policy is checked against the signatures from the ConfigUpdateEnvelope, any failing to verify are rejected +// 5. The write_set is applied to the Config and the ConfigGroupSchema verifies that the updates were legal +type ConfigUpdate struct { + ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + ReadSet *ConfigGroup `protobuf:"bytes,2,opt,name=read_set,json=readSet,proto3" json:"read_set,omitempty"` + WriteSet *ConfigGroup `protobuf:"bytes,3,opt,name=write_set,json=writeSet,proto3" json:"write_set,omitempty"` + IsolatedData map[string][]byte `protobuf:"bytes,5,rep,name=isolated_data,json=isolatedData,proto3" json:"isolated_data,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ConfigUpdate) Reset() { *m = ConfigUpdate{} } +func (m *ConfigUpdate) String() string { return proto.CompactTextString(m) } +func (*ConfigUpdate) ProtoMessage() {} +func (*ConfigUpdate) Descriptor() ([]byte, []int) { + return fileDescriptor_configtx_f1e09584bdb3a224, []int{6} +} +func (m *ConfigUpdate) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ConfigUpdate.Unmarshal(m, b) +} +func (m *ConfigUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ConfigUpdate.Marshal(b, m, deterministic) +} +func (dst *ConfigUpdate) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigUpdate.Merge(dst, src) +} +func (m *ConfigUpdate) XXX_Size() int { + return xxx_messageInfo_ConfigUpdate.Size(m) +} +func (m *ConfigUpdate) XXX_DiscardUnknown() { + xxx_messageInfo_ConfigUpdate.DiscardUnknown(m) +} + +var xxx_messageInfo_ConfigUpdate proto.InternalMessageInfo + +func (m *ConfigUpdate) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +func (m *ConfigUpdate) GetReadSet() *ConfigGroup { + if m != nil { + return m.ReadSet + } + return nil +} + +func (m *ConfigUpdate) GetWriteSet() *ConfigGroup { + if m != nil { + return m.WriteSet + } + return nil +} + +func (m *ConfigUpdate) GetIsolatedData() map[string][]byte { + if m != nil { + return m.IsolatedData + } + return nil +} + +// ConfigGroup is the hierarchical data structure for holding config +type ConfigGroup struct { + Version uint64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + Groups map[string]*ConfigGroup `protobuf:"bytes,2,rep,name=groups,proto3" json:"groups,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Values map[string]*ConfigValue `protobuf:"bytes,3,rep,name=values,proto3" json:"values,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Policies map[string]*ConfigPolicy `protobuf:"bytes,4,rep,name=policies,proto3" json:"policies,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + ModPolicy string `protobuf:"bytes,5,opt,name=mod_policy,json=modPolicy,proto3" json:"mod_policy,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ConfigGroup) Reset() { *m = ConfigGroup{} } +func (m *ConfigGroup) String() string { return proto.CompactTextString(m) } +func (*ConfigGroup) ProtoMessage() {} +func (*ConfigGroup) Descriptor() ([]byte, []int) { + return fileDescriptor_configtx_f1e09584bdb3a224, []int{7} +} +func (m *ConfigGroup) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ConfigGroup.Unmarshal(m, b) +} +func (m *ConfigGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ConfigGroup.Marshal(b, m, deterministic) +} +func (dst *ConfigGroup) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigGroup.Merge(dst, src) +} +func (m *ConfigGroup) XXX_Size() int { + return xxx_messageInfo_ConfigGroup.Size(m) +} +func (m *ConfigGroup) XXX_DiscardUnknown() { + xxx_messageInfo_ConfigGroup.DiscardUnknown(m) +} + +var xxx_messageInfo_ConfigGroup proto.InternalMessageInfo + +func (m *ConfigGroup) GetVersion() uint64 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *ConfigGroup) GetGroups() map[string]*ConfigGroup { + if m != nil { + return m.Groups + } + return nil +} + +func (m *ConfigGroup) GetValues() map[string]*ConfigValue { + if m != nil { + return m.Values + } + return nil +} + +func (m *ConfigGroup) GetPolicies() map[string]*ConfigPolicy { + if m != nil { + return m.Policies + } + return nil +} + +func (m *ConfigGroup) GetModPolicy() string { + if m != nil { + return m.ModPolicy + } + return "" +} + +// ConfigValue represents an individual piece of config data +type ConfigValue struct { + Version uint64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + ModPolicy string `protobuf:"bytes,3,opt,name=mod_policy,json=modPolicy,proto3" json:"mod_policy,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ConfigValue) Reset() { *m = ConfigValue{} } +func (m *ConfigValue) String() string { return proto.CompactTextString(m) } +func (*ConfigValue) ProtoMessage() {} +func (*ConfigValue) Descriptor() ([]byte, []int) { + return fileDescriptor_configtx_f1e09584bdb3a224, []int{8} +} +func (m *ConfigValue) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ConfigValue.Unmarshal(m, b) +} +func (m *ConfigValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ConfigValue.Marshal(b, m, deterministic) +} +func (dst *ConfigValue) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigValue.Merge(dst, src) +} +func (m *ConfigValue) XXX_Size() int { + return xxx_messageInfo_ConfigValue.Size(m) +} +func (m *ConfigValue) XXX_DiscardUnknown() { + xxx_messageInfo_ConfigValue.DiscardUnknown(m) +} + +var xxx_messageInfo_ConfigValue proto.InternalMessageInfo + +func (m *ConfigValue) GetVersion() uint64 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *ConfigValue) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +func (m *ConfigValue) GetModPolicy() string { + if m != nil { + return m.ModPolicy + } + return "" +} + +type ConfigPolicy struct { + Version uint64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + Policy *Policy `protobuf:"bytes,2,opt,name=policy,proto3" json:"policy,omitempty"` + ModPolicy string `protobuf:"bytes,3,opt,name=mod_policy,json=modPolicy,proto3" json:"mod_policy,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ConfigPolicy) Reset() { *m = ConfigPolicy{} } +func (m *ConfigPolicy) String() string { return proto.CompactTextString(m) } +func (*ConfigPolicy) ProtoMessage() {} +func (*ConfigPolicy) Descriptor() ([]byte, []int) { + return fileDescriptor_configtx_f1e09584bdb3a224, []int{9} +} +func (m *ConfigPolicy) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ConfigPolicy.Unmarshal(m, b) +} +func (m *ConfigPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ConfigPolicy.Marshal(b, m, deterministic) +} +func (dst *ConfigPolicy) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigPolicy.Merge(dst, src) +} +func (m *ConfigPolicy) XXX_Size() int { + return xxx_messageInfo_ConfigPolicy.Size(m) +} +func (m *ConfigPolicy) XXX_DiscardUnknown() { + xxx_messageInfo_ConfigPolicy.DiscardUnknown(m) +} + +var xxx_messageInfo_ConfigPolicy proto.InternalMessageInfo + +func (m *ConfigPolicy) GetVersion() uint64 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *ConfigPolicy) GetPolicy() *Policy { + if m != nil { + return m.Policy + } + return nil +} + +func (m *ConfigPolicy) GetModPolicy() string { + if m != nil { + return m.ModPolicy + } + return "" +} + +type ConfigSignature struct { + SignatureHeader []byte `protobuf:"bytes,1,opt,name=signature_header,json=signatureHeader,proto3" json:"signature_header,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ConfigSignature) Reset() { *m = ConfigSignature{} } +func (m *ConfigSignature) String() string { return proto.CompactTextString(m) } +func (*ConfigSignature) ProtoMessage() {} +func (*ConfigSignature) Descriptor() ([]byte, []int) { + return fileDescriptor_configtx_f1e09584bdb3a224, []int{10} +} +func (m *ConfigSignature) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ConfigSignature.Unmarshal(m, b) +} +func (m *ConfigSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ConfigSignature.Marshal(b, m, deterministic) +} +func (dst *ConfigSignature) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigSignature.Merge(dst, src) +} +func (m *ConfigSignature) XXX_Size() int { + return xxx_messageInfo_ConfigSignature.Size(m) +} +func (m *ConfigSignature) XXX_DiscardUnknown() { + xxx_messageInfo_ConfigSignature.DiscardUnknown(m) +} + +var xxx_messageInfo_ConfigSignature proto.InternalMessageInfo + +func (m *ConfigSignature) GetSignatureHeader() []byte { + if m != nil { + return m.SignatureHeader + } + return nil +} + +func (m *ConfigSignature) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +func init() { + proto.RegisterType((*ConfigEnvelope)(nil), "sdk.common.ConfigEnvelope") + proto.RegisterType((*ConfigGroupSchema)(nil), "sdk.common.ConfigGroupSchema") + proto.RegisterMapType((map[string]*ConfigGroupSchema)(nil), "sdk.common.ConfigGroupSchema.GroupsEntry") + proto.RegisterMapType((map[string]*ConfigPolicySchema)(nil), "sdk.common.ConfigGroupSchema.PoliciesEntry") + proto.RegisterMapType((map[string]*ConfigValueSchema)(nil), "sdk.common.ConfigGroupSchema.ValuesEntry") + proto.RegisterType((*ConfigValueSchema)(nil), "sdk.common.ConfigValueSchema") + proto.RegisterType((*ConfigPolicySchema)(nil), "sdk.common.ConfigPolicySchema") + proto.RegisterType((*Config)(nil), "sdk.common.Config") + proto.RegisterType((*ConfigUpdateEnvelope)(nil), "sdk.common.ConfigUpdateEnvelope") + proto.RegisterType((*ConfigUpdate)(nil), "sdk.common.ConfigUpdate") + proto.RegisterMapType((map[string][]byte)(nil), "sdk.common.ConfigUpdate.IsolatedDataEntry") + proto.RegisterType((*ConfigGroup)(nil), "sdk.common.ConfigGroup") + proto.RegisterMapType((map[string]*ConfigGroup)(nil), "sdk.common.ConfigGroup.GroupsEntry") + proto.RegisterMapType((map[string]*ConfigPolicy)(nil), "sdk.common.ConfigGroup.PoliciesEntry") + proto.RegisterMapType((map[string]*ConfigValue)(nil), "sdk.common.ConfigGroup.ValuesEntry") + proto.RegisterType((*ConfigValue)(nil), "sdk.common.ConfigValue") + proto.RegisterType((*ConfigPolicy)(nil), "sdk.common.ConfigPolicy") + proto.RegisterType((*ConfigSignature)(nil), "sdk.common.ConfigSignature") +} + +func init() { proto.RegisterFile("common/configtx.proto", fileDescriptor_configtx_f1e09584bdb3a224) } + +var fileDescriptor_configtx_f1e09584bdb3a224 = []byte{ + // 742 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0x6f, 0x6f, 0xd3, 0x3e, + 0x10, 0x56, 0x9b, 0xb6, 0x6b, 0xaf, 0xed, 0xd6, 0x79, 0xfd, 0xe9, 0x17, 0x22, 0x10, 0x23, 0xc0, + 0xd8, 0x40, 0x4a, 0xc7, 0x78, 0xb1, 0x09, 0x69, 0x42, 0x62, 0x4c, 0xb0, 0x21, 0x4d, 0x90, 0xf2, + 0x47, 0x9a, 0x90, 0x2a, 0x2f, 0xf1, 0xda, 0xb0, 0x34, 0x0e, 0x89, 0x3b, 0xe8, 0x47, 0xe2, 0x33, + 0xf1, 0x0d, 0xf8, 0x14, 0x28, 0xb6, 0x13, 0x9c, 0x35, 0x6d, 0xc5, 0xab, 0xf5, 0xce, 0xcf, 0xf3, + 0xdc, 0xf9, 0xee, 0x7c, 0x19, 0xfc, 0xe7, 0xd0, 0xf1, 0x98, 0x06, 0x3d, 0x87, 0x06, 0x97, 0xde, + 0x90, 0xfd, 0xb0, 0xc2, 0x88, 0x32, 0x8a, 0x6a, 0xc2, 0x6d, 0x6c, 0x64, 0xc7, 0xc9, 0x1f, 0x71, + 0x68, 0xa4, 0x9c, 0x90, 0xfa, 0x9e, 0xe3, 0x91, 0x58, 0xb8, 0xcd, 0x2b, 0x58, 0x3d, 0xe2, 0x2a, + 0xc7, 0xc1, 0x35, 0xf1, 0x69, 0x48, 0xd0, 0x16, 0xd4, 0x84, 0xae, 0x5e, 0xda, 0x2c, 0x6d, 0x37, + 0xf7, 0x56, 0x2d, 0xa9, 0x23, 0x70, 0xb6, 0x3c, 0x45, 0x4f, 0xa1, 0xe9, 0xe3, 0x98, 0x0d, 0x26, + 0xa1, 0x8b, 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, 0x01, 0xef, 0xb5, 0x4c, 0x67, 0xa3, + 0xa0, 0x78, 0x76, 0x4b, 0x22, 0xb9, 0x75, 0x5a, 0xa9, 0x6b, 0x9d, 0x8a, 0x5d, 0x61, 0xd3, 0x90, + 0x98, 0x0c, 0xba, 0x02, 0x28, 0x86, 0x30, 0x9b, 0xf3, 0xfb, 0xd0, 0x16, 0x93, 0x9c, 0x4e, 0x70, + 0x12, 0xbe, 0x65, 0xb7, 0x1c, 0x05, 0x8c, 0xf6, 0x01, 0x62, 0x6f, 0x18, 0x60, 0x36, 0x89, 0xb2, + 0x01, 0xfb, 0x3f, 0x1f, 0xbf, 0x9f, 0x9e, 0xdb, 0x0a, 0xd4, 0xfc, 0x59, 0x86, 0x96, 0x1a, 0x16, + 0xdd, 0x01, 0x48, 0x2f, 0xe3, 0xb9, 0xb2, 0xd8, 0x0d, 0xe9, 0x39, 0x71, 0x91, 0x05, 0xf5, 0x88, + 0x60, 0x77, 0x10, 0x13, 0xb6, 0xe8, 0x9a, 0x2b, 0x09, 0xa8, 0x4f, 0x18, 0xda, 0x85, 0xc6, 0xf7, + 0xc8, 0x63, 0x84, 0x13, 0xb4, 0xf9, 0x84, 0x3a, 0x47, 0x25, 0x8c, 0xb7, 0xd0, 0xf6, 0x62, 0xea, + 0x63, 0x46, 0xdc, 0x81, 0x8b, 0x19, 0xd6, 0xab, 0xfc, 0x36, 0x5b, 0x79, 0x96, 0xc8, 0xd6, 0x3a, + 0x91, 0xc8, 0x57, 0x98, 0x61, 0x31, 0xec, 0x2d, 0x4f, 0x71, 0x19, 0x2f, 0x60, 0x7d, 0x06, 0x52, + 0x30, 0x48, 0x5d, 0x75, 0x90, 0x5a, 0xca, 0xb0, 0x9c, 0x56, 0xea, 0x95, 0x4e, 0x55, 0x76, 0xe8, + 0xb7, 0x06, 0x4d, 0x25, 0x67, 0xa4, 0xc3, 0xca, 0x35, 0x89, 0x62, 0x8f, 0x06, 0x72, 0x24, 0x52, + 0x13, 0xed, 0x67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 0xb9, 0x48, 0xcc, 0x9e, 0x02, 0xee, 0x09, 0x70, 0x4f, + 0x80, 0xe5, 0x7f, 0x03, 0x17, 0x35, 0x6e, 0x3e, 0xfb, 0x13, 0x00, 0x00, 0xff, 0xff, 0xa8, 0xa5, + 0xb6, 0x86, 0x44, 0x08, 0x00, 0x00, +} diff --git a/fabric/protos/common/configuration.pb.go b/fabric/protos/common/configuration.pb.go new file mode 100644 index 0000000..afa9cf2 --- /dev/null +++ b/fabric/protos/common/configuration.pb.go @@ -0,0 +1,325 @@ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: common/configuration.proto + +package common // import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/common" + +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 + +// HashingAlgorithm is encoded into the configuration transaction as a configuration item of type Chain +// with a Key of "HashingAlgorithm" and a Value of HashingAlgorithm as marshaled protobuf bytes +type HashingAlgorithm struct { + // Currently supported algorithms are: SHAKE256 + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *HashingAlgorithm) Reset() { *m = HashingAlgorithm{} } +func (m *HashingAlgorithm) String() string { return proto.CompactTextString(m) } +func (*HashingAlgorithm) ProtoMessage() {} +func (*HashingAlgorithm) Descriptor() ([]byte, []int) { + return fileDescriptor_configuration_c60fbe5ebb3de531, []int{0} +} +func (m *HashingAlgorithm) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_HashingAlgorithm.Unmarshal(m, b) +} +func (m *HashingAlgorithm) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_HashingAlgorithm.Marshal(b, m, deterministic) +} +func (dst *HashingAlgorithm) XXX_Merge(src proto.Message) { + xxx_messageInfo_HashingAlgorithm.Merge(dst, src) +} +func (m *HashingAlgorithm) XXX_Size() int { + return xxx_messageInfo_HashingAlgorithm.Size(m) +} +func (m *HashingAlgorithm) XXX_DiscardUnknown() { + xxx_messageInfo_HashingAlgorithm.DiscardUnknown(m) +} + +var xxx_messageInfo_HashingAlgorithm proto.InternalMessageInfo + +func (m *HashingAlgorithm) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// BlockDataHashingStructure is encoded into the configuration transaction as a configuration item of +// type Chain with a Key of "BlockDataHashingStructure" and a Value of HashingAlgorithm as marshaled protobuf bytes +type BlockDataHashingStructure struct { + // width specifies the width of the Merkle tree to use when computing the BlockDataHash + // in order to replicate flat hashing, set this width to MAX_UINT32 + Width uint32 `protobuf:"varint,1,opt,name=width,proto3" json:"width,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BlockDataHashingStructure) Reset() { *m = BlockDataHashingStructure{} } +func (m *BlockDataHashingStructure) String() string { return proto.CompactTextString(m) } +func (*BlockDataHashingStructure) ProtoMessage() {} +func (*BlockDataHashingStructure) Descriptor() ([]byte, []int) { + return fileDescriptor_configuration_c60fbe5ebb3de531, []int{1} +} +func (m *BlockDataHashingStructure) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BlockDataHashingStructure.Unmarshal(m, b) +} +func (m *BlockDataHashingStructure) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BlockDataHashingStructure.Marshal(b, m, deterministic) +} +func (dst *BlockDataHashingStructure) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockDataHashingStructure.Merge(dst, src) +} +func (m *BlockDataHashingStructure) XXX_Size() int { + return xxx_messageInfo_BlockDataHashingStructure.Size(m) +} +func (m *BlockDataHashingStructure) XXX_DiscardUnknown() { + xxx_messageInfo_BlockDataHashingStructure.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockDataHashingStructure proto.InternalMessageInfo + +func (m *BlockDataHashingStructure) GetWidth() uint32 { + if m != nil { + return m.Width + } + return 0 +} + +// OrdererAddresses is encoded into the configuration transaction as a configuration item of type Chain +// with a Key of "OrdererAddresses" and a Value of OrdererAddresses as marshaled protobuf bytes +type OrdererAddresses struct { + Addresses []string `protobuf:"bytes,1,rep,name=addresses,proto3" json:"addresses,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *OrdererAddresses) Reset() { *m = OrdererAddresses{} } +func (m *OrdererAddresses) String() string { return proto.CompactTextString(m) } +func (*OrdererAddresses) ProtoMessage() {} +func (*OrdererAddresses) Descriptor() ([]byte, []int) { + return fileDescriptor_configuration_c60fbe5ebb3de531, []int{2} +} +func (m *OrdererAddresses) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_OrdererAddresses.Unmarshal(m, b) +} +func (m *OrdererAddresses) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_OrdererAddresses.Marshal(b, m, deterministic) +} +func (dst *OrdererAddresses) XXX_Merge(src proto.Message) { + xxx_messageInfo_OrdererAddresses.Merge(dst, src) +} +func (m *OrdererAddresses) XXX_Size() int { + return xxx_messageInfo_OrdererAddresses.Size(m) +} +func (m *OrdererAddresses) XXX_DiscardUnknown() { + xxx_messageInfo_OrdererAddresses.DiscardUnknown(m) +} + +var xxx_messageInfo_OrdererAddresses proto.InternalMessageInfo + +func (m *OrdererAddresses) GetAddresses() []string { + if m != nil { + return m.Addresses + } + return nil +} + +// Consortium represents the consortium context in which the channel was created +type Consortium struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Consortium) Reset() { *m = Consortium{} } +func (m *Consortium) String() string { return proto.CompactTextString(m) } +func (*Consortium) ProtoMessage() {} +func (*Consortium) Descriptor() ([]byte, []int) { + return fileDescriptor_configuration_c60fbe5ebb3de531, []int{3} +} +func (m *Consortium) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Consortium.Unmarshal(m, b) +} +func (m *Consortium) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Consortium.Marshal(b, m, deterministic) +} +func (dst *Consortium) XXX_Merge(src proto.Message) { + xxx_messageInfo_Consortium.Merge(dst, src) +} +func (m *Consortium) XXX_Size() int { + return xxx_messageInfo_Consortium.Size(m) +} +func (m *Consortium) XXX_DiscardUnknown() { + xxx_messageInfo_Consortium.DiscardUnknown(m) +} + +var xxx_messageInfo_Consortium proto.InternalMessageInfo + +func (m *Consortium) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Capabilities message defines the capabilities a particular binary must implement +// for that binary to be able to safely participate in the channel. The capabilities +// message is defined at the /Channel level, the /Channel/Application level, and the +// /Channel/Orderer level. +// +// The /Channel level capabilties define capabilities which both the orderer and peer +// binaries must satisfy. These capabilties might be things like a new MSP type, +// or a new policy type. +// +// The /Channel/Orderer level capabilties define capabilities which must be supported +// by the orderer, but which have no bearing on the behavior of the peer. For instance +// if the orderer changes the logic for how it constructs new channels, only all orderers +// must agree on the new logic. The peers do not need to be aware of this change as +// they only interact with the channel after it has been constructed. +// +// Finally, the /Channel/Application level capabilities define capabilities which the peer +// binary must satisfy, but which have no bearing on the orderer. For instance, if the +// peer adds a new UTXO transaction type, or changes the chaincode lifecycle requirements, +// all peers must agree on the new logic. However, orderers never inspect transactions +// this deeply, and therefore have no need to be aware of the change. +// +// The capabilities strings defined in these messages typically correspond to release +// binary versions (e.g. "V1.1"), and are used primarilly as a mechanism for a fully +// upgraded network to switch from one set of logic to a new one. +// +// Although for V1.1, the orderers must be upgraded to V1.1 prior to the rest of the +// network, going forward, because of the split between the /Channel, /Channel/Orderer +// and /Channel/Application capabilities. It should be possible for the orderer and +// application networks to upgrade themselves independently (with the exception of any +// new capabilities defined at the /Channel level). +type Capabilities struct { + Capabilities map[string]*Capability `protobuf:"bytes,1,rep,name=capabilities,proto3" json:"capabilities,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Capabilities) Reset() { *m = Capabilities{} } +func (m *Capabilities) String() string { return proto.CompactTextString(m) } +func (*Capabilities) ProtoMessage() {} +func (*Capabilities) Descriptor() ([]byte, []int) { + return fileDescriptor_configuration_c60fbe5ebb3de531, []int{4} +} +func (m *Capabilities) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Capabilities.Unmarshal(m, b) +} +func (m *Capabilities) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Capabilities.Marshal(b, m, deterministic) +} +func (dst *Capabilities) XXX_Merge(src proto.Message) { + xxx_messageInfo_Capabilities.Merge(dst, src) +} +func (m *Capabilities) XXX_Size() int { + return xxx_messageInfo_Capabilities.Size(m) +} +func (m *Capabilities) XXX_DiscardUnknown() { + xxx_messageInfo_Capabilities.DiscardUnknown(m) +} + +var xxx_messageInfo_Capabilities proto.InternalMessageInfo + +func (m *Capabilities) GetCapabilities() map[string]*Capability { + if m != nil { + return m.Capabilities + } + return nil +} + +// Capability is an empty message for the time being. It is defined as a protobuf +// message rather than a constant, so that we may extend capabilities with other fields +// if the need arises in the future. For the time being, a capability being in the +// capabilities map requires that that capability be supported. +type Capability struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Capability) Reset() { *m = Capability{} } +func (m *Capability) String() string { return proto.CompactTextString(m) } +func (*Capability) ProtoMessage() {} +func (*Capability) Descriptor() ([]byte, []int) { + return fileDescriptor_configuration_c60fbe5ebb3de531, []int{5} +} +func (m *Capability) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Capability.Unmarshal(m, b) +} +func (m *Capability) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Capability.Marshal(b, m, deterministic) +} +func (dst *Capability) XXX_Merge(src proto.Message) { + xxx_messageInfo_Capability.Merge(dst, src) +} +func (m *Capability) XXX_Size() int { + return xxx_messageInfo_Capability.Size(m) +} +func (m *Capability) XXX_DiscardUnknown() { + xxx_messageInfo_Capability.DiscardUnknown(m) +} + +var xxx_messageInfo_Capability proto.InternalMessageInfo + +func init() { + proto.RegisterType((*HashingAlgorithm)(nil), "sdk.common.HashingAlgorithm") + proto.RegisterType((*BlockDataHashingStructure)(nil), "sdk.common.BlockDataHashingStructure") + proto.RegisterType((*OrdererAddresses)(nil), "sdk.common.OrdererAddresses") + proto.RegisterType((*Consortium)(nil), "sdk.common.Consortium") + proto.RegisterType((*Capabilities)(nil), "sdk.common.Capabilities") + proto.RegisterMapType((map[string]*Capability)(nil), "sdk.common.Capabilities.CapabilitiesEntry") + proto.RegisterType((*Capability)(nil), "sdk.common.Capability") +} + +func init() { + proto.RegisterFile("common/configuration.proto", fileDescriptor_configuration_c60fbe5ebb3de531) +} + +var fileDescriptor_configuration_c60fbe5ebb3de531 = []byte{ + // 314 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0x41, 0x6b, 0xf2, 0x40, + 0x10, 0x86, 0x89, 0x7e, 0x0a, 0x8e, 0x7e, 0x60, 0x97, 0x1e, 0xac, 0xf4, 0x10, 0x42, 0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1a, 0xaa, 0xa3, 0x93, 0xec, 0x74, 0x0d, 0x17, 0x67, 0x0a, 0x1b, + 0x43, 0x77, 0x8b, 0xf5, 0x61, 0x89, 0x7d, 0xc9, 0x7c, 0xe8, 0x7d, 0xf2, 0xa2, 0xc2, 0x49, 0xc7, + 0x75, 0xfc, 0xe1, 0x9c, 0x9d, 0xdd, 0x55, 0x47, 0x56, 0x78, 0xea, 0x3c, 0x3a, 0xde, 0x08, 0xe0, + 0xd8, 0x58, 0xae, 0xe1, 0x46, 0x51, 0x16, 0xe4, 0xf5, 0x0e, 0xa9, 0xc0, 0x34, 0x43, 0x0a, 0x36, + 0x3c, 0x26, 0x91, 0xd8, 0x6f, 0xd1, 0x87, 0x59, 0x1f, 0xb7, 0x99, 0x30, 0x79, 0x15, 0xef, 0x31, + 0x6c, 0xc9, 0xa1, 0x95, 0x43, 0x2b, 0x87, 0x56, 0x8e, 0xfb, 0x0d, 0x3e, 0xfc, 0x04, 0x00, 0x00, + 0xff, 0xff, 0xd6, 0x7e, 0xb4, 0x89, 0xf0, 0x01, 0x00, 0x00, +} diff --git a/fabric/protos/common/ledger.pb.go b/fabric/protos/common/ledger.pb.go new file mode 100644 index 0000000..1ad50c7 --- /dev/null +++ b/fabric/protos/common/ledger.pb.go @@ -0,0 +1,101 @@ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: common/ledger.proto + +package common // import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/common" + +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 + +// Contains information about the blockchain ledger such as height, current +// block hash, and previous block hash. +type BlockchainInfo struct { + Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + CurrentBlockHash []byte `protobuf:"bytes,2,opt,name=currentBlockHash,proto3" json:"currentBlockHash,omitempty"` + PreviousBlockHash []byte `protobuf:"bytes,3,opt,name=previousBlockHash,proto3" json:"previousBlockHash,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BlockchainInfo) Reset() { *m = BlockchainInfo{} } +func (m *BlockchainInfo) String() string { return proto.CompactTextString(m) } +func (*BlockchainInfo) ProtoMessage() {} +func (*BlockchainInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_ledger_109361caaf4d9d5c, []int{0} +} +func (m *BlockchainInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BlockchainInfo.Unmarshal(m, b) +} +func (m *BlockchainInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BlockchainInfo.Marshal(b, m, deterministic) +} +func (dst *BlockchainInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockchainInfo.Merge(dst, src) +} +func (m *BlockchainInfo) XXX_Size() int { + return xxx_messageInfo_BlockchainInfo.Size(m) +} +func (m *BlockchainInfo) XXX_DiscardUnknown() { + xxx_messageInfo_BlockchainInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockchainInfo proto.InternalMessageInfo + +func (m *BlockchainInfo) GetHeight() uint64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *BlockchainInfo) GetCurrentBlockHash() []byte { + if m != nil { + return m.CurrentBlockHash + } + return nil +} + +func (m *BlockchainInfo) GetPreviousBlockHash() []byte { + if m != nil { + return m.PreviousBlockHash + } + return nil +} + +func init() { + proto.RegisterType((*BlockchainInfo)(nil), "sdk.common.BlockchainInfo") +} + +func init() { proto.RegisterFile("common/ledger.proto", fileDescriptor_ledger_109361caaf4d9d5c) } + +var fileDescriptor_ledger_109361caaf4d9d5c = []byte{ + // 186 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4e, 0xce, 0xcf, 0xcd, + 0xcd, 0xcf, 0xd3, 0xcf, 0x49, 0x4d, 0x49, 0x4f, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, + 0x62, 0x83, 0x08, 0x2a, 0x35, 0x31, 0x72, 0xf1, 0x39, 0xe5, 0xe4, 0x27, 0x67, 0x27, 0x67, 0x24, + 0x66, 0xe6, 0x79, 0xe6, 0xa5, 0xe5, 0x0b, 0x89, 0x71, 0xb1, 0x65, 0xa4, 0x66, 0xa6, 0x67, 0x94, + 0x48, 0x30, 0x2a, 0x30, 0x6a, 0xb0, 0x04, 0x41, 0x79, 0x42, 0x5a, 0x5c, 0x02, 0xc9, 0xa5, 0x45, + 0x45, 0xa9, 0x79, 0x25, 0x60, 0x0d, 0x1e, 0x89, 0xc5, 0x19, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0x3c, + 0x41, 0x18, 0xe2, 0x42, 0x3a, 0x5c, 0x82, 0x05, 0x45, 0xa9, 0x65, 0x99, 0xf9, 0xa5, 0xc5, 0x08, + 0xc5, 0xcc, 0x60, 0xc5, 0x98, 0x12, 0x4e, 0xc1, 0x5c, 0x2a, 0xf9, 0x45, 0xe9, 0x7a, 0x19, 0x95, + 0x05, 0xa9, 0x45, 0x50, 0x57, 0xa6, 0x25, 0x26, 0x15, 0x65, 0x26, 0x43, 0x1c, 0x5b, 0xac, 0x07, + 0x71, 0x6c, 0x94, 0x76, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x12, 0x88, 0xab, 0x8f, 0xa4, 0x58, 0x1f, + 0xa2, 0x58, 0x1f, 0xa2, 0x58, 0x1f, 0xa2, 0x38, 0x89, 0x0d, 0xcc, 0x35, 0x06, 0x04, 0x00, 0x00, + 0xff, 0xff, 0x9f, 0xcc, 0x05, 0xd1, 0xff, 0x00, 0x00, 0x00, +} diff --git a/fabric/protos/common/policies.pb.go b/fabric/protos/common/policies.pb.go new file mode 100644 index 0000000..520b1cc --- /dev/null +++ b/fabric/protos/common/policies.pb.go @@ -0,0 +1,474 @@ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: common/policies.proto + +package common // import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/common" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import msp "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/msp" + +// 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 Policy_PolicyType int32 + +const ( + Policy_UNKNOWN Policy_PolicyType = 0 + Policy_SIGNATURE Policy_PolicyType = 1 + Policy_MSP Policy_PolicyType = 2 + Policy_IMPLICIT_META Policy_PolicyType = 3 +) + +var Policy_PolicyType_name = map[int32]string{ + 0: "UNKNOWN", + 1: "SIGNATURE", + 2: "MSP", + 3: "IMPLICIT_META", +} +var Policy_PolicyType_value = map[string]int32{ + "UNKNOWN": 0, + "SIGNATURE": 1, + "MSP": 2, + "IMPLICIT_META": 3, +} + +func (x Policy_PolicyType) String() string { + return proto.EnumName(Policy_PolicyType_name, int32(x)) +} +func (Policy_PolicyType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_policies_0e89ed70e7bf49a8, []int{0, 0} +} + +type ImplicitMetaPolicy_Rule int32 + +const ( + ImplicitMetaPolicy_ANY ImplicitMetaPolicy_Rule = 0 + ImplicitMetaPolicy_ALL ImplicitMetaPolicy_Rule = 1 + ImplicitMetaPolicy_MAJORITY ImplicitMetaPolicy_Rule = 2 +) + +var ImplicitMetaPolicy_Rule_name = map[int32]string{ + 0: "ANY", + 1: "ALL", + 2: "MAJORITY", +} +var ImplicitMetaPolicy_Rule_value = map[string]int32{ + "ANY": 0, + "ALL": 1, + "MAJORITY": 2, +} + +func (x ImplicitMetaPolicy_Rule) String() string { + return proto.EnumName(ImplicitMetaPolicy_Rule_name, int32(x)) +} +func (ImplicitMetaPolicy_Rule) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_policies_0e89ed70e7bf49a8, []int{3, 0} +} + +// Policy expresses a policy which the orderer can evaluate, because there has been some desire expressed to support +// multiple policy engines, this is typed as a oneof for now +type Policy struct { + Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Policy) Reset() { *m = Policy{} } +func (m *Policy) String() string { return proto.CompactTextString(m) } +func (*Policy) ProtoMessage() {} +func (*Policy) Descriptor() ([]byte, []int) { + return fileDescriptor_policies_0e89ed70e7bf49a8, []int{0} +} +func (m *Policy) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Policy.Unmarshal(m, b) +} +func (m *Policy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Policy.Marshal(b, m, deterministic) +} +func (dst *Policy) XXX_Merge(src proto.Message) { + xxx_messageInfo_Policy.Merge(dst, src) +} +func (m *Policy) XXX_Size() int { + return xxx_messageInfo_Policy.Size(m) +} +func (m *Policy) XXX_DiscardUnknown() { + xxx_messageInfo_Policy.DiscardUnknown(m) +} + +var xxx_messageInfo_Policy proto.InternalMessageInfo + +func (m *Policy) GetType() int32 { + if m != nil { + return m.Type + } + return 0 +} + +func (m *Policy) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +// SignaturePolicyEnvelope wraps a SignaturePolicy and includes a version for future enhancements +type SignaturePolicyEnvelope struct { + Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + Rule *SignaturePolicy `protobuf:"bytes,2,opt,name=rule,proto3" json:"rule,omitempty"` + Identities []*msp.MSPPrincipal `protobuf:"bytes,3,rep,name=identities,proto3" json:"identities,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignaturePolicyEnvelope) Reset() { *m = SignaturePolicyEnvelope{} } +func (m *SignaturePolicyEnvelope) String() string { return proto.CompactTextString(m) } +func (*SignaturePolicyEnvelope) ProtoMessage() {} +func (*SignaturePolicyEnvelope) Descriptor() ([]byte, []int) { + return fileDescriptor_policies_0e89ed70e7bf49a8, []int{1} +} +func (m *SignaturePolicyEnvelope) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignaturePolicyEnvelope.Unmarshal(m, b) +} +func (m *SignaturePolicyEnvelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignaturePolicyEnvelope.Marshal(b, m, deterministic) +} +func (dst *SignaturePolicyEnvelope) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignaturePolicyEnvelope.Merge(dst, src) +} +func (m *SignaturePolicyEnvelope) XXX_Size() int { + return xxx_messageInfo_SignaturePolicyEnvelope.Size(m) +} +func (m *SignaturePolicyEnvelope) XXX_DiscardUnknown() { + xxx_messageInfo_SignaturePolicyEnvelope.DiscardUnknown(m) +} + +var xxx_messageInfo_SignaturePolicyEnvelope proto.InternalMessageInfo + +func (m *SignaturePolicyEnvelope) GetVersion() int32 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *SignaturePolicyEnvelope) GetRule() *SignaturePolicy { + if m != nil { + return m.Rule + } + return nil +} + +func (m *SignaturePolicyEnvelope) GetIdentities() []*msp.MSPPrincipal { + if m != nil { + return m.Identities + } + return nil +} + +// SignaturePolicy is a recursive message structure which defines a featherweight DSL for describing +// policies which are more complicated than 'exactly this signature'. The NOutOf operator is sufficent +// to express AND as well as OR, as well as of course N out of the following M policies +// SignedBy implies that the signature is from a valid certificate which is signed by the trusted +// authority specified in the bytes. This will be the certificate itself for a self-signed certificate +// and will be the CA for more traditional certificates +type SignaturePolicy struct { + // Types that are valid to be assigned to Type: + // *SignaturePolicy_SignedBy + // *SignaturePolicy_NOutOf_ + Type isSignaturePolicy_Type `protobuf_oneof:"Type"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignaturePolicy) Reset() { *m = SignaturePolicy{} } +func (m *SignaturePolicy) String() string { return proto.CompactTextString(m) } +func (*SignaturePolicy) ProtoMessage() {} +func (*SignaturePolicy) Descriptor() ([]byte, []int) { + return fileDescriptor_policies_0e89ed70e7bf49a8, []int{2} +} +func (m *SignaturePolicy) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignaturePolicy.Unmarshal(m, b) +} +func (m *SignaturePolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignaturePolicy.Marshal(b, m, deterministic) +} +func (dst *SignaturePolicy) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignaturePolicy.Merge(dst, src) +} +func (m *SignaturePolicy) XXX_Size() int { + return xxx_messageInfo_SignaturePolicy.Size(m) +} +func (m *SignaturePolicy) XXX_DiscardUnknown() { + xxx_messageInfo_SignaturePolicy.DiscardUnknown(m) +} + +var xxx_messageInfo_SignaturePolicy proto.InternalMessageInfo + +type isSignaturePolicy_Type interface { + isSignaturePolicy_Type() +} + +type SignaturePolicy_SignedBy struct { + SignedBy int32 `protobuf:"varint,1,opt,name=signed_by,json=signedBy,proto3,oneof"` +} + +type SignaturePolicy_NOutOf_ struct { + NOutOf *SignaturePolicy_NOutOf `protobuf:"bytes,2,opt,name=n_out_of,json=nOutOf,proto3,oneof"` +} + +func (*SignaturePolicy_SignedBy) isSignaturePolicy_Type() {} + +func (*SignaturePolicy_NOutOf_) isSignaturePolicy_Type() {} + +func (m *SignaturePolicy) GetType() isSignaturePolicy_Type { + if m != nil { + return m.Type + } + return nil +} + +func (m *SignaturePolicy) GetSignedBy() int32 { + if x, ok := m.GetType().(*SignaturePolicy_SignedBy); ok { + return x.SignedBy + } + return 0 +} + +func (m *SignaturePolicy) GetNOutOf() *SignaturePolicy_NOutOf { + if x, ok := m.GetType().(*SignaturePolicy_NOutOf_); ok { + return x.NOutOf + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*SignaturePolicy) 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 _SignaturePolicy_OneofMarshaler, _SignaturePolicy_OneofUnmarshaler, _SignaturePolicy_OneofSizer, []interface{}{ + (*SignaturePolicy_SignedBy)(nil), + (*SignaturePolicy_NOutOf_)(nil), + } +} + +func _SignaturePolicy_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*SignaturePolicy) + // Type + switch x := m.Type.(type) { + case *SignaturePolicy_SignedBy: + b.EncodeVarint(1<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.SignedBy)) + case *SignaturePolicy_NOutOf_: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.NOutOf); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("SignaturePolicy.Type has unexpected type %T", x) + } + return nil +} + +func _SignaturePolicy_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*SignaturePolicy) + switch tag { + case 1: // Type.signed_by + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Type = &SignaturePolicy_SignedBy{int32(x)} + return true, err + case 2: // Type.n_out_of + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignaturePolicy_NOutOf) + err := b.DecodeMessage(msg) + m.Type = &SignaturePolicy_NOutOf_{msg} + return true, err + default: + return false, nil + } +} + +func _SignaturePolicy_OneofSizer(msg proto.Message) (n int) { + m := msg.(*SignaturePolicy) + // Type + switch x := m.Type.(type) { + case *SignaturePolicy_SignedBy: + n += 1 // tag and wire + n += proto.SizeVarint(uint64(x.SignedBy)) + case *SignaturePolicy_NOutOf_: + s := proto.Size(x.NOutOf) + 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 +} + +type SignaturePolicy_NOutOf struct { + N int32 `protobuf:"varint,1,opt,name=n,proto3" json:"n,omitempty"` + Rules []*SignaturePolicy `protobuf:"bytes,2,rep,name=rules,proto3" json:"rules,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignaturePolicy_NOutOf) Reset() { *m = SignaturePolicy_NOutOf{} } +func (m *SignaturePolicy_NOutOf) String() string { return proto.CompactTextString(m) } +func (*SignaturePolicy_NOutOf) ProtoMessage() {} +func (*SignaturePolicy_NOutOf) Descriptor() ([]byte, []int) { + return fileDescriptor_policies_0e89ed70e7bf49a8, []int{2, 0} +} +func (m *SignaturePolicy_NOutOf) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignaturePolicy_NOutOf.Unmarshal(m, b) +} +func (m *SignaturePolicy_NOutOf) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignaturePolicy_NOutOf.Marshal(b, m, deterministic) +} +func (dst *SignaturePolicy_NOutOf) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignaturePolicy_NOutOf.Merge(dst, src) +} +func (m *SignaturePolicy_NOutOf) XXX_Size() int { + return xxx_messageInfo_SignaturePolicy_NOutOf.Size(m) +} +func (m *SignaturePolicy_NOutOf) XXX_DiscardUnknown() { + xxx_messageInfo_SignaturePolicy_NOutOf.DiscardUnknown(m) +} + +var xxx_messageInfo_SignaturePolicy_NOutOf proto.InternalMessageInfo + +func (m *SignaturePolicy_NOutOf) GetN() int32 { + if m != nil { + return m.N + } + return 0 +} + +func (m *SignaturePolicy_NOutOf) GetRules() []*SignaturePolicy { + if m != nil { + return m.Rules + } + return nil +} + +// ImplicitMetaPolicy is a policy type which depends on the hierarchical nature of the configuration +// It is implicit because the rule is generate implicitly based on the number of sub policies +// It is meta because it depends only on the result of other policies +// When evaluated, this policy iterates over all immediate child sub-groups, retrieves the policy +// of name sub_policy, evaluates the collection and applies the rule. +// For example, with 4 sub-groups, and a policy name of "foo", ImplicitMetaPolicy retrieves +// each sub-group, retrieves policy "foo" for each subgroup, evaluates it, and, in the case of ANY +// 1 satisfied is sufficient, ALL would require 4 signatures, and MAJORITY would require 3 signatures. +type ImplicitMetaPolicy struct { + SubPolicy string `protobuf:"bytes,1,opt,name=sub_policy,json=subPolicy,proto3" json:"sub_policy,omitempty"` + Rule ImplicitMetaPolicy_Rule `protobuf:"varint,2,opt,name=rule,proto3,enum=common.ImplicitMetaPolicy_Rule" json:"rule,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ImplicitMetaPolicy) Reset() { *m = ImplicitMetaPolicy{} } +func (m *ImplicitMetaPolicy) String() string { return proto.CompactTextString(m) } +func (*ImplicitMetaPolicy) ProtoMessage() {} +func (*ImplicitMetaPolicy) Descriptor() ([]byte, []int) { + return fileDescriptor_policies_0e89ed70e7bf49a8, []int{3} +} +func (m *ImplicitMetaPolicy) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ImplicitMetaPolicy.Unmarshal(m, b) +} +func (m *ImplicitMetaPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ImplicitMetaPolicy.Marshal(b, m, deterministic) +} +func (dst *ImplicitMetaPolicy) XXX_Merge(src proto.Message) { + xxx_messageInfo_ImplicitMetaPolicy.Merge(dst, src) +} +func (m *ImplicitMetaPolicy) XXX_Size() int { + return xxx_messageInfo_ImplicitMetaPolicy.Size(m) +} +func (m *ImplicitMetaPolicy) XXX_DiscardUnknown() { + xxx_messageInfo_ImplicitMetaPolicy.DiscardUnknown(m) +} + +var xxx_messageInfo_ImplicitMetaPolicy proto.InternalMessageInfo + +func (m *ImplicitMetaPolicy) GetSubPolicy() string { + if m != nil { + return m.SubPolicy + } + return "" +} + +func (m *ImplicitMetaPolicy) GetRule() ImplicitMetaPolicy_Rule { + if m != nil { + return m.Rule + } + return ImplicitMetaPolicy_ANY +} + +func init() { + proto.RegisterType((*Policy)(nil), "sdk.common.Policy") + proto.RegisterType((*SignaturePolicyEnvelope)(nil), "sdk.common.SignaturePolicyEnvelope") + proto.RegisterType((*SignaturePolicy)(nil), "sdk.common.SignaturePolicy") + proto.RegisterType((*SignaturePolicy_NOutOf)(nil), "sdk.common.SignaturePolicy.NOutOf") + proto.RegisterType((*ImplicitMetaPolicy)(nil), "sdk.common.ImplicitMetaPolicy") + proto.RegisterEnum("sdk.common.Policy_PolicyType", Policy_PolicyType_name, Policy_PolicyType_value) + proto.RegisterEnum("sdk.common.ImplicitMetaPolicy_Rule", ImplicitMetaPolicy_Rule_name, ImplicitMetaPolicy_Rule_value) +} + +func init() { proto.RegisterFile("common/policies.proto", fileDescriptor_policies_0e89ed70e7bf49a8) } + +var fileDescriptor_policies_0e89ed70e7bf49a8 = []byte{ + // 480 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xdf, 0x8b, 0xda, 0x40, + 0x10, 0x76, 0xfd, 0x11, 0x75, 0xf4, 0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 0x91, 0x4b, 0xb2, 0x84, 0x9a, 0xf1, 0x3a, 0xef, 0xa0, 0x9a, 0xa3, 0x7c, 0xcb, 0xc3, + 0xf0, 0xde, 0x2e, 0x15, 0xc1, 0x64, 0x62, 0x23, 0xdc, 0x86, 0x46, 0x30, 0xfc, 0x3a, 0x25, 0xfe, + 0xe2, 0xde, 0x2e, 0x8f, 0xe6, 0xf0, 0x56, 0xa4, 0x5b, 0xf7, 0xe1, 0x20, 0x69, 0x9a, 0xd0, 0xf5, + 0x96, 0xa6, 0xee, 0x66, 0x19, 0xa7, 0x6c, 0x65, 0x6e, 0x50, 0x1d, 0x7f, 0xfb, 0x71, 0xbd, 0x65, + 0xfa, 0x21, 0x8b, 0x73, 0xe8, 0x9d, 0x91, 0x3d, 0x43, 0xf6, 0x0c, 0xd9, 0x33, 0xe4, 0xd8, 0x2a, + 0xe0, 0xcd, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x34, 0xab, 0x8a, 0xb5, 0xf9, 0x02, 0x00, 0x00, +} diff --git a/fabric/protos/common/signed_data.go b/fabric/protos/common/signed_data.go new file mode 100644 index 0000000..062994f --- /dev/null +++ b/fabric/protos/common/signed_data.go @@ -0,0 +1,115 @@ +/* +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. +*/ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ + +package common + +import ( + "fmt" + + "github.com/golang/protobuf/proto" +) + +// SignedData is used to represent the general triplet required to verify a signature +// This is intended to be generic across crypto schemes, while most crypto schemes will +// include the signing identity and a nonce within the Data, this is left to the crypto +// implementation +type SignedData struct { + Data []byte + Identity []byte + Signature []byte +} + +// Signable types are those which can map their contents to a set of SignedData +type Signable interface { + // AsSignedData returns the set of signatures for a structure as SignedData or an error indicating why this was not possible + AsSignedData() ([]*SignedData, error) +} + +// AsSignedData returns the set of signatures for the ConfigUpdateEnvelope as SignedData or an error indicating why this was not possible +func (ce *ConfigUpdateEnvelope) AsSignedData() ([]*SignedData, error) { + if ce == nil { + return nil, fmt.Errorf("No signatures for nil SignedConfigItem") + } + + result := make([]*SignedData, len(ce.Signatures)) + for i, configSig := range ce.Signatures { + sigHeader := &SignatureHeader{} + err := proto.Unmarshal(configSig.SignatureHeader, sigHeader) + if err != nil { + return nil, err + } + + result[i] = &SignedData{ + Data: concatenateBytes(configSig.SignatureHeader, ce.ConfigUpdate), + Identity: sigHeader.Creator, + Signature: configSig.Signature, + } + + } + + return result, nil +} + +// AsSignedData returns the signatures for the Envelope as SignedData slice of length 1 or an error indicating why this was not possible +func (env *Envelope) AsSignedData() ([]*SignedData, error) { + if env == nil { + return nil, fmt.Errorf("No signatures for nil Envelope") + } + + payload := &Payload{} + err := proto.Unmarshal(env.Payload, payload) + if err != nil { + return nil, err + } + + if payload.Header == nil /* || payload.Header.SignatureHeader == nil */ { + return nil, fmt.Errorf("Missing Header") + } + + shdr := &SignatureHeader{} + err = proto.Unmarshal(payload.Header.SignatureHeader, shdr) + if err != nil { + return nil, fmt.Errorf("GetSignatureHeaderFromBytes failed, err %s", err) + } + + return []*SignedData{{ + Data: env.Payload, + Identity: shdr.Creator, + Signature: env.Signature, + }}, nil +} + +// ConcatenateBytes is useful for combining multiple arrays of bytes, especially for +// signatures or digests over multiple fields +func concatenateBytes(data ...[]byte) []byte { + finalLength := 0 + for _, slice := range data { + finalLength += len(slice) + } + result := make([]byte, finalLength) + last := 0 + for _, slice := range data { + for i := range slice { + result[i+last] = slice[i] + } + last += len(slice) + } + return result +} diff --git a/fabric/protos/ledger/rwset/kvrwset/kv_rwset.pb.go b/fabric/protos/ledger/rwset/kvrwset/kv_rwset.pb.go new file mode 100644 index 0000000..6f4066b --- /dev/null +++ b/fabric/protos/ledger/rwset/kvrwset/kv_rwset.pb.go @@ -0,0 +1,884 @@ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: ledger/rwset/kvrwset/kv_rwset.proto + +package kvrwset // import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/ledger/rwset/kvrwset" + +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 + +// KVRWSet encapsulates the read-write set for a chaincode that operates upon a KV or Document data model +// This structure is used for both the public data and the private data +type KVRWSet struct { + Reads []*KVRead `protobuf:"bytes,1,rep,name=reads,proto3" json:"reads,omitempty"` + RangeQueriesInfo []*RangeQueryInfo `protobuf:"bytes,2,rep,name=range_queries_info,json=rangeQueriesInfo,proto3" json:"range_queries_info,omitempty"` + Writes []*KVWrite `protobuf:"bytes,3,rep,name=writes,proto3" json:"writes,omitempty"` + MetadataWrites []*KVMetadataWrite `protobuf:"bytes,4,rep,name=metadata_writes,json=metadataWrites,proto3" json:"metadata_writes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *KVRWSet) Reset() { *m = KVRWSet{} } +func (m *KVRWSet) String() string { return proto.CompactTextString(m) } +func (*KVRWSet) ProtoMessage() {} +func (*KVRWSet) Descriptor() ([]byte, []int) { + return fileDescriptor_kv_rwset_b744a14a894993b5, []int{0} +} +func (m *KVRWSet) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_KVRWSet.Unmarshal(m, b) +} +func (m *KVRWSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_KVRWSet.Marshal(b, m, deterministic) +} +func (dst *KVRWSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_KVRWSet.Merge(dst, src) +} +func (m *KVRWSet) XXX_Size() int { + return xxx_messageInfo_KVRWSet.Size(m) +} +func (m *KVRWSet) XXX_DiscardUnknown() { + xxx_messageInfo_KVRWSet.DiscardUnknown(m) +} + +var xxx_messageInfo_KVRWSet proto.InternalMessageInfo + +func (m *KVRWSet) GetReads() []*KVRead { + if m != nil { + return m.Reads + } + return nil +} + +func (m *KVRWSet) GetRangeQueriesInfo() []*RangeQueryInfo { + if m != nil { + return m.RangeQueriesInfo + } + return nil +} + +func (m *KVRWSet) GetWrites() []*KVWrite { + if m != nil { + return m.Writes + } + return nil +} + +func (m *KVRWSet) GetMetadataWrites() []*KVMetadataWrite { + if m != nil { + return m.MetadataWrites + } + return nil +} + +// HashedRWSet encapsulates hashed representation of a private read-write set for KV or Document data model +type HashedRWSet struct { + HashedReads []*KVReadHash `protobuf:"bytes,1,rep,name=hashed_reads,json=hashedReads,proto3" json:"hashed_reads,omitempty"` + HashedWrites []*KVWriteHash `protobuf:"bytes,2,rep,name=hashed_writes,json=hashedWrites,proto3" json:"hashed_writes,omitempty"` + MetadataWrites []*KVMetadataWriteHash `protobuf:"bytes,3,rep,name=metadata_writes,json=metadataWrites,proto3" json:"metadata_writes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *HashedRWSet) Reset() { *m = HashedRWSet{} } +func (m *HashedRWSet) String() string { return proto.CompactTextString(m) } +func (*HashedRWSet) ProtoMessage() {} +func (*HashedRWSet) Descriptor() ([]byte, []int) { + return fileDescriptor_kv_rwset_b744a14a894993b5, []int{1} +} +func (m *HashedRWSet) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_HashedRWSet.Unmarshal(m, b) +} +func (m *HashedRWSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_HashedRWSet.Marshal(b, m, deterministic) +} +func (dst *HashedRWSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_HashedRWSet.Merge(dst, src) +} +func (m *HashedRWSet) XXX_Size() int { + return xxx_messageInfo_HashedRWSet.Size(m) +} +func (m *HashedRWSet) XXX_DiscardUnknown() { + xxx_messageInfo_HashedRWSet.DiscardUnknown(m) +} + +var xxx_messageInfo_HashedRWSet proto.InternalMessageInfo + +func (m *HashedRWSet) GetHashedReads() []*KVReadHash { + if m != nil { + return m.HashedReads + } + return nil +} + +func (m *HashedRWSet) GetHashedWrites() []*KVWriteHash { + if m != nil { + return m.HashedWrites + } + return nil +} + +func (m *HashedRWSet) GetMetadataWrites() []*KVMetadataWriteHash { + if m != nil { + return m.MetadataWrites + } + return nil +} + +// KVRead captures a read operation performed during transaction simulation +// A 'nil' version indicates a non-existing key read by the transaction +type KVRead struct { + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Version *Version `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *KVRead) Reset() { *m = KVRead{} } +func (m *KVRead) String() string { return proto.CompactTextString(m) } +func (*KVRead) ProtoMessage() {} +func (*KVRead) Descriptor() ([]byte, []int) { + return fileDescriptor_kv_rwset_b744a14a894993b5, []int{2} +} +func (m *KVRead) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_KVRead.Unmarshal(m, b) +} +func (m *KVRead) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_KVRead.Marshal(b, m, deterministic) +} +func (dst *KVRead) XXX_Merge(src proto.Message) { + xxx_messageInfo_KVRead.Merge(dst, src) +} +func (m *KVRead) XXX_Size() int { + return xxx_messageInfo_KVRead.Size(m) +} +func (m *KVRead) XXX_DiscardUnknown() { + xxx_messageInfo_KVRead.DiscardUnknown(m) +} + +var xxx_messageInfo_KVRead proto.InternalMessageInfo + +func (m *KVRead) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *KVRead) GetVersion() *Version { + if m != nil { + return m.Version + } + return nil +} + +// KVWrite captures a write (update/delete) operation performed during transaction simulation +type KVWrite struct { + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + IsDelete bool `protobuf:"varint,2,opt,name=is_delete,json=isDelete,proto3" json:"is_delete,omitempty"` + Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *KVWrite) Reset() { *m = KVWrite{} } +func (m *KVWrite) String() string { return proto.CompactTextString(m) } +func (*KVWrite) ProtoMessage() {} +func (*KVWrite) Descriptor() ([]byte, []int) { + return fileDescriptor_kv_rwset_b744a14a894993b5, []int{3} +} +func (m *KVWrite) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_KVWrite.Unmarshal(m, b) +} +func (m *KVWrite) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_KVWrite.Marshal(b, m, deterministic) +} +func (dst *KVWrite) XXX_Merge(src proto.Message) { + xxx_messageInfo_KVWrite.Merge(dst, src) +} +func (m *KVWrite) XXX_Size() int { + return xxx_messageInfo_KVWrite.Size(m) +} +func (m *KVWrite) XXX_DiscardUnknown() { + xxx_messageInfo_KVWrite.DiscardUnknown(m) +} + +var xxx_messageInfo_KVWrite proto.InternalMessageInfo + +func (m *KVWrite) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *KVWrite) GetIsDelete() bool { + if m != nil { + return m.IsDelete + } + return false +} + +func (m *KVWrite) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +// KVMetadataWrite captures all the entries in the metadata associated with a key +type KVMetadataWrite struct { + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Entries []*KVMetadataEntry `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *KVMetadataWrite) Reset() { *m = KVMetadataWrite{} } +func (m *KVMetadataWrite) String() string { return proto.CompactTextString(m) } +func (*KVMetadataWrite) ProtoMessage() {} +func (*KVMetadataWrite) Descriptor() ([]byte, []int) { + return fileDescriptor_kv_rwset_b744a14a894993b5, []int{4} +} +func (m *KVMetadataWrite) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_KVMetadataWrite.Unmarshal(m, b) +} +func (m *KVMetadataWrite) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_KVMetadataWrite.Marshal(b, m, deterministic) +} +func (dst *KVMetadataWrite) XXX_Merge(src proto.Message) { + xxx_messageInfo_KVMetadataWrite.Merge(dst, src) +} +func (m *KVMetadataWrite) XXX_Size() int { + return xxx_messageInfo_KVMetadataWrite.Size(m) +} +func (m *KVMetadataWrite) XXX_DiscardUnknown() { + xxx_messageInfo_KVMetadataWrite.DiscardUnknown(m) +} + +var xxx_messageInfo_KVMetadataWrite proto.InternalMessageInfo + +func (m *KVMetadataWrite) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *KVMetadataWrite) GetEntries() []*KVMetadataEntry { + if m != nil { + return m.Entries + } + return nil +} + +// KVReadHash is similar to the KVRead in spirit. However, it captures the hash of the key instead of the key itself +// version is kept as is for now. However, if the version also needs to be privacy-protected, it would need to be the +// hash of the version and hence of 'bytes' type +type KVReadHash struct { + KeyHash []byte `protobuf:"bytes,1,opt,name=key_hash,json=keyHash,proto3" json:"key_hash,omitempty"` + Version *Version `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *KVReadHash) Reset() { *m = KVReadHash{} } +func (m *KVReadHash) String() string { return proto.CompactTextString(m) } +func (*KVReadHash) ProtoMessage() {} +func (*KVReadHash) Descriptor() ([]byte, []int) { + return fileDescriptor_kv_rwset_b744a14a894993b5, []int{5} +} +func (m *KVReadHash) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_KVReadHash.Unmarshal(m, b) +} +func (m *KVReadHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_KVReadHash.Marshal(b, m, deterministic) +} +func (dst *KVReadHash) XXX_Merge(src proto.Message) { + xxx_messageInfo_KVReadHash.Merge(dst, src) +} +func (m *KVReadHash) XXX_Size() int { + return xxx_messageInfo_KVReadHash.Size(m) +} +func (m *KVReadHash) XXX_DiscardUnknown() { + xxx_messageInfo_KVReadHash.DiscardUnknown(m) +} + +var xxx_messageInfo_KVReadHash proto.InternalMessageInfo + +func (m *KVReadHash) GetKeyHash() []byte { + if m != nil { + return m.KeyHash + } + return nil +} + +func (m *KVReadHash) GetVersion() *Version { + if m != nil { + return m.Version + } + return nil +} + +// KVWriteHash is similar to the KVWrite. It captures a write (update/delete) operation performed during transaction simulation +type KVWriteHash struct { + KeyHash []byte `protobuf:"bytes,1,opt,name=key_hash,json=keyHash,proto3" json:"key_hash,omitempty"` + IsDelete bool `protobuf:"varint,2,opt,name=is_delete,json=isDelete,proto3" json:"is_delete,omitempty"` + ValueHash []byte `protobuf:"bytes,3,opt,name=value_hash,json=valueHash,proto3" json:"value_hash,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *KVWriteHash) Reset() { *m = KVWriteHash{} } +func (m *KVWriteHash) String() string { return proto.CompactTextString(m) } +func (*KVWriteHash) ProtoMessage() {} +func (*KVWriteHash) Descriptor() ([]byte, []int) { + return fileDescriptor_kv_rwset_b744a14a894993b5, []int{6} +} +func (m *KVWriteHash) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_KVWriteHash.Unmarshal(m, b) +} +func (m *KVWriteHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_KVWriteHash.Marshal(b, m, deterministic) +} +func (dst *KVWriteHash) XXX_Merge(src proto.Message) { + xxx_messageInfo_KVWriteHash.Merge(dst, src) +} +func (m *KVWriteHash) XXX_Size() int { + return xxx_messageInfo_KVWriteHash.Size(m) +} +func (m *KVWriteHash) XXX_DiscardUnknown() { + xxx_messageInfo_KVWriteHash.DiscardUnknown(m) +} + +var xxx_messageInfo_KVWriteHash proto.InternalMessageInfo + +func (m *KVWriteHash) GetKeyHash() []byte { + if m != nil { + return m.KeyHash + } + return nil +} + +func (m *KVWriteHash) GetIsDelete() bool { + if m != nil { + return m.IsDelete + } + return false +} + +func (m *KVWriteHash) GetValueHash() []byte { + if m != nil { + return m.ValueHash + } + return nil +} + +// KVMetadataWriteHash captures all the upserts to the metadata associated with a key hash +type KVMetadataWriteHash struct { + KeyHash []byte `protobuf:"bytes,1,opt,name=key_hash,json=keyHash,proto3" json:"key_hash,omitempty"` + Entries []*KVMetadataEntry `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *KVMetadataWriteHash) Reset() { *m = KVMetadataWriteHash{} } +func (m *KVMetadataWriteHash) String() string { return proto.CompactTextString(m) } +func (*KVMetadataWriteHash) ProtoMessage() {} +func (*KVMetadataWriteHash) Descriptor() ([]byte, []int) { + return fileDescriptor_kv_rwset_b744a14a894993b5, []int{7} +} +func (m *KVMetadataWriteHash) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_KVMetadataWriteHash.Unmarshal(m, b) +} +func (m *KVMetadataWriteHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_KVMetadataWriteHash.Marshal(b, m, deterministic) +} +func (dst *KVMetadataWriteHash) XXX_Merge(src proto.Message) { + xxx_messageInfo_KVMetadataWriteHash.Merge(dst, src) +} +func (m *KVMetadataWriteHash) XXX_Size() int { + return xxx_messageInfo_KVMetadataWriteHash.Size(m) +} +func (m *KVMetadataWriteHash) XXX_DiscardUnknown() { + xxx_messageInfo_KVMetadataWriteHash.DiscardUnknown(m) +} + +var xxx_messageInfo_KVMetadataWriteHash proto.InternalMessageInfo + +func (m *KVMetadataWriteHash) GetKeyHash() []byte { + if m != nil { + return m.KeyHash + } + return nil +} + +func (m *KVMetadataWriteHash) GetEntries() []*KVMetadataEntry { + if m != nil { + return m.Entries + } + return nil +} + +// KVMetadataEntry captures a 'name'ed entry in the metadata of a key/key-hash. +type KVMetadataEntry struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *KVMetadataEntry) Reset() { *m = KVMetadataEntry{} } +func (m *KVMetadataEntry) String() string { return proto.CompactTextString(m) } +func (*KVMetadataEntry) ProtoMessage() {} +func (*KVMetadataEntry) Descriptor() ([]byte, []int) { + return fileDescriptor_kv_rwset_b744a14a894993b5, []int{8} +} +func (m *KVMetadataEntry) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_KVMetadataEntry.Unmarshal(m, b) +} +func (m *KVMetadataEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_KVMetadataEntry.Marshal(b, m, deterministic) +} +func (dst *KVMetadataEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_KVMetadataEntry.Merge(dst, src) +} +func (m *KVMetadataEntry) XXX_Size() int { + return xxx_messageInfo_KVMetadataEntry.Size(m) +} +func (m *KVMetadataEntry) XXX_DiscardUnknown() { + xxx_messageInfo_KVMetadataEntry.DiscardUnknown(m) +} + +var xxx_messageInfo_KVMetadataEntry proto.InternalMessageInfo + +func (m *KVMetadataEntry) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *KVMetadataEntry) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +// Version encapsulates the version of a Key +// A version of a committed key is maintained as the height of the transaction that committed the key. +// The height is represenetd as a tuple where the txNum is the position of the transaction +// (starting with 0) within block +type Version struct { + BlockNum uint64 `protobuf:"varint,1,opt,name=block_num,json=blockNum,proto3" json:"block_num,omitempty"` + TxNum uint64 `protobuf:"varint,2,opt,name=tx_num,json=txNum,proto3" json:"tx_num,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Version) Reset() { *m = Version{} } +func (m *Version) String() string { return proto.CompactTextString(m) } +func (*Version) ProtoMessage() {} +func (*Version) Descriptor() ([]byte, []int) { + return fileDescriptor_kv_rwset_b744a14a894993b5, []int{9} +} +func (m *Version) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Version.Unmarshal(m, b) +} +func (m *Version) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Version.Marshal(b, m, deterministic) +} +func (dst *Version) XXX_Merge(src proto.Message) { + xxx_messageInfo_Version.Merge(dst, src) +} +func (m *Version) XXX_Size() int { + return xxx_messageInfo_Version.Size(m) +} +func (m *Version) XXX_DiscardUnknown() { + xxx_messageInfo_Version.DiscardUnknown(m) +} + +var xxx_messageInfo_Version proto.InternalMessageInfo + +func (m *Version) GetBlockNum() uint64 { + if m != nil { + return m.BlockNum + } + return 0 +} + +func (m *Version) GetTxNum() uint64 { + if m != nil { + return m.TxNum + } + return 0 +} + +// RangeQueryInfo encapsulates the details of a range query performed by a transaction during simulation. +// This helps protect transactions from phantom reads by varifying during validation whether any new items +// got committed within the given range between transaction simuation and validation +// (in addition to regular checks for updates/deletes of the existing items). +// readInfo field contains either the KVReads (for the items read by the range query) or a merkle-tree hash +// if the KVReads exceeds a pre-configured numbers +type RangeQueryInfo struct { + StartKey string `protobuf:"bytes,1,opt,name=start_key,json=startKey,proto3" json:"start_key,omitempty"` + EndKey string `protobuf:"bytes,2,opt,name=end_key,json=endKey,proto3" json:"end_key,omitempty"` + ItrExhausted bool `protobuf:"varint,3,opt,name=itr_exhausted,json=itrExhausted,proto3" json:"itr_exhausted,omitempty"` + // Types that are valid to be assigned to ReadsInfo: + // *RangeQueryInfo_RawReads + // *RangeQueryInfo_ReadsMerkleHashes + ReadsInfo isRangeQueryInfo_ReadsInfo `protobuf_oneof:"reads_info"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RangeQueryInfo) Reset() { *m = RangeQueryInfo{} } +func (m *RangeQueryInfo) String() string { return proto.CompactTextString(m) } +func (*RangeQueryInfo) ProtoMessage() {} +func (*RangeQueryInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_kv_rwset_b744a14a894993b5, []int{10} +} +func (m *RangeQueryInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RangeQueryInfo.Unmarshal(m, b) +} +func (m *RangeQueryInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RangeQueryInfo.Marshal(b, m, deterministic) +} +func (dst *RangeQueryInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_RangeQueryInfo.Merge(dst, src) +} +func (m *RangeQueryInfo) XXX_Size() int { + return xxx_messageInfo_RangeQueryInfo.Size(m) +} +func (m *RangeQueryInfo) XXX_DiscardUnknown() { + xxx_messageInfo_RangeQueryInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_RangeQueryInfo proto.InternalMessageInfo + +func (m *RangeQueryInfo) GetStartKey() string { + if m != nil { + return m.StartKey + } + return "" +} + +func (m *RangeQueryInfo) GetEndKey() string { + if m != nil { + return m.EndKey + } + return "" +} + +func (m *RangeQueryInfo) GetItrExhausted() bool { + if m != nil { + return m.ItrExhausted + } + return false +} + +type isRangeQueryInfo_ReadsInfo interface { + isRangeQueryInfo_ReadsInfo() +} + +type RangeQueryInfo_RawReads struct { + RawReads *QueryReads `protobuf:"bytes,4,opt,name=raw_reads,json=rawReads,proto3,oneof"` +} + +type RangeQueryInfo_ReadsMerkleHashes struct { + ReadsMerkleHashes *QueryReadsMerkleSummary `protobuf:"bytes,5,opt,name=reads_merkle_hashes,json=readsMerkleHashes,proto3,oneof"` +} + +func (*RangeQueryInfo_RawReads) isRangeQueryInfo_ReadsInfo() {} + +func (*RangeQueryInfo_ReadsMerkleHashes) isRangeQueryInfo_ReadsInfo() {} + +func (m *RangeQueryInfo) GetReadsInfo() isRangeQueryInfo_ReadsInfo { + if m != nil { + return m.ReadsInfo + } + return nil +} + +func (m *RangeQueryInfo) GetRawReads() *QueryReads { + if x, ok := m.GetReadsInfo().(*RangeQueryInfo_RawReads); ok { + return x.RawReads + } + return nil +} + +func (m *RangeQueryInfo) GetReadsMerkleHashes() *QueryReadsMerkleSummary { + if x, ok := m.GetReadsInfo().(*RangeQueryInfo_ReadsMerkleHashes); ok { + return x.ReadsMerkleHashes + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*RangeQueryInfo) 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 _RangeQueryInfo_OneofMarshaler, _RangeQueryInfo_OneofUnmarshaler, _RangeQueryInfo_OneofSizer, []interface{}{ + (*RangeQueryInfo_RawReads)(nil), + (*RangeQueryInfo_ReadsMerkleHashes)(nil), + } +} + +func _RangeQueryInfo_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*RangeQueryInfo) + // reads_info + switch x := m.ReadsInfo.(type) { + case *RangeQueryInfo_RawReads: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.RawReads); err != nil { + return err + } + case *RangeQueryInfo_ReadsMerkleHashes: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ReadsMerkleHashes); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("RangeQueryInfo.ReadsInfo has unexpected type %T", x) + } + return nil +} + +func _RangeQueryInfo_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*RangeQueryInfo) + switch tag { + case 4: // reads_info.raw_reads + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(QueryReads) + err := b.DecodeMessage(msg) + m.ReadsInfo = &RangeQueryInfo_RawReads{msg} + return true, err + case 5: // reads_info.reads_merkle_hashes + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(QueryReadsMerkleSummary) + err := b.DecodeMessage(msg) + m.ReadsInfo = &RangeQueryInfo_ReadsMerkleHashes{msg} + return true, err + default: + return false, nil + } +} + +func _RangeQueryInfo_OneofSizer(msg proto.Message) (n int) { + m := msg.(*RangeQueryInfo) + // reads_info + switch x := m.ReadsInfo.(type) { + case *RangeQueryInfo_RawReads: + s := proto.Size(x.RawReads) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *RangeQueryInfo_ReadsMerkleHashes: + s := proto.Size(x.ReadsMerkleHashes) + 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 +} + +// QueryReads encapsulates the KVReads for the items read by a transaction as a result of a query execution +type QueryReads struct { + KvReads []*KVRead `protobuf:"bytes,1,rep,name=kv_reads,json=kvReads,proto3" json:"kv_reads,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *QueryReads) Reset() { *m = QueryReads{} } +func (m *QueryReads) String() string { return proto.CompactTextString(m) } +func (*QueryReads) ProtoMessage() {} +func (*QueryReads) Descriptor() ([]byte, []int) { + return fileDescriptor_kv_rwset_b744a14a894993b5, []int{11} +} +func (m *QueryReads) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_QueryReads.Unmarshal(m, b) +} +func (m *QueryReads) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_QueryReads.Marshal(b, m, deterministic) +} +func (dst *QueryReads) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryReads.Merge(dst, src) +} +func (m *QueryReads) XXX_Size() int { + return xxx_messageInfo_QueryReads.Size(m) +} +func (m *QueryReads) XXX_DiscardUnknown() { + xxx_messageInfo_QueryReads.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryReads proto.InternalMessageInfo + +func (m *QueryReads) GetKvReads() []*KVRead { + if m != nil { + return m.KvReads + } + return nil +} + +// QueryReadsMerkleSummary encapsulates the Merkle-tree hashes for the QueryReads +// This allows to reduce the size of RWSet in the presence of query results +// by storing certain hashes instead of actual results. +// maxDegree field refers to the maximum number of children in the tree at any level +// maxLevel field contains the lowest level which has lesser nodes than maxDegree (starting from leaf level) +type QueryReadsMerkleSummary struct { + MaxDegree uint32 `protobuf:"varint,1,opt,name=max_degree,json=maxDegree,proto3" json:"max_degree,omitempty"` + MaxLevel uint32 `protobuf:"varint,2,opt,name=max_level,json=maxLevel,proto3" json:"max_level,omitempty"` + MaxLevelHashes [][]byte `protobuf:"bytes,3,rep,name=max_level_hashes,json=maxLevelHashes,proto3" json:"max_level_hashes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *QueryReadsMerkleSummary) Reset() { *m = QueryReadsMerkleSummary{} } +func (m *QueryReadsMerkleSummary) String() string { return proto.CompactTextString(m) } +func (*QueryReadsMerkleSummary) ProtoMessage() {} +func (*QueryReadsMerkleSummary) Descriptor() ([]byte, []int) { + return fileDescriptor_kv_rwset_b744a14a894993b5, []int{12} +} +func (m *QueryReadsMerkleSummary) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_QueryReadsMerkleSummary.Unmarshal(m, b) +} +func (m *QueryReadsMerkleSummary) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_QueryReadsMerkleSummary.Marshal(b, m, deterministic) +} +func (dst *QueryReadsMerkleSummary) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryReadsMerkleSummary.Merge(dst, src) +} +func (m *QueryReadsMerkleSummary) XXX_Size() int { + return xxx_messageInfo_QueryReadsMerkleSummary.Size(m) +} +func (m *QueryReadsMerkleSummary) XXX_DiscardUnknown() { + xxx_messageInfo_QueryReadsMerkleSummary.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryReadsMerkleSummary proto.InternalMessageInfo + +func (m *QueryReadsMerkleSummary) GetMaxDegree() uint32 { + if m != nil { + return m.MaxDegree + } + return 0 +} + +func (m *QueryReadsMerkleSummary) GetMaxLevel() uint32 { + if m != nil { + return m.MaxLevel + } + return 0 +} + +func (m *QueryReadsMerkleSummary) GetMaxLevelHashes() [][]byte { + if m != nil { + return m.MaxLevelHashes + } + return nil +} + +func init() { + proto.RegisterType((*KVRWSet)(nil), "sdk.kvrwset.KVRWSet") + proto.RegisterType((*HashedRWSet)(nil), "sdk.kvrwset.HashedRWSet") + proto.RegisterType((*KVRead)(nil), "sdk.kvrwset.KVRead") + proto.RegisterType((*KVWrite)(nil), "sdk.kvrwset.KVWrite") + proto.RegisterType((*KVMetadataWrite)(nil), "sdk.kvrwset.KVMetadataWrite") + proto.RegisterType((*KVReadHash)(nil), "sdk.kvrwset.KVReadHash") + proto.RegisterType((*KVWriteHash)(nil), "sdk.kvrwset.KVWriteHash") + proto.RegisterType((*KVMetadataWriteHash)(nil), "sdk.kvrwset.KVMetadataWriteHash") + proto.RegisterType((*KVMetadataEntry)(nil), "sdk.kvrwset.KVMetadataEntry") + proto.RegisterType((*Version)(nil), "sdk.kvrwset.Version") + proto.RegisterType((*RangeQueryInfo)(nil), "sdk.kvrwset.RangeQueryInfo") + proto.RegisterType((*QueryReads)(nil), "sdk.kvrwset.QueryReads") + proto.RegisterType((*QueryReadsMerkleSummary)(nil), "sdk.kvrwset.QueryReadsMerkleSummary") +} + +func init() { + proto.RegisterFile("ledger/rwset/kvrwset/kv_rwset.proto", fileDescriptor_kv_rwset_b744a14a894993b5) +} + +var fileDescriptor_kv_rwset_b744a14a894993b5 = []byte{ + // 740 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xdf, 0x6b, 0xdb, 0x48, + 0x10, 0x8e, 0x7f, 0xcb, 0x63, 0x3b, 0xf1, 0x6d, 0x72, 0x44, 0xc7, 0xdd, 0x81, 0x51, 0x38, 0x30, + 0x79, 0xb0, 0xc1, 0x07, 0xc7, 0x85, 0xe3, 0x1e, 0x5a, 0xe2, 0x92, 0x92, 0x26, 0xd0, 0x0d, 0x24, + 0xd0, 0x17, 0xb1, 0x8e, 0x26, 0xb6, 0xb0, 0x25, 0xa5, 0xab, 0x95, 0x6d, 0x3d, 0x95, 0xfe, 0x75, + 0xfd, 0x47, 0xfa, 0x87, 0x94, 0x9d, 0x95, 0x63, 0xc5, 0x75, 0x0c, 0xed, 0x93, 0xb5, 0xf3, 0xcd, + 0x37, 0x3b, 0xdf, 0x37, 0xde, 0x5d, 0x38, 0x99, 0xa1, 0x37, 0x46, 0xd9, 0x97, 0x8b, 0x18, 0x55, + 0x7f, 0x3a, 0x5f, 0xfd, 0xba, 0xf4, 0xd1, 0x7b, 0x94, 0x91, 0x8a, 0x58, 0x2d, 0x8b, 0x3b, 0x5f, + 0x0b, 0x50, 0xbb, 0xbc, 0xe5, 0x77, 0x37, 0xa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 0x4d, 0x93, 0xef, 0xaf, 0x72, + 0x32, 0x21, 0x11, 0x0c, 0x22, 0x39, 0xee, 0x4d, 0xd2, 0x47, 0x94, 0xe6, 0xd9, 0xe8, 0x3d, 0x88, + 0x91, 0xf4, 0xef, 0xcd, 0x33, 0x11, 0xf7, 0xb2, 0xa0, 0x69, 0x3f, 0x93, 0xf1, 0xe1, 0x6c, 0xec, + 0xab, 0x49, 0x32, 0xea, 0xdd, 0x47, 0x41, 0x3f, 0x47, 0xed, 0x1b, 0x6a, 0xdf, 0x50, 0xfb, 0xdb, + 0x9e, 0xa1, 0x51, 0x95, 0xc0, 0xbf, 0xbf, 0x05, 0x00, 0x00, 0xff, 0xff, 0xe3, 0xe1, 0xb5, 0x07, + 0xa5, 0x06, 0x00, 0x00, +} diff --git a/fabric/protos/ledger/rwset/rwset.pb.go b/fabric/protos/ledger/rwset/rwset.pb.go new file mode 100644 index 0000000..80fda1b --- /dev/null +++ b/fabric/protos/ledger/rwset/rwset.pb.go @@ -0,0 +1,386 @@ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: ledger/rwset/rwset.proto + +package rwset // import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/ledger/rwset" + +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 TxReadWriteSet_DataModel int32 + +const ( + TxReadWriteSet_KV TxReadWriteSet_DataModel = 0 +) + +var TxReadWriteSet_DataModel_name = map[int32]string{ + 0: "KV", +} +var TxReadWriteSet_DataModel_value = map[string]int32{ + "KV": 0, +} + +func (x TxReadWriteSet_DataModel) String() string { + return proto.EnumName(TxReadWriteSet_DataModel_name, int32(x)) +} +func (TxReadWriteSet_DataModel) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_rwset_28a2ad70bffb57df, []int{0, 0} +} + +// TxReadWriteSet encapsulates a read-write set for a transaction +// DataModel specifies the enum value of the data model +// ns_rwset field specifies a list of chaincode specific read-write set (one for each chaincode) +type TxReadWriteSet struct { + DataModel TxReadWriteSet_DataModel `protobuf:"varint,1,opt,name=data_model,json=dataModel,proto3,enum=rwset.TxReadWriteSet_DataModel" json:"data_model,omitempty"` + NsRwset []*NsReadWriteSet `protobuf:"bytes,2,rep,name=ns_rwset,json=nsRwset,proto3" json:"ns_rwset,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TxReadWriteSet) Reset() { *m = TxReadWriteSet{} } +func (m *TxReadWriteSet) String() string { return proto.CompactTextString(m) } +func (*TxReadWriteSet) ProtoMessage() {} +func (*TxReadWriteSet) Descriptor() ([]byte, []int) { + return fileDescriptor_rwset_28a2ad70bffb57df, []int{0} +} +func (m *TxReadWriteSet) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TxReadWriteSet.Unmarshal(m, b) +} +func (m *TxReadWriteSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TxReadWriteSet.Marshal(b, m, deterministic) +} +func (dst *TxReadWriteSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_TxReadWriteSet.Merge(dst, src) +} +func (m *TxReadWriteSet) XXX_Size() int { + return xxx_messageInfo_TxReadWriteSet.Size(m) +} +func (m *TxReadWriteSet) XXX_DiscardUnknown() { + xxx_messageInfo_TxReadWriteSet.DiscardUnknown(m) +} + +var xxx_messageInfo_TxReadWriteSet proto.InternalMessageInfo + +func (m *TxReadWriteSet) GetDataModel() TxReadWriteSet_DataModel { + if m != nil { + return m.DataModel + } + return TxReadWriteSet_KV +} + +func (m *TxReadWriteSet) GetNsRwset() []*NsReadWriteSet { + if m != nil { + return m.NsRwset + } + return nil +} + +// NsReadWriteSet encapsulates the read-write set for a chaincode +type NsReadWriteSet struct { + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + Rwset []byte `protobuf:"bytes,2,opt,name=rwset,proto3" json:"rwset,omitempty"` + CollectionHashedRwset []*CollectionHashedReadWriteSet `protobuf:"bytes,3,rep,name=collection_hashed_rwset,json=collectionHashedRwset,proto3" json:"collection_hashed_rwset,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NsReadWriteSet) Reset() { *m = NsReadWriteSet{} } +func (m *NsReadWriteSet) String() string { return proto.CompactTextString(m) } +func (*NsReadWriteSet) ProtoMessage() {} +func (*NsReadWriteSet) Descriptor() ([]byte, []int) { + return fileDescriptor_rwset_28a2ad70bffb57df, []int{1} +} +func (m *NsReadWriteSet) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NsReadWriteSet.Unmarshal(m, b) +} +func (m *NsReadWriteSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NsReadWriteSet.Marshal(b, m, deterministic) +} +func (dst *NsReadWriteSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_NsReadWriteSet.Merge(dst, src) +} +func (m *NsReadWriteSet) XXX_Size() int { + return xxx_messageInfo_NsReadWriteSet.Size(m) +} +func (m *NsReadWriteSet) XXX_DiscardUnknown() { + xxx_messageInfo_NsReadWriteSet.DiscardUnknown(m) +} + +var xxx_messageInfo_NsReadWriteSet proto.InternalMessageInfo + +func (m *NsReadWriteSet) GetNamespace() string { + if m != nil { + return m.Namespace + } + return "" +} + +func (m *NsReadWriteSet) GetRwset() []byte { + if m != nil { + return m.Rwset + } + return nil +} + +func (m *NsReadWriteSet) GetCollectionHashedRwset() []*CollectionHashedReadWriteSet { + if m != nil { + return m.CollectionHashedRwset + } + return nil +} + +// CollectionHashedReadWriteSet encapsulate the hashed representation for the private read-write set for a collection +type CollectionHashedReadWriteSet struct { + CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` + HashedRwset []byte `protobuf:"bytes,2,opt,name=hashed_rwset,json=hashedRwset,proto3" json:"hashed_rwset,omitempty"` + PvtRwsetHash []byte `protobuf:"bytes,3,opt,name=pvt_rwset_hash,json=pvtRwsetHash,proto3" json:"pvt_rwset_hash,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CollectionHashedReadWriteSet) Reset() { *m = CollectionHashedReadWriteSet{} } +func (m *CollectionHashedReadWriteSet) String() string { return proto.CompactTextString(m) } +func (*CollectionHashedReadWriteSet) ProtoMessage() {} +func (*CollectionHashedReadWriteSet) Descriptor() ([]byte, []int) { + return fileDescriptor_rwset_28a2ad70bffb57df, []int{2} +} +func (m *CollectionHashedReadWriteSet) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CollectionHashedReadWriteSet.Unmarshal(m, b) +} +func (m *CollectionHashedReadWriteSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CollectionHashedReadWriteSet.Marshal(b, m, deterministic) +} +func (dst *CollectionHashedReadWriteSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_CollectionHashedReadWriteSet.Merge(dst, src) +} +func (m *CollectionHashedReadWriteSet) XXX_Size() int { + return xxx_messageInfo_CollectionHashedReadWriteSet.Size(m) +} +func (m *CollectionHashedReadWriteSet) XXX_DiscardUnknown() { + xxx_messageInfo_CollectionHashedReadWriteSet.DiscardUnknown(m) +} + +var xxx_messageInfo_CollectionHashedReadWriteSet proto.InternalMessageInfo + +func (m *CollectionHashedReadWriteSet) GetCollectionName() string { + if m != nil { + return m.CollectionName + } + return "" +} + +func (m *CollectionHashedReadWriteSet) GetHashedRwset() []byte { + if m != nil { + return m.HashedRwset + } + return nil +} + +func (m *CollectionHashedReadWriteSet) GetPvtRwsetHash() []byte { + if m != nil { + return m.PvtRwsetHash + } + return nil +} + +// TxPvtReadWriteSet encapsulate the private read-write set for a transaction +type TxPvtReadWriteSet struct { + DataModel TxReadWriteSet_DataModel `protobuf:"varint,1,opt,name=data_model,json=dataModel,proto3,enum=rwset.TxReadWriteSet_DataModel" json:"data_model,omitempty"` + NsPvtRwset []*NsPvtReadWriteSet `protobuf:"bytes,2,rep,name=ns_pvt_rwset,json=nsPvtRwset,proto3" json:"ns_pvt_rwset,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TxPvtReadWriteSet) Reset() { *m = TxPvtReadWriteSet{} } +func (m *TxPvtReadWriteSet) String() string { return proto.CompactTextString(m) } +func (*TxPvtReadWriteSet) ProtoMessage() {} +func (*TxPvtReadWriteSet) Descriptor() ([]byte, []int) { + return fileDescriptor_rwset_28a2ad70bffb57df, []int{3} +} +func (m *TxPvtReadWriteSet) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TxPvtReadWriteSet.Unmarshal(m, b) +} +func (m *TxPvtReadWriteSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TxPvtReadWriteSet.Marshal(b, m, deterministic) +} +func (dst *TxPvtReadWriteSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_TxPvtReadWriteSet.Merge(dst, src) +} +func (m *TxPvtReadWriteSet) XXX_Size() int { + return xxx_messageInfo_TxPvtReadWriteSet.Size(m) +} +func (m *TxPvtReadWriteSet) XXX_DiscardUnknown() { + xxx_messageInfo_TxPvtReadWriteSet.DiscardUnknown(m) +} + +var xxx_messageInfo_TxPvtReadWriteSet proto.InternalMessageInfo + +func (m *TxPvtReadWriteSet) GetDataModel() TxReadWriteSet_DataModel { + if m != nil { + return m.DataModel + } + return TxReadWriteSet_KV +} + +func (m *TxPvtReadWriteSet) GetNsPvtRwset() []*NsPvtReadWriteSet { + if m != nil { + return m.NsPvtRwset + } + return nil +} + +// NsPvtReadWriteSet encapsulates the private read-write set for a chaincode +type NsPvtReadWriteSet struct { + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + CollectionPvtRwset []*CollectionPvtReadWriteSet `protobuf:"bytes,2,rep,name=collection_pvt_rwset,json=collectionPvtRwset,proto3" json:"collection_pvt_rwset,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NsPvtReadWriteSet) Reset() { *m = NsPvtReadWriteSet{} } +func (m *NsPvtReadWriteSet) String() string { return proto.CompactTextString(m) } +func (*NsPvtReadWriteSet) ProtoMessage() {} +func (*NsPvtReadWriteSet) Descriptor() ([]byte, []int) { + return fileDescriptor_rwset_28a2ad70bffb57df, []int{4} +} +func (m *NsPvtReadWriteSet) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NsPvtReadWriteSet.Unmarshal(m, b) +} +func (m *NsPvtReadWriteSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NsPvtReadWriteSet.Marshal(b, m, deterministic) +} +func (dst *NsPvtReadWriteSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_NsPvtReadWriteSet.Merge(dst, src) +} +func (m *NsPvtReadWriteSet) XXX_Size() int { + return xxx_messageInfo_NsPvtReadWriteSet.Size(m) +} +func (m *NsPvtReadWriteSet) XXX_DiscardUnknown() { + xxx_messageInfo_NsPvtReadWriteSet.DiscardUnknown(m) +} + +var xxx_messageInfo_NsPvtReadWriteSet proto.InternalMessageInfo + +func (m *NsPvtReadWriteSet) GetNamespace() string { + if m != nil { + return m.Namespace + } + return "" +} + +func (m *NsPvtReadWriteSet) GetCollectionPvtRwset() []*CollectionPvtReadWriteSet { + if m != nil { + return m.CollectionPvtRwset + } + return nil +} + +// CollectionPvtReadWriteSet encapsulates the private read-write set for a collection +type CollectionPvtReadWriteSet struct { + CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` + Rwset []byte `protobuf:"bytes,2,opt,name=rwset,proto3" json:"rwset,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CollectionPvtReadWriteSet) Reset() { *m = CollectionPvtReadWriteSet{} } +func (m *CollectionPvtReadWriteSet) String() string { return proto.CompactTextString(m) } +func (*CollectionPvtReadWriteSet) ProtoMessage() {} +func (*CollectionPvtReadWriteSet) Descriptor() ([]byte, []int) { + return fileDescriptor_rwset_28a2ad70bffb57df, []int{5} +} +func (m *CollectionPvtReadWriteSet) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CollectionPvtReadWriteSet.Unmarshal(m, b) +} +func (m *CollectionPvtReadWriteSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CollectionPvtReadWriteSet.Marshal(b, m, deterministic) +} +func (dst *CollectionPvtReadWriteSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_CollectionPvtReadWriteSet.Merge(dst, src) +} +func (m *CollectionPvtReadWriteSet) XXX_Size() int { + return xxx_messageInfo_CollectionPvtReadWriteSet.Size(m) +} +func (m *CollectionPvtReadWriteSet) XXX_DiscardUnknown() { + xxx_messageInfo_CollectionPvtReadWriteSet.DiscardUnknown(m) +} + +var xxx_messageInfo_CollectionPvtReadWriteSet proto.InternalMessageInfo + +func (m *CollectionPvtReadWriteSet) GetCollectionName() string { + if m != nil { + return m.CollectionName + } + return "" +} + +func (m *CollectionPvtReadWriteSet) GetRwset() []byte { + if m != nil { + return m.Rwset + } + return nil +} + +func init() { + proto.RegisterType((*TxReadWriteSet)(nil), "sdk.rwset.TxReadWriteSet") + proto.RegisterType((*NsReadWriteSet)(nil), "sdk.rwset.NsReadWriteSet") + proto.RegisterType((*CollectionHashedReadWriteSet)(nil), "sdk.rwset.CollectionHashedReadWriteSet") + proto.RegisterType((*TxPvtReadWriteSet)(nil), "sdk.rwset.TxPvtReadWriteSet") + proto.RegisterType((*NsPvtReadWriteSet)(nil), "sdk.rwset.NsPvtReadWriteSet") + proto.RegisterType((*CollectionPvtReadWriteSet)(nil), "sdk.rwset.CollectionPvtReadWriteSet") + proto.RegisterEnum("sdk.rwset.TxReadWriteSet_DataModel", TxReadWriteSet_DataModel_name, TxReadWriteSet_DataModel_value) +} + +func init() { proto.RegisterFile("ledger/rwset/rwset.proto", fileDescriptor_rwset_28a2ad70bffb57df) } + +var fileDescriptor_rwset_28a2ad70bffb57df = []byte{ + // 421 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0x4f, 0x6f, 0xd3, 0x30, + 0x18, 0xc6, 0x71, 0xab, 0x16, 0xf2, 0x36, 0x0a, 0xd4, 0xb4, 0x22, 0x48, 0x95, 0x28, 0x05, 0x89, + 0x8a, 0x43, 0x02, 0xe5, 0xc6, 0x81, 0x03, 0x70, 0x40, 0x42, 0x54, 0xc8, 0x54, 0x4c, 0xea, 0x0e, + 0x91, 0x9b, 0x78, 0x4d, 0xa4, 0xfc, 0x53, 0xec, 0x75, 0xdd, 0x07, 0xd8, 0x79, 0xbb, 0xed, 0xbc, + 0x6f, 0x3a, 0xd5, 0x4e, 0xd3, 0x24, 0xdd, 0xbf, 0xc3, 0x2e, 0x51, 0xfc, 0xfa, 0x79, 0xf2, 0xfc, + 0xec, 0x37, 0x2f, 0x98, 0x21, 0xf3, 0x96, 0x2c, 0xb3, 0xb3, 0x13, 0xce, 0x84, 0x7a, 0x5a, 0x69, + 0x96, 0x88, 0x04, 0xb7, 0xe4, 0x62, 0x74, 0x89, 0xc0, 0x98,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x4f, 0x57, 0x42, 0x2a, 0x36, 0xf9, 0xa3, 0x73, 0x04, 0xdd, 0xd9, 0xfa, 0xef, 0x4a, 0x3c, 0x6a, + 0x4f, 0xbf, 0x82, 0x1e, 0x73, 0xa7, 0x88, 0xcf, 0xfb, 0x6a, 0x16, 0x7d, 0xad, 0xe5, 0x11, 0x88, + 0x65, 0x49, 0x5e, 0xd2, 0x19, 0x82, 0xee, 0x9e, 0xe2, 0x9e, 0x5e, 0x12, 0xe8, 0x95, 0xee, 0xad, + 0x9e, 0x3b, 0xdc, 0x6b, 0x59, 0x3d, 0x1f, 0xbb, 0x95, 0x2d, 0xc9, 0x31, 0x87, 0xd7, 0xb7, 0x1a, + 0x1e, 0xde, 0xa8, 0x1b, 0xff, 0xb2, 0xef, 0x0e, 0x7c, 0x4c, 0xb2, 0xa5, 0xe5, 0x9f, 0xa6, 0x2c, + 0x53, 0x23, 0x67, 0x1d, 0xd1, 0x45, 0x16, 0xb8, 0x6a, 0xda, 0xb8, 0x95, 0x17, 0xa5, 0x7a, 0xfe, + 0x79, 0x19, 0x08, 0xff, 0x78, 0x61, 0xb9, 0x49, 0x64, 0x97, 0x2c, 0xb6, 0xb2, 0xd8, 0xca, 0x62, + 0x97, 0x47, 0x77, 0xd1, 0x96, 0xc5, 0x2f, 0xd7, 0x01, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x8a, 0xfa, + 0x65, 0xd1, 0x03, 0x00, 0x00, +} diff --git a/fabric/protos/msp/identities.pb.go b/fabric/protos/msp/identities.pb.go new file mode 100644 index 0000000..d8d03af --- /dev/null +++ b/fabric/protos/msp/identities.pb.go @@ -0,0 +1,183 @@ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: msp/identities.proto + +package msp // import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/msp" + +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 + +// This struct represents an Identity +// (with its MSP identifier) to be used +// to serialize it and deserialize it +type SerializedIdentity struct { + // The identifier of the associated membership service provider + Mspid string `protobuf:"bytes,1,opt,name=mspid,proto3" json:"mspid,omitempty"` + // the Identity, serialized according to the rules of its MPS + IdBytes []byte `protobuf:"bytes,2,opt,name=id_bytes,json=idBytes,proto3" json:"id_bytes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SerializedIdentity) Reset() { *m = SerializedIdentity{} } +func (m *SerializedIdentity) String() string { return proto.CompactTextString(m) } +func (*SerializedIdentity) ProtoMessage() {} +func (*SerializedIdentity) Descriptor() ([]byte, []int) { + return fileDescriptor_identities_8fa8af3e5bf2070a, []int{0} +} +func (m *SerializedIdentity) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SerializedIdentity.Unmarshal(m, b) +} +func (m *SerializedIdentity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SerializedIdentity.Marshal(b, m, deterministic) +} +func (dst *SerializedIdentity) XXX_Merge(src proto.Message) { + xxx_messageInfo_SerializedIdentity.Merge(dst, src) +} +func (m *SerializedIdentity) XXX_Size() int { + return xxx_messageInfo_SerializedIdentity.Size(m) +} +func (m *SerializedIdentity) XXX_DiscardUnknown() { + xxx_messageInfo_SerializedIdentity.DiscardUnknown(m) +} + +var xxx_messageInfo_SerializedIdentity proto.InternalMessageInfo + +func (m *SerializedIdentity) GetMspid() string { + if m != nil { + return m.Mspid + } + return "" +} + +func (m *SerializedIdentity) GetIdBytes() []byte { + if m != nil { + return m.IdBytes + } + return nil +} + +// This struct represents an Idemix Identity +// to be used to serialize it and deserialize it. +// The IdemixMSP will first serialize an idemix identity to bytes using +// this proto, and then uses these bytes as id_bytes in SerializedIdentity +type SerializedIdemixIdentity struct { + // nym_x is the X-component of the pseudonym elliptic curve point. + // It is a []byte representation of an amcl.BIG + // The pseudonym can be seen as a public key of the identity, it is used to verify signatures. + NymX []byte `protobuf:"bytes,1,opt,name=nym_x,json=nymX,proto3" json:"nym_x,omitempty"` + // nym_y is the Y-component of the pseudonym elliptic curve point. + // It is a []byte representation of an amcl.BIG + // The pseudonym can be seen as a public key of the identity, it is used to verify signatures. + NymY []byte `protobuf:"bytes,2,opt,name=nym_y,json=nymY,proto3" json:"nym_y,omitempty"` + // ou contains the organizational unit of the idemix identity + Ou []byte `protobuf:"bytes,3,opt,name=ou,proto3" json:"ou,omitempty"` + // role contains the role of this identity (e.g., ADMIN or MEMBER) + Role []byte `protobuf:"bytes,4,opt,name=role,proto3" json:"role,omitempty"` + // proof contains the cryptographic evidence that this identity is valid + Proof []byte `protobuf:"bytes,5,opt,name=proof,proto3" json:"proof,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SerializedIdemixIdentity) Reset() { *m = SerializedIdemixIdentity{} } +func (m *SerializedIdemixIdentity) String() string { return proto.CompactTextString(m) } +func (*SerializedIdemixIdentity) ProtoMessage() {} +func (*SerializedIdemixIdentity) Descriptor() ([]byte, []int) { + return fileDescriptor_identities_8fa8af3e5bf2070a, []int{1} +} +func (m *SerializedIdemixIdentity) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SerializedIdemixIdentity.Unmarshal(m, b) +} +func (m *SerializedIdemixIdentity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SerializedIdemixIdentity.Marshal(b, m, deterministic) +} +func (dst *SerializedIdemixIdentity) XXX_Merge(src proto.Message) { + xxx_messageInfo_SerializedIdemixIdentity.Merge(dst, src) +} +func (m *SerializedIdemixIdentity) XXX_Size() int { + return xxx_messageInfo_SerializedIdemixIdentity.Size(m) +} +func (m *SerializedIdemixIdentity) XXX_DiscardUnknown() { + xxx_messageInfo_SerializedIdemixIdentity.DiscardUnknown(m) +} + +var xxx_messageInfo_SerializedIdemixIdentity proto.InternalMessageInfo + +func (m *SerializedIdemixIdentity) GetNymX() []byte { + if m != nil { + return m.NymX + } + return nil +} + +func (m *SerializedIdemixIdentity) GetNymY() []byte { + if m != nil { + return m.NymY + } + return nil +} + +func (m *SerializedIdemixIdentity) GetOu() []byte { + if m != nil { + return m.Ou + } + return nil +} + +func (m *SerializedIdemixIdentity) GetRole() []byte { + if m != nil { + return m.Role + } + return nil +} + +func (m *SerializedIdemixIdentity) GetProof() []byte { + if m != nil { + return m.Proof + } + return nil +} + +func init() { + proto.RegisterType((*SerializedIdentity)(nil), "sdk.msp.SerializedIdentity") + proto.RegisterType((*SerializedIdemixIdentity)(nil), "sdk.msp.SerializedIdemixIdentity") +} + +func init() { proto.RegisterFile("msp/identities.proto", fileDescriptor_identities_8fa8af3e5bf2070a) } + +var fileDescriptor_identities_8fa8af3e5bf2070a = []byte{ + // 238 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x8f, 0x3f, 0x4f, 0xc3, 0x30, + 0x10, 0x47, 0x95, 0x34, 0xe1, 0x8f, 0x55, 0x31, 0x98, 0x0e, 0x66, 0x2b, 0x9d, 0x32, 0xc5, 0x03, + 0xdf, 0xa0, 0x12, 0x03, 0x03, 0x4b, 0x58, 0x80, 0xa5, 0x6a, 0xea, 0x6b, 0x7a, 0x52, 0x2e, 0x67, + 0xd9, 0x8e, 0x54, 0x33, 0xf0, 0xd9, 0x51, 0x62, 0x40, 0xb0, 0xdd, 0xef, 0xe9, 0xe9, 0xc9, 0x16, + 0x2b, 0xf2, 0x56, 0xa3, 0x81, 0x21, 0x60, 0x40, 0xf0, 0xb5, 0x75, 0x1c, 0x58, 0x2e, 0xc8, 0xdb, + 0xcd, 0xa3, 0x90, 0x2f, 0xe0, 0x70, 0xdf, 0xe3, 0x07, 0x98, 0xa7, 0xa4, 0x44, 0xb9, 0x12, 0x25, + 0x79, 0x8b, 0x46, 0x65, 0xeb, 0xac, 0xba, 0x6e, 0xd2, 0x90, 0x77, 0xe2, 0x0a, 0xcd, 0xae, 0x8d, + 0x01, 0xbc, 0xca, 0xd7, 0x59, 0xb5, 0x6c, 0x2e, 0xd1, 0x6c, 0xa7, 0xb9, 0xf9, 0x14, 0xea, 0x5f, + 0x86, 0xf0, 0xfc, 0x1b, 0xbb, 0x15, 0xe5, 0x10, 0x69, 0x77, 0x9e, 0x63, 0xcb, 0xa6, 0x18, 0x22, + 0xbd, 0xfe, 0xc0, 0xf8, 0x1d, 0x9a, 0xe0, 0x9b, 0xbc, 0x11, 0x39, 0x8f, 0x6a, 0x31, 0x93, 0x9c, + 0x47, 0x29, 0x45, 0xe1, 0xb8, 0x07, 0x55, 0x24, 0x67, 0xba, 0xa7, 0xa7, 0x59, 0xc7, 0x7c, 0x54, + 0xe5, 0x0c, 0xd3, 0xd8, 0x3e, 0x8b, 0x7b, 0x76, 0x5d, 0x7d, 0x8a, 0x16, 0x5c, 0x0f, 0xa6, 0x03, + 0x57, 0x1f, 0xf7, 0xad, 0xc3, 0x43, 0xfa, 0xab, 0xaf, 0xc9, 0xdb, 0xf7, 0xaa, 0xc3, 0x70, 0x1a, + 0xdb, 0xfa, 0xc0, 0xa4, 0xff, 0x98, 0x3a, 0x99, 0x3a, 0x99, 0x9a, 0xbc, 0x6d, 0x2f, 0xe6, 0xfb, + 0xe1, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x13, 0xdc, 0xc8, 0x62, 0x39, 0x01, 0x00, 0x00, +} diff --git a/fabric/protos/msp/msp_config.pb.go b/fabric/protos/msp/msp_config.pb.go new file mode 100644 index 0000000..c77e05a --- /dev/null +++ b/fabric/protos/msp/msp_config.pb.go @@ -0,0 +1,747 @@ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: msp/msp_config.proto + +package msp // import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/msp" + +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 + +// MSPConfig collects all the configuration information for +// an MSP. The Config field should be unmarshalled in a way +// that depends on the Type +type MSPConfig struct { + // Type holds the type of the MSP; the default one would + // be of type FABRIC implementing an X.509 based provider + Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` + // Config is MSP dependent configuration info + Config []byte `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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} +} +func (m *MSPConfig) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MSPConfig.Unmarshal(m, b) +} +func (m *MSPConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MSPConfig.Marshal(b, m, deterministic) +} +func (dst *MSPConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_MSPConfig.Merge(dst, src) +} +func (m *MSPConfig) XXX_Size() int { + return xxx_messageInfo_MSPConfig.Size(m) +} +func (m *MSPConfig) XXX_DiscardUnknown() { + xxx_messageInfo_MSPConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_MSPConfig proto.InternalMessageInfo + +func (m *MSPConfig) GetType() int32 { + if m != nil { + return m.Type + } + return 0 +} + +func (m *MSPConfig) GetConfig() []byte { + if m != nil { + return m.Config + } + return nil +} + +// FabricMSPConfig collects all the configuration information for +// a Fabric MSP. +// Here we assume a default certificate validation policy, where +// any certificate signed by any of the listed rootCA certs would +// be considered as valid under this MSP. +// This MSP may or may not come with a signing identity. If it does, +// it can also issue signing identities. If it does not, it can only +// be used to validate and verify certificates. +type FabricMSPConfig struct { + // Name holds the identifier of the MSP; MSP identifier + // is chosen by the application that governs this MSP. + // For example, and assuming the default implementation of MSP, + // that is X.509-based and considers a single Issuer, + // this can refer to the Subject OU field or the Issuer OU field. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // List of root certificates trusted by this MSP + // they are used upon certificate validation (see + // comment for IntermediateCerts below) + RootCerts [][]byte `protobuf:"bytes,2,rep,name=root_certs,json=rootCerts,proto3" json:"root_certs,omitempty"` + // List of intermediate certificates trusted by this MSP; + // they are used upon certificate validation as follows: + // validation attempts to build a path from the certificate + // to be validated (which is at one end of the path) and + // one of the certs in the RootCerts field (which is at + // the other end of the path). If the path is longer than + // 2, certificates in the middle are searched within the + // IntermediateCerts pool + IntermediateCerts [][]byte `protobuf:"bytes,3,rep,name=intermediate_certs,json=intermediateCerts,proto3" json:"intermediate_certs,omitempty"` + // Identity denoting the administrator of this MSP + Admins [][]byte `protobuf:"bytes,4,rep,name=admins,proto3" json:"admins,omitempty"` + // Identity revocation list + RevocationList [][]byte `protobuf:"bytes,5,rep,name=revocation_list,json=revocationList,proto3" json:"revocation_list,omitempty"` + // SigningIdentity holds information on the signing identity + // this peer is to use, and which is to be imported by the + // MSP defined before + SigningIdentity *SigningIdentityInfo `protobuf:"bytes,6,opt,name=signing_identity,json=signingIdentity,proto3" json:"signing_identity,omitempty"` + // OrganizationalUnitIdentifiers holds one or more + // fabric organizational unit identifiers that belong to + // this MSP configuration + OrganizationalUnitIdentifiers []*FabricOUIdentifier `protobuf:"bytes,7,rep,name=organizational_unit_identifiers,json=organizationalUnitIdentifiers,proto3" json:"organizational_unit_identifiers,omitempty"` + // FabricCryptoConfig contains the configuration parameters + // for the cryptographic algorithms used by this MSP + CryptoConfig *FabricCryptoConfig `protobuf:"bytes,8,opt,name=crypto_config,json=cryptoConfig,proto3" json:"crypto_config,omitempty"` + // List of TLS root certificates trusted by this MSP. + // They are returned by GetTLSRootCerts. + TlsRootCerts [][]byte `protobuf:"bytes,9,rep,name=tls_root_certs,json=tlsRootCerts,proto3" json:"tls_root_certs,omitempty"` + // List of TLS intermediate certificates trusted by this MSP; + // They are returned by GetTLSIntermediateCerts. + TlsIntermediateCerts [][]byte `protobuf:"bytes,10,rep,name=tls_intermediate_certs,json=tlsIntermediateCerts,proto3" json:"tls_intermediate_certs,omitempty"` + // fabric_node_ous contains the configuration to distinguish clients from peers from orderers + // based on the OUs. + FabricNodeOus *FabricNodeOUs `protobuf:"bytes,11,opt,name=fabric_node_ous,json=fabricNodeOus,proto3" json:"fabric_node_ous,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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} +} +func (m *FabricMSPConfig) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FabricMSPConfig.Unmarshal(m, b) +} +func (m *FabricMSPConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FabricMSPConfig.Marshal(b, m, deterministic) +} +func (dst *FabricMSPConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_FabricMSPConfig.Merge(dst, src) +} +func (m *FabricMSPConfig) XXX_Size() int { + return xxx_messageInfo_FabricMSPConfig.Size(m) +} +func (m *FabricMSPConfig) XXX_DiscardUnknown() { + xxx_messageInfo_FabricMSPConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_FabricMSPConfig proto.InternalMessageInfo + +func (m *FabricMSPConfig) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *FabricMSPConfig) GetRootCerts() [][]byte { + if m != nil { + return m.RootCerts + } + return nil +} + +func (m *FabricMSPConfig) GetIntermediateCerts() [][]byte { + if m != nil { + return m.IntermediateCerts + } + return nil +} + +func (m *FabricMSPConfig) GetAdmins() [][]byte { + if m != nil { + return m.Admins + } + return nil +} + +func (m *FabricMSPConfig) GetRevocationList() [][]byte { + if m != nil { + return m.RevocationList + } + return nil +} + +func (m *FabricMSPConfig) GetSigningIdentity() *SigningIdentityInfo { + if m != nil { + return m.SigningIdentity + } + return nil +} + +func (m *FabricMSPConfig) GetOrganizationalUnitIdentifiers() []*FabricOUIdentifier { + if m != nil { + return m.OrganizationalUnitIdentifiers + } + return nil +} + +func (m *FabricMSPConfig) GetCryptoConfig() *FabricCryptoConfig { + if m != nil { + return m.CryptoConfig + } + return nil +} + +func (m *FabricMSPConfig) GetTlsRootCerts() [][]byte { + if m != nil { + return m.TlsRootCerts + } + return nil +} + +func (m *FabricMSPConfig) GetTlsIntermediateCerts() [][]byte { + if m != nil { + return m.TlsIntermediateCerts + } + return nil +} + +func (m *FabricMSPConfig) GetFabricNodeOus() *FabricNodeOUs { + if m != nil { + return m.FabricNodeOus + } + return nil +} + +// FabricCryptoConfig contains configuration parameters +// for the cryptographic algorithms used by the MSP +// this configuration refers to +type FabricCryptoConfig struct { + // SignatureHashFamily is a string representing the hash family to be used + // during sign and verify operations. + // Allowed values are "SHA2" and "SHA3". + SignatureHashFamily string `protobuf:"bytes,1,opt,name=signature_hash_family,json=signatureHashFamily,proto3" json:"signature_hash_family,omitempty"` + // IdentityIdentifierHashFunction is a string representing the hash function + // to be used during the computation of the identity identifier of an MSP identity. + // Allowed values are "SHA256", "SHA384" and "SHA3_256", "SHA3_384". + IdentityIdentifierHashFunction string `protobuf:"bytes,2,opt,name=identity_identifier_hash_function,json=identityIdentifierHashFunction,proto3" json:"identity_identifier_hash_function,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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} +} +func (m *FabricCryptoConfig) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FabricCryptoConfig.Unmarshal(m, b) +} +func (m *FabricCryptoConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FabricCryptoConfig.Marshal(b, m, deterministic) +} +func (dst *FabricCryptoConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_FabricCryptoConfig.Merge(dst, src) +} +func (m *FabricCryptoConfig) XXX_Size() int { + return xxx_messageInfo_FabricCryptoConfig.Size(m) +} +func (m *FabricCryptoConfig) XXX_DiscardUnknown() { + xxx_messageInfo_FabricCryptoConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_FabricCryptoConfig proto.InternalMessageInfo + +func (m *FabricCryptoConfig) GetSignatureHashFamily() string { + if m != nil { + return m.SignatureHashFamily + } + return "" +} + +func (m *FabricCryptoConfig) GetIdentityIdentifierHashFunction() string { + if m != nil { + return m.IdentityIdentifierHashFunction + } + return "" +} + +// IdemixMSPConfig collects all the configuration information for +// an Idemix MSP. +type IdemixMSPConfig struct { + // Name holds the identifier of the MSP + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // ipk represents the (serialized) issuer public key + Ipk []byte `protobuf:"bytes,2,opt,name=ipk,proto3" json:"ipk,omitempty"` + // signer may contain crypto material to configure a default signer + Signer *IdemixMSPSignerConfig `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"` + // revocation_pk is the public key used for revocation of credentials + RevocationPk []byte `protobuf:"bytes,4,opt,name=revocation_pk,json=revocationPk,proto3" json:"revocation_pk,omitempty"` + // epoch represents the current epoch (time interval) used for revocation + Epoch int64 `protobuf:"varint,5,opt,name=epoch,proto3" json:"epoch,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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} +} +func (m *IdemixMSPConfig) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_IdemixMSPConfig.Unmarshal(m, b) +} +func (m *IdemixMSPConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_IdemixMSPConfig.Marshal(b, m, deterministic) +} +func (dst *IdemixMSPConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_IdemixMSPConfig.Merge(dst, src) +} +func (m *IdemixMSPConfig) XXX_Size() int { + return xxx_messageInfo_IdemixMSPConfig.Size(m) +} +func (m *IdemixMSPConfig) XXX_DiscardUnknown() { + xxx_messageInfo_IdemixMSPConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_IdemixMSPConfig proto.InternalMessageInfo + +func (m *IdemixMSPConfig) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *IdemixMSPConfig) GetIpk() []byte { + if m != nil { + return m.Ipk + } + return nil +} + +func (m *IdemixMSPConfig) GetSigner() *IdemixMSPSignerConfig { + if m != nil { + return m.Signer + } + return nil +} + +func (m *IdemixMSPConfig) GetRevocationPk() []byte { + if m != nil { + return m.RevocationPk + } + return nil +} + +func (m *IdemixMSPConfig) GetEpoch() int64 { + if m != nil { + return m.Epoch + } + return 0 +} + +// IdemixMSPSIgnerConfig contains the crypto material to set up an idemix signing identity +type IdemixMSPSignerConfig struct { + // cred represents the serialized idemix credential of the default signer + Cred []byte `protobuf:"bytes,1,opt,name=cred,proto3" json:"cred,omitempty"` + // sk is the secret key of the default signer, corresponding to credential Cred + Sk []byte `protobuf:"bytes,2,opt,name=sk,proto3" json:"sk,omitempty"` + // organizational_unit_identifier defines the organizational unit the default signer is in + OrganizationalUnitIdentifier string `protobuf:"bytes,3,opt,name=organizational_unit_identifier,json=organizationalUnitIdentifier,proto3" json:"organizational_unit_identifier,omitempty"` + // role defines whether the default signer is admin, peer, member or client + Role int32 `protobuf:"varint,4,opt,name=role,proto3" json:"role,omitempty"` + // enrollment_id contains the enrollment id of this signer + EnrollmentId string `protobuf:"bytes,5,opt,name=enrollment_id,json=enrollmentId,proto3" json:"enrollment_id,omitempty"` + // credential_revocation_information contains a serialized CredentialRevocationInformation + CredentialRevocationInformation []byte `protobuf:"bytes,6,opt,name=credential_revocation_information,json=credentialRevocationInformation,proto3" json:"credential_revocation_information,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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} +} +func (m *IdemixMSPSignerConfig) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_IdemixMSPSignerConfig.Unmarshal(m, b) +} +func (m *IdemixMSPSignerConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_IdemixMSPSignerConfig.Marshal(b, m, deterministic) +} +func (dst *IdemixMSPSignerConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_IdemixMSPSignerConfig.Merge(dst, src) +} +func (m *IdemixMSPSignerConfig) XXX_Size() int { + return xxx_messageInfo_IdemixMSPSignerConfig.Size(m) +} +func (m *IdemixMSPSignerConfig) XXX_DiscardUnknown() { + xxx_messageInfo_IdemixMSPSignerConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_IdemixMSPSignerConfig proto.InternalMessageInfo + +func (m *IdemixMSPSignerConfig) GetCred() []byte { + if m != nil { + return m.Cred + } + return nil +} + +func (m *IdemixMSPSignerConfig) GetSk() []byte { + if m != nil { + return m.Sk + } + return nil +} + +func (m *IdemixMSPSignerConfig) GetOrganizationalUnitIdentifier() string { + if m != nil { + return m.OrganizationalUnitIdentifier + } + return "" +} + +func (m *IdemixMSPSignerConfig) GetRole() int32 { + if m != nil { + return m.Role + } + return 0 +} + +func (m *IdemixMSPSignerConfig) GetEnrollmentId() string { + if m != nil { + return m.EnrollmentId + } + return "" +} + +func (m *IdemixMSPSignerConfig) GetCredentialRevocationInformation() []byte { + if m != nil { + return m.CredentialRevocationInformation + } + return nil +} + +// SigningIdentityInfo represents the configuration information +// related to the signing identity the peer is to use for generating +// endorsements +type SigningIdentityInfo struct { + // PublicSigner carries the public information of the signing + // identity. For an X.509 provider this would be represented by + // an X.509 certificate + PublicSigner []byte `protobuf:"bytes,1,opt,name=public_signer,json=publicSigner,proto3" json:"public_signer,omitempty"` + // PrivateSigner denotes a reference to the private key of the + // peer's signing identity + PrivateSigner *KeyInfo `protobuf:"bytes,2,opt,name=private_signer,json=privateSigner,proto3" json:"private_signer,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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} +} +func (m *SigningIdentityInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SigningIdentityInfo.Unmarshal(m, b) +} +func (m *SigningIdentityInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SigningIdentityInfo.Marshal(b, m, deterministic) +} +func (dst *SigningIdentityInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_SigningIdentityInfo.Merge(dst, src) +} +func (m *SigningIdentityInfo) XXX_Size() int { + return xxx_messageInfo_SigningIdentityInfo.Size(m) +} +func (m *SigningIdentityInfo) XXX_DiscardUnknown() { + xxx_messageInfo_SigningIdentityInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_SigningIdentityInfo proto.InternalMessageInfo + +func (m *SigningIdentityInfo) GetPublicSigner() []byte { + if m != nil { + return m.PublicSigner + } + return nil +} + +func (m *SigningIdentityInfo) GetPrivateSigner() *KeyInfo { + if m != nil { + return m.PrivateSigner + } + return nil +} + +// KeyInfo represents a (secret) key that is either already stored +// in the bccsp/keystore or key material to be imported to the +// bccsp key-store. In later versions it may contain also a +// keystore identifier +type KeyInfo struct { + // Identifier of the key inside the default keystore; this for + // the case of Software BCCSP as well as the HSM BCCSP would be + // the SKI of the key + KeyIdentifier string `protobuf:"bytes,1,opt,name=key_identifier,json=keyIdentifier,proto3" json:"key_identifier,omitempty"` + // KeyMaterial (optional) for the key to be imported; this is + // properly encoded key bytes, prefixed by the type of the key + KeyMaterial []byte `protobuf:"bytes,2,opt,name=key_material,json=keyMaterial,proto3" json:"key_material,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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} +} +func (m *KeyInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_KeyInfo.Unmarshal(m, b) +} +func (m *KeyInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_KeyInfo.Marshal(b, m, deterministic) +} +func (dst *KeyInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_KeyInfo.Merge(dst, src) +} +func (m *KeyInfo) XXX_Size() int { + return xxx_messageInfo_KeyInfo.Size(m) +} +func (m *KeyInfo) XXX_DiscardUnknown() { + xxx_messageInfo_KeyInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_KeyInfo proto.InternalMessageInfo + +func (m *KeyInfo) GetKeyIdentifier() string { + if m != nil { + return m.KeyIdentifier + } + return "" +} + +func (m *KeyInfo) GetKeyMaterial() []byte { + if m != nil { + return m.KeyMaterial + } + return nil +} + +// FabricOUIdentifier represents an organizational unit and +// its related chain of trust identifier. +type FabricOUIdentifier struct { + // Certificate represents the second certificate in a certification chain. + // (Notice that the first certificate in a certification chain is supposed + // to be the certificate of an identity). + // It must correspond to the certificate of root or intermediate CA + // recognized by the MSP this message belongs to. + // Starting from this certificate, a certification chain is computed + // and bound to the OrganizationUnitIdentifier specified + Certificate []byte `protobuf:"bytes,1,opt,name=certificate,proto3" json:"certificate,omitempty"` + // OrganizationUnitIdentifier defines the organizational unit under the + // MSP identified with MSPIdentifier + OrganizationalUnitIdentifier string `protobuf:"bytes,2,opt,name=organizational_unit_identifier,json=organizationalUnitIdentifier,proto3" json:"organizational_unit_identifier,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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} +} +func (m *FabricOUIdentifier) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FabricOUIdentifier.Unmarshal(m, b) +} +func (m *FabricOUIdentifier) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FabricOUIdentifier.Marshal(b, m, deterministic) +} +func (dst *FabricOUIdentifier) XXX_Merge(src proto.Message) { + xxx_messageInfo_FabricOUIdentifier.Merge(dst, src) +} +func (m *FabricOUIdentifier) XXX_Size() int { + return xxx_messageInfo_FabricOUIdentifier.Size(m) +} +func (m *FabricOUIdentifier) XXX_DiscardUnknown() { + xxx_messageInfo_FabricOUIdentifier.DiscardUnknown(m) +} + +var xxx_messageInfo_FabricOUIdentifier proto.InternalMessageInfo + +func (m *FabricOUIdentifier) GetCertificate() []byte { + if m != nil { + return m.Certificate + } + return nil +} + +func (m *FabricOUIdentifier) GetOrganizationalUnitIdentifier() string { + if m != nil { + return m.OrganizationalUnitIdentifier + } + return "" +} + +// FabricNodeOUs contains configuration to tell apart clients from peers from orderers +// based on OUs. If NodeOUs recognition is enabled then an msp identity +// that does not contain any of the specified OU will be considered invalid. +type FabricNodeOUs struct { + // If true then an msp identity that does not contain any of the specified OU will be considered invalid. + Enable bool `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"` + // 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"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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} +} +func (m *FabricNodeOUs) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FabricNodeOUs.Unmarshal(m, b) +} +func (m *FabricNodeOUs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FabricNodeOUs.Marshal(b, m, deterministic) +} +func (dst *FabricNodeOUs) XXX_Merge(src proto.Message) { + xxx_messageInfo_FabricNodeOUs.Merge(dst, src) +} +func (m *FabricNodeOUs) XXX_Size() int { + return xxx_messageInfo_FabricNodeOUs.Size(m) +} +func (m *FabricNodeOUs) XXX_DiscardUnknown() { + xxx_messageInfo_FabricNodeOUs.DiscardUnknown(m) +} + +var xxx_messageInfo_FabricNodeOUs proto.InternalMessageInfo + +func (m *FabricNodeOUs) GetEnable() bool { + if m != nil { + return m.Enable + } + return false +} + +func (m *FabricNodeOUs) GetClientOuIdentifier() *FabricOUIdentifier { + if m != nil { + return m.ClientOuIdentifier + } + return nil +} + +func (m *FabricNodeOUs) GetPeerOuIdentifier() *FabricOUIdentifier { + if m != nil { + return m.PeerOuIdentifier + } + return nil +} + +func init() { + proto.RegisterType((*MSPConfig)(nil), "sdk.msp.MSPConfig") + proto.RegisterType((*FabricMSPConfig)(nil), "sdk.msp.FabricMSPConfig") + proto.RegisterType((*FabricCryptoConfig)(nil), "sdk.msp.FabricCryptoConfig") + proto.RegisterType((*IdemixMSPConfig)(nil), "sdk.msp.IdemixMSPConfig") + proto.RegisterType((*IdemixMSPSignerConfig)(nil), "sdk.msp.IdemixMSPSignerConfig") + proto.RegisterType((*SigningIdentityInfo)(nil), "sdk.msp.SigningIdentityInfo") + proto.RegisterType((*KeyInfo)(nil), "sdk.msp.KeyInfo") + proto.RegisterType((*FabricOUIdentifier)(nil), "sdk.msp.FabricOUIdentifier") + proto.RegisterType((*FabricNodeOUs)(nil), "sdk.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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x56, 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, +} diff --git a/fabric/protos/msp/msp_principal.pb.go b/fabric/protos/msp/msp_principal.pb.go new file mode 100644 index 0000000..36e9722 --- /dev/null +++ b/fabric/protos/msp/msp_principal.pb.go @@ -0,0 +1,441 @@ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: msp/msp_principal.proto + +package msp // import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/msp" + +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 MSPPrincipal_Classification int32 + +const ( + MSPPrincipal_ROLE MSPPrincipal_Classification = 0 + // one of a member of MSP network, and the one of an + // administrator of an MSP network + MSPPrincipal_ORGANIZATION_UNIT MSPPrincipal_Classification = 1 + // groupping of entities, per MSP affiliation + // E.g., this can well be represented by an MSP's + // Organization unit + MSPPrincipal_IDENTITY MSPPrincipal_Classification = 2 + // identity + MSPPrincipal_ANONYMITY MSPPrincipal_Classification = 3 + // an identity to be anonymous or nominal. + MSPPrincipal_COMBINED MSPPrincipal_Classification = 4 +) + +var MSPPrincipal_Classification_name = map[int32]string{ + 0: "ROLE", + 1: "ORGANIZATION_UNIT", + 2: "IDENTITY", + 3: "ANONYMITY", + 4: "COMBINED", +} +var MSPPrincipal_Classification_value = map[string]int32{ + "ROLE": 0, + "ORGANIZATION_UNIT": 1, + "IDENTITY": 2, + "ANONYMITY": 3, + "COMBINED": 4, +} + +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} +} + +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 +) + +var MSPRole_MSPRoleType_name = map[int32]string{ + 0: "MEMBER", + 1: "ADMIN", + 2: "CLIENT", + 3: "PEER", +} +var MSPRole_MSPRoleType_value = map[string]int32{ + "MEMBER": 0, + "ADMIN": 1, + "CLIENT": 2, + "PEER": 3, +} + +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} +} + +type MSPIdentityAnonymity_MSPIdentityAnonymityType int32 + +const ( + MSPIdentityAnonymity_NOMINAL MSPIdentityAnonymity_MSPIdentityAnonymityType = 0 + MSPIdentityAnonymity_ANONYMOUS MSPIdentityAnonymity_MSPIdentityAnonymityType = 1 +) + +var MSPIdentityAnonymity_MSPIdentityAnonymityType_name = map[int32]string{ + 0: "NOMINAL", + 1: "ANONYMOUS", +} +var MSPIdentityAnonymity_MSPIdentityAnonymityType_value = map[string]int32{ + "NOMINAL": 0, + "ANONYMOUS": 1, +} + +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} +} + +// MSPPrincipal aims to represent an MSP-centric set of identities. +// In particular, this structure allows for definition of +// - a group of identities that are member of the same MSP +// - a group of identities that are member of the same organization unit +// in the same MSP +// - a group of identities that are administering a specific MSP +// - a specific identity +// Expressing these groups is done given two fields of the fields below +// - Classification, that defines the type of classification of identities +// in an MSP this principal would be defined on; Classification can take +// three values: +// (i) ByMSPRole: that represents a classification of identities within +// MSP based on one of the two pre-defined MSP rules, "member" and "admin" +// (ii) ByOrganizationUnit: that represents a classification of identities +// within MSP based on the organization unit an identity belongs to +// (iii)ByIdentity that denotes that MSPPrincipal is mapped to a single +// identity/certificate; this would mean that the Principal bytes +// message +type MSPPrincipal struct { + // Classification describes the way that one should process + // Principal. An Classification value of "ByOrganizationUnit" reflects + // that "Principal" contains the name of an organization this MSP + // handles. A Classification value "ByIdentity" means that + // "Principal" contains a specific identity. Default value + // denotes that Principal contains one of the groups by + // default supported by all MSPs ("admin" or "member"). + PrincipalClassification MSPPrincipal_Classification `protobuf:"varint,1,opt,name=principal_classification,json=principalClassification,proto3,enum=common.MSPPrincipal_Classification" json:"principal_classification,omitempty"` + // Principal completes the policy principal definition. For the default + // principal types, Principal can be either "Admin" or "Member". + // For the ByOrganizationUnit/ByIdentity values of Classification, + // PolicyPrincipal acquires its value from an organization unit or + // identity, respectively. + // For the Combined Classification type, the Principal is a marshalled + // CombinedPrincipal. + Principal []byte `protobuf:"bytes,2,opt,name=principal,proto3" json:"principal,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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} +} +func (m *MSPPrincipal) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MSPPrincipal.Unmarshal(m, b) +} +func (m *MSPPrincipal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MSPPrincipal.Marshal(b, m, deterministic) +} +func (dst *MSPPrincipal) XXX_Merge(src proto.Message) { + xxx_messageInfo_MSPPrincipal.Merge(dst, src) +} +func (m *MSPPrincipal) XXX_Size() int { + return xxx_messageInfo_MSPPrincipal.Size(m) +} +func (m *MSPPrincipal) XXX_DiscardUnknown() { + xxx_messageInfo_MSPPrincipal.DiscardUnknown(m) +} + +var xxx_messageInfo_MSPPrincipal proto.InternalMessageInfo + +func (m *MSPPrincipal) GetPrincipalClassification() MSPPrincipal_Classification { + if m != nil { + return m.PrincipalClassification + } + return MSPPrincipal_ROLE +} + +func (m *MSPPrincipal) GetPrincipal() []byte { + if m != nil { + return m.Principal + } + return nil +} + +// OrganizationUnit governs the organization of the Principal +// field of a policy principal when a specific organization unity members +// are to be defined within a policy principal. +type OrganizationUnit struct { + // MSPIdentifier represents the identifier of the MSP this organization unit + // refers to + MspIdentifier string `protobuf:"bytes,1,opt,name=msp_identifier,json=mspIdentifier,proto3" json:"msp_identifier,omitempty"` + // OrganizationUnitIdentifier defines the organizational unit under the + // MSP identified with MSPIdentifier + OrganizationalUnitIdentifier string `protobuf:"bytes,2,opt,name=organizational_unit_identifier,json=organizationalUnitIdentifier,proto3" json:"organizational_unit_identifier,omitempty"` + // CertifiersIdentifier is the hash of certificates chain of trust + // related to this organizational unit + CertifiersIdentifier []byte `protobuf:"bytes,3,opt,name=certifiers_identifier,json=certifiersIdentifier,proto3" json:"certifiers_identifier,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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} +} +func (m *OrganizationUnit) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_OrganizationUnit.Unmarshal(m, b) +} +func (m *OrganizationUnit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_OrganizationUnit.Marshal(b, m, deterministic) +} +func (dst *OrganizationUnit) XXX_Merge(src proto.Message) { + xxx_messageInfo_OrganizationUnit.Merge(dst, src) +} +func (m *OrganizationUnit) XXX_Size() int { + return xxx_messageInfo_OrganizationUnit.Size(m) +} +func (m *OrganizationUnit) XXX_DiscardUnknown() { + xxx_messageInfo_OrganizationUnit.DiscardUnknown(m) +} + +var xxx_messageInfo_OrganizationUnit proto.InternalMessageInfo + +func (m *OrganizationUnit) GetMspIdentifier() string { + if m != nil { + return m.MspIdentifier + } + return "" +} + +func (m *OrganizationUnit) GetOrganizationalUnitIdentifier() string { + if m != nil { + return m.OrganizationalUnitIdentifier + } + return "" +} + +func (m *OrganizationUnit) GetCertifiersIdentifier() []byte { + if m != nil { + return m.CertifiersIdentifier + } + return nil +} + +// MSPRole governs the organization of the Principal +// field of an MSPPrincipal when it aims to define one of the +// two dedicated roles within an MSP: Admin and Members. +type MSPRole struct { + // MSPIdentifier represents the identifier of the MSP this principal + // refers to + MspIdentifier string `protobuf:"bytes,1,opt,name=msp_identifier,json=mspIdentifier,proto3" json:"msp_identifier,omitempty"` + // MSPRoleType defines which of the available, pre-defined MSP-roles + // an identiy should posess inside the MSP with identifier MSPidentifier + Role MSPRole_MSPRoleType `protobuf:"varint,2,opt,name=role,proto3,enum=common.MSPRole_MSPRoleType" json:"role,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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} +} +func (m *MSPRole) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MSPRole.Unmarshal(m, b) +} +func (m *MSPRole) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MSPRole.Marshal(b, m, deterministic) +} +func (dst *MSPRole) XXX_Merge(src proto.Message) { + xxx_messageInfo_MSPRole.Merge(dst, src) +} +func (m *MSPRole) XXX_Size() int { + return xxx_messageInfo_MSPRole.Size(m) +} +func (m *MSPRole) XXX_DiscardUnknown() { + xxx_messageInfo_MSPRole.DiscardUnknown(m) +} + +var xxx_messageInfo_MSPRole proto.InternalMessageInfo + +func (m *MSPRole) GetMspIdentifier() string { + if m != nil { + return m.MspIdentifier + } + return "" +} + +func (m *MSPRole) GetRole() MSPRole_MSPRoleType { + if m != nil { + return m.Role + } + return MSPRole_MEMBER +} + +// MSPIdentityAnonymity can be used to enforce an identity to be anonymous or nominal. +type MSPIdentityAnonymity struct { + AnonymityType MSPIdentityAnonymity_MSPIdentityAnonymityType `protobuf:"varint,1,opt,name=anonymity_type,json=anonymityType,proto3,enum=common.MSPIdentityAnonymity_MSPIdentityAnonymityType" json:"anonymity_type,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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} +} +func (m *MSPIdentityAnonymity) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MSPIdentityAnonymity.Unmarshal(m, b) +} +func (m *MSPIdentityAnonymity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MSPIdentityAnonymity.Marshal(b, m, deterministic) +} +func (dst *MSPIdentityAnonymity) XXX_Merge(src proto.Message) { + xxx_messageInfo_MSPIdentityAnonymity.Merge(dst, src) +} +func (m *MSPIdentityAnonymity) XXX_Size() int { + return xxx_messageInfo_MSPIdentityAnonymity.Size(m) +} +func (m *MSPIdentityAnonymity) XXX_DiscardUnknown() { + xxx_messageInfo_MSPIdentityAnonymity.DiscardUnknown(m) +} + +var xxx_messageInfo_MSPIdentityAnonymity proto.InternalMessageInfo + +func (m *MSPIdentityAnonymity) GetAnonymityType() MSPIdentityAnonymity_MSPIdentityAnonymityType { + if m != nil { + return m.AnonymityType + } + return MSPIdentityAnonymity_NOMINAL +} + +// CombinedPrincipal governs the organization of the Principal +// field of a policy principal when principal_classification has +// indicated that a combined form of principals is required +type CombinedPrincipal struct { + // Principals refer to combined principals + Principals []*MSPPrincipal `protobuf:"bytes,1,rep,name=principals,proto3" json:"principals,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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} +} +func (m *CombinedPrincipal) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CombinedPrincipal.Unmarshal(m, b) +} +func (m *CombinedPrincipal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CombinedPrincipal.Marshal(b, m, deterministic) +} +func (dst *CombinedPrincipal) XXX_Merge(src proto.Message) { + xxx_messageInfo_CombinedPrincipal.Merge(dst, src) +} +func (m *CombinedPrincipal) XXX_Size() int { + return xxx_messageInfo_CombinedPrincipal.Size(m) +} +func (m *CombinedPrincipal) XXX_DiscardUnknown() { + xxx_messageInfo_CombinedPrincipal.DiscardUnknown(m) +} + +var xxx_messageInfo_CombinedPrincipal proto.InternalMessageInfo + +func (m *CombinedPrincipal) GetPrincipals() []*MSPPrincipal { + if m != nil { + return m.Principals + } + return nil +} + +func init() { + proto.RegisterType((*MSPPrincipal)(nil), "sdk.common.MSPPrincipal") + proto.RegisterType((*OrganizationUnit)(nil), "sdk.common.OrganizationUnit") + proto.RegisterType((*MSPRole)(nil), "sdk.common.MSPRole") + proto.RegisterType((*MSPIdentityAnonymity)(nil), "sdk.common.MSPIdentityAnonymity") + proto.RegisterType((*CombinedPrincipal)(nil), "sdk.common.CombinedPrincipal") + proto.RegisterEnum("sdk.common.MSPPrincipal_Classification", MSPPrincipal_Classification_name, MSPPrincipal_Classification_value) + proto.RegisterEnum("sdk.common.MSPRole_MSPRoleType", MSPRole_MSPRoleType_name, MSPRole_MSPRoleType_value) + proto.RegisterEnum("sdk.common.MSPIdentityAnonymity_MSPIdentityAnonymityType", MSPIdentityAnonymity_MSPIdentityAnonymityType_name, MSPIdentityAnonymity_MSPIdentityAnonymityType_value) +} + +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, 0x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0x95, 0xcf, 0x92, 0x2a, + 0x48, 0x65, 0x71, 0xbd, 0x3c, 0x89, 0xee, 0xa1, 0x78, 0x10, 0xa9, 0xdf, 0x15, 0x38, 0x37, 0xe7, + 0xb6, 0x23, 0x02, 0xf6, 0xbf, 0xd3, 0x0e, 0xe1, 0x34, 0x11, 0x01, 0x2b, 0x67, 0xea, 0x8c, 0x5e, + 0x4b, 0x37, 0x56, 0x74, 0xd9, 0x7d, 0xdd, 0x3c, 0x66, 0x4e, 0x09, 0xaa, 0x9f, 0xa1, 0x29, 0x25, + 0x31, 0xc0, 0x99, 0x69, 0x98, 0x63, 0xc3, 0x41, 0x27, 0xb8, 0x01, 0xaf, 0xf4, 0xa9, 0x49, 0x28, + 0x52, 0x8a, 0xf4, 0x64, 0x46, 0x0c, 0xea, 0xa2, 0x5a, 0x71, 0x31, 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, +} diff --git a/fabric/protos/orderer/configuration.pb.go b/fabric/protos/orderer/configuration.pb.go new file mode 100644 index 0000000..5c3afc1 --- /dev/null +++ b/fabric/protos/orderer/configuration.pb.go @@ -0,0 +1,288 @@ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: orderer/configuration.proto + +package orderer // import "github.com/hyperledger/fabric-sdk-go/third_party/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 ConsensusType struct { + 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"` + 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_3289caae61166f4d, []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 +} + +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_3289caae61166f4d, []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_3289caae61166f4d, []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_3289caae61166f4d, []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_3289caae61166f4d, []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), "sdk.orderer.ConsensusType") + proto.RegisterType((*BatchSize)(nil), "sdk.orderer.BatchSize") + proto.RegisterType((*BatchTimeout)(nil), "sdk.orderer.BatchTimeout") + proto.RegisterType((*KafkaBrokers)(nil), "sdk.orderer.KafkaBrokers") + proto.RegisterType((*ChannelRestrictions)(nil), "sdk.orderer.ChannelRestrictions") +} + +func init() { + proto.RegisterFile("orderer/configuration.proto", fileDescriptor_configuration_3289caae61166f4d) +} + +var fileDescriptor_configuration_3289caae61166f4d = []byte{ + // 333 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 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+ 0x3e, 0x5b, 0xd5, 0x84, 0x19, 0x12, 0x61, 0x7a, 0x87, 0x8f, 0x2c, 0xbe, 0xbc, 0x59, 0x57, 0xde, + 0xdb, 0xb2, 0xb9, 0x5d, 0xeb, 0x58, 0x56, 0x28, 0x1b, 0xcd, 0x5d, 0x36, 0xd1, 0x7d, 0x39, 0x44, + 0xbb, 0x4a, 0x43, 0xbe, 0x41, 0x76, 0x86, 0x90, 0xe4, 0x19, 0x49, 0x19, 0x32, 0xee, 0x4b, 0xd7, + 0xd9, 0x8c, 0x0c, 0x39, 0x48, 0xef, 0x99, 0xad, 0xf6, 0x05, 0x08, 0x81, 0x97, 0x08, 0x95, 0xa6, + 0x32, 0x31, 0x3f, 0xaa, 0xf8, 0x9a, 0xcd, 0xcc, 0x42, 0xbf, 0x61, 0xc7, 0xd1, 0xb4, 0x82, 0xd6, + 0xa6, 0x0c, 0x3f, 0xd8, 0xa3, 0xa4, 0xdc, 0x2f, 0xba, 0x1a, 0xe9, 0x82, 0x69, 0x8e, 0xe4, 0x67, + 0x10, 0x53, 0x99, 0xf4, 0x97, 0x50, 0xfe, 0x70, 0x89, 0xcf, 0x5d, 0x5e, 0xea, 0xa2, 0x89, 0xfd, + 0x44, 0x56, 0xc1, 0x1d, 0x1d, 0xf4, 0x74, 0xd0, 0xd3, 0xc1, 0x40, 0xc7, 0x7f, 0xad, 0x7e, 0xf9, + 0x09, 0x00, 0x00, 0xff, 0xff, 0xb5, 0x9c, 0xb6, 0xa5, 0xe6, 0x01, 0x00, 0x00, +} diff --git a/fabric/protos/peer/chaincode.pb.go b/fabric/protos/peer/chaincode.pb.go new file mode 100644 index 0000000..32e242f --- /dev/null +++ b/fabric/protos/peer/chaincode.pb.go @@ -0,0 +1,473 @@ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: peer/chaincode.proto + +package peer // import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/peer" + +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 + +// Confidentiality Levels +type ConfidentialityLevel int32 + +const ( + ConfidentialityLevel_PUBLIC ConfidentialityLevel = 0 + ConfidentialityLevel_CONFIDENTIAL ConfidentialityLevel = 1 +) + +var ConfidentialityLevel_name = map[int32]string{ + 0: "PUBLIC", + 1: "CONFIDENTIAL", +} +var ConfidentialityLevel_value = map[string]int32{ + "PUBLIC": 0, + "CONFIDENTIAL": 1, +} + +func (x ConfidentialityLevel) String() string { + return proto.EnumName(ConfidentialityLevel_name, int32(x)) +} +func (ConfidentialityLevel) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_chaincode_d56d9efe15650cad, []int{0} +} + +type ChaincodeSpec_Type int32 + +const ( + ChaincodeSpec_UNDEFINED ChaincodeSpec_Type = 0 + ChaincodeSpec_GOLANG ChaincodeSpec_Type = 1 + ChaincodeSpec_NODE ChaincodeSpec_Type = 2 + ChaincodeSpec_CAR ChaincodeSpec_Type = 3 + ChaincodeSpec_JAVA ChaincodeSpec_Type = 4 +) + +var ChaincodeSpec_Type_name = map[int32]string{ + 0: "UNDEFINED", + 1: "GOLANG", + 2: "NODE", + 3: "CAR", + 4: "JAVA", +} +var ChaincodeSpec_Type_value = map[string]int32{ + "UNDEFINED": 0, + "GOLANG": 1, + "NODE": 2, + "CAR": 3, + "JAVA": 4, +} + +func (x ChaincodeSpec_Type) String() string { + return proto.EnumName(ChaincodeSpec_Type_name, int32(x)) +} +func (ChaincodeSpec_Type) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_chaincode_d56d9efe15650cad, []int{2, 0} +} + +type ChaincodeDeploymentSpec_ExecutionEnvironment int32 + +const ( + ChaincodeDeploymentSpec_DOCKER ChaincodeDeploymentSpec_ExecutionEnvironment = 0 + ChaincodeDeploymentSpec_SYSTEM ChaincodeDeploymentSpec_ExecutionEnvironment = 1 +) + +var ChaincodeDeploymentSpec_ExecutionEnvironment_name = map[int32]string{ + 0: "DOCKER", + 1: "SYSTEM", +} +var ChaincodeDeploymentSpec_ExecutionEnvironment_value = map[string]int32{ + "DOCKER": 0, + "SYSTEM": 1, +} + +func (x ChaincodeDeploymentSpec_ExecutionEnvironment) String() string { + return proto.EnumName(ChaincodeDeploymentSpec_ExecutionEnvironment_name, int32(x)) +} +func (ChaincodeDeploymentSpec_ExecutionEnvironment) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_chaincode_d56d9efe15650cad, []int{3, 0} +} + +// ChaincodeID contains the path as specified by the deploy transaction +// that created it as well as the hashCode that is generated by the +// system for the path. From the user level (ie, CLI, REST API and so on) +// deploy transaction is expected to provide the path and other requests +// are expected to provide the hashCode. The other value will be ignored. +// Internally, the structure could contain both values. For instance, the +// hashCode will be set when first generated using the path +type ChaincodeID struct { + // deploy transaction will use the path + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + // all other requests will use the name (really a hashcode) generated by + // the deploy transaction + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // user friendly version name for the chaincode + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ChaincodeID) Reset() { *m = ChaincodeID{} } +func (m *ChaincodeID) String() string { return proto.CompactTextString(m) } +func (*ChaincodeID) ProtoMessage() {} +func (*ChaincodeID) Descriptor() ([]byte, []int) { + return fileDescriptor_chaincode_d56d9efe15650cad, []int{0} +} +func (m *ChaincodeID) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ChaincodeID.Unmarshal(m, b) +} +func (m *ChaincodeID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ChaincodeID.Marshal(b, m, deterministic) +} +func (dst *ChaincodeID) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChaincodeID.Merge(dst, src) +} +func (m *ChaincodeID) XXX_Size() int { + return xxx_messageInfo_ChaincodeID.Size(m) +} +func (m *ChaincodeID) XXX_DiscardUnknown() { + xxx_messageInfo_ChaincodeID.DiscardUnknown(m) +} + +var xxx_messageInfo_ChaincodeID proto.InternalMessageInfo + +func (m *ChaincodeID) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *ChaincodeID) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ChaincodeID) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +// Carries the chaincode function and its arguments. +// UnmarshalJSON in transaction.go converts the string-based REST/JSON input to +// the []byte-based current ChaincodeInput structure. +type ChaincodeInput struct { + Args [][]byte `protobuf:"bytes,1,rep,name=args,proto3" json:"args,omitempty"` + Decorations map[string][]byte `protobuf:"bytes,2,rep,name=decorations,proto3" json:"decorations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ChaincodeInput) Reset() { *m = ChaincodeInput{} } +func (m *ChaincodeInput) String() string { return proto.CompactTextString(m) } +func (*ChaincodeInput) ProtoMessage() {} +func (*ChaincodeInput) Descriptor() ([]byte, []int) { + return fileDescriptor_chaincode_d56d9efe15650cad, []int{1} +} +func (m *ChaincodeInput) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ChaincodeInput.Unmarshal(m, b) +} +func (m *ChaincodeInput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ChaincodeInput.Marshal(b, m, deterministic) +} +func (dst *ChaincodeInput) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChaincodeInput.Merge(dst, src) +} +func (m *ChaincodeInput) XXX_Size() int { + return xxx_messageInfo_ChaincodeInput.Size(m) +} +func (m *ChaincodeInput) XXX_DiscardUnknown() { + xxx_messageInfo_ChaincodeInput.DiscardUnknown(m) +} + +var xxx_messageInfo_ChaincodeInput proto.InternalMessageInfo + +func (m *ChaincodeInput) GetArgs() [][]byte { + if m != nil { + return m.Args + } + return nil +} + +func (m *ChaincodeInput) GetDecorations() map[string][]byte { + if m != nil { + return m.Decorations + } + return nil +} + +// Carries the chaincode specification. This is the actual metadata required for +// defining a chaincode. +type ChaincodeSpec struct { + Type ChaincodeSpec_Type `protobuf:"varint,1,opt,name=type,proto3,enum=protos.ChaincodeSpec_Type" json:"type,omitempty"` + ChaincodeId *ChaincodeID `protobuf:"bytes,2,opt,name=chaincode_id,json=chaincodeId,proto3" json:"chaincode_id,omitempty"` + Input *ChaincodeInput `protobuf:"bytes,3,opt,name=input,proto3" json:"input,omitempty"` + Timeout int32 `protobuf:"varint,4,opt,name=timeout,proto3" json:"timeout,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ChaincodeSpec) Reset() { *m = ChaincodeSpec{} } +func (m *ChaincodeSpec) String() string { return proto.CompactTextString(m) } +func (*ChaincodeSpec) ProtoMessage() {} +func (*ChaincodeSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_chaincode_d56d9efe15650cad, []int{2} +} +func (m *ChaincodeSpec) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ChaincodeSpec.Unmarshal(m, b) +} +func (m *ChaincodeSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ChaincodeSpec.Marshal(b, m, deterministic) +} +func (dst *ChaincodeSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChaincodeSpec.Merge(dst, src) +} +func (m *ChaincodeSpec) XXX_Size() int { + return xxx_messageInfo_ChaincodeSpec.Size(m) +} +func (m *ChaincodeSpec) XXX_DiscardUnknown() { + xxx_messageInfo_ChaincodeSpec.DiscardUnknown(m) +} + +var xxx_messageInfo_ChaincodeSpec proto.InternalMessageInfo + +func (m *ChaincodeSpec) GetType() ChaincodeSpec_Type { + if m != nil { + return m.Type + } + return ChaincodeSpec_UNDEFINED +} + +func (m *ChaincodeSpec) GetChaincodeId() *ChaincodeID { + if m != nil { + return m.ChaincodeId + } + return nil +} + +func (m *ChaincodeSpec) GetInput() *ChaincodeInput { + if m != nil { + return m.Input + } + return nil +} + +func (m *ChaincodeSpec) GetTimeout() int32 { + if m != nil { + return m.Timeout + } + return 0 +} + +// Specify the deployment of a chaincode. +// TODO: Define `codePackage`. +type ChaincodeDeploymentSpec struct { + ChaincodeSpec *ChaincodeSpec `protobuf:"bytes,1,opt,name=chaincode_spec,json=chaincodeSpec,proto3" json:"chaincode_spec,omitempty"` + CodePackage []byte `protobuf:"bytes,3,opt,name=code_package,json=codePackage,proto3" json:"code_package,omitempty"` + ExecEnv ChaincodeDeploymentSpec_ExecutionEnvironment `protobuf:"varint,4,opt,name=exec_env,json=execEnv,proto3,enum=protos.ChaincodeDeploymentSpec_ExecutionEnvironment" json:"exec_env,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ChaincodeDeploymentSpec) Reset() { *m = ChaincodeDeploymentSpec{} } +func (m *ChaincodeDeploymentSpec) String() string { return proto.CompactTextString(m) } +func (*ChaincodeDeploymentSpec) ProtoMessage() {} +func (*ChaincodeDeploymentSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_chaincode_d56d9efe15650cad, []int{3} +} +func (m *ChaincodeDeploymentSpec) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ChaincodeDeploymentSpec.Unmarshal(m, b) +} +func (m *ChaincodeDeploymentSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ChaincodeDeploymentSpec.Marshal(b, m, deterministic) +} +func (dst *ChaincodeDeploymentSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChaincodeDeploymentSpec.Merge(dst, src) +} +func (m *ChaincodeDeploymentSpec) XXX_Size() int { + return xxx_messageInfo_ChaincodeDeploymentSpec.Size(m) +} +func (m *ChaincodeDeploymentSpec) XXX_DiscardUnknown() { + xxx_messageInfo_ChaincodeDeploymentSpec.DiscardUnknown(m) +} + +var xxx_messageInfo_ChaincodeDeploymentSpec proto.InternalMessageInfo + +func (m *ChaincodeDeploymentSpec) GetChaincodeSpec() *ChaincodeSpec { + if m != nil { + return m.ChaincodeSpec + } + return nil +} + +func (m *ChaincodeDeploymentSpec) GetCodePackage() []byte { + if m != nil { + return m.CodePackage + } + return nil +} + +func (m *ChaincodeDeploymentSpec) GetExecEnv() ChaincodeDeploymentSpec_ExecutionEnvironment { + if m != nil { + return m.ExecEnv + } + return ChaincodeDeploymentSpec_DOCKER +} + +// Carries the chaincode function and its arguments. +type ChaincodeInvocationSpec struct { + ChaincodeSpec *ChaincodeSpec `protobuf:"bytes,1,opt,name=chaincode_spec,json=chaincodeSpec,proto3" json:"chaincode_spec,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ChaincodeInvocationSpec) Reset() { *m = ChaincodeInvocationSpec{} } +func (m *ChaincodeInvocationSpec) String() string { return proto.CompactTextString(m) } +func (*ChaincodeInvocationSpec) ProtoMessage() {} +func (*ChaincodeInvocationSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_chaincode_d56d9efe15650cad, []int{4} +} +func (m *ChaincodeInvocationSpec) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ChaincodeInvocationSpec.Unmarshal(m, b) +} +func (m *ChaincodeInvocationSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ChaincodeInvocationSpec.Marshal(b, m, deterministic) +} +func (dst *ChaincodeInvocationSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChaincodeInvocationSpec.Merge(dst, src) +} +func (m *ChaincodeInvocationSpec) XXX_Size() int { + return xxx_messageInfo_ChaincodeInvocationSpec.Size(m) +} +func (m *ChaincodeInvocationSpec) XXX_DiscardUnknown() { + xxx_messageInfo_ChaincodeInvocationSpec.DiscardUnknown(m) +} + +var xxx_messageInfo_ChaincodeInvocationSpec proto.InternalMessageInfo + +func (m *ChaincodeInvocationSpec) GetChaincodeSpec() *ChaincodeSpec { + if m != nil { + return m.ChaincodeSpec + } + return nil +} + +// LifecycleEvent is used as the payload of the chaincode event emitted by LSCC +type LifecycleEvent struct { + ChaincodeName string `protobuf:"bytes,1,opt,name=chaincode_name,json=chaincodeName,proto3" json:"chaincode_name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LifecycleEvent) Reset() { *m = LifecycleEvent{} } +func (m *LifecycleEvent) String() string { return proto.CompactTextString(m) } +func (*LifecycleEvent) ProtoMessage() {} +func (*LifecycleEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_chaincode_d56d9efe15650cad, []int{5} +} +func (m *LifecycleEvent) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LifecycleEvent.Unmarshal(m, b) +} +func (m *LifecycleEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LifecycleEvent.Marshal(b, m, deterministic) +} +func (dst *LifecycleEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_LifecycleEvent.Merge(dst, src) +} +func (m *LifecycleEvent) XXX_Size() int { + return xxx_messageInfo_LifecycleEvent.Size(m) +} +func (m *LifecycleEvent) XXX_DiscardUnknown() { + xxx_messageInfo_LifecycleEvent.DiscardUnknown(m) +} + +var xxx_messageInfo_LifecycleEvent proto.InternalMessageInfo + +func (m *LifecycleEvent) GetChaincodeName() string { + if m != nil { + return m.ChaincodeName + } + return "" +} + +func init() { + proto.RegisterType((*ChaincodeID)(nil), "sdk.protos.ChaincodeID") + proto.RegisterType((*ChaincodeInput)(nil), "sdk.protos.ChaincodeInput") + proto.RegisterMapType((map[string][]byte)(nil), "sdk.protos.ChaincodeInput.DecorationsEntry") + proto.RegisterType((*ChaincodeSpec)(nil), "sdk.protos.ChaincodeSpec") + proto.RegisterType((*ChaincodeDeploymentSpec)(nil), "sdk.protos.ChaincodeDeploymentSpec") + proto.RegisterType((*ChaincodeInvocationSpec)(nil), "sdk.protos.ChaincodeInvocationSpec") + proto.RegisterType((*LifecycleEvent)(nil), "sdk.protos.LifecycleEvent") + proto.RegisterEnum("sdk.protos.ConfidentialityLevel", ConfidentialityLevel_name, ConfidentialityLevel_value) + proto.RegisterEnum("sdk.protos.ChaincodeSpec_Type", ChaincodeSpec_Type_name, ChaincodeSpec_Type_value) + proto.RegisterEnum("sdk.protos.ChaincodeDeploymentSpec_ExecutionEnvironment", ChaincodeDeploymentSpec_ExecutionEnvironment_name, ChaincodeDeploymentSpec_ExecutionEnvironment_value) +} + +func init() { proto.RegisterFile("peer/chaincode.proto", fileDescriptor_chaincode_d56d9efe15650cad) } + +var fileDescriptor_chaincode_d56d9efe15650cad = []byte{ + // 632 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x6d, 0x6f, 0xda, 0x3c, + 0x14, 0x6d, 0x80, 0xbe, 0xdd, 0x50, 0x94, 0xc7, 0x0f, 0xcf, 0x33, 0xd4, 0x4f, 0x2c, 0xd2, 0x34, + 0x36, 0x4d, 0x41, 0x62, 0xd5, 0x36, 0x4d, 0x53, 0x25, 0x4a, 0xd2, 0x2a, 0x1d, 0x83, 0xca, 0x6d, + 0x27, 0x6d, 0x5f, 0x50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0x6e, 0x1c, 0x16, 0xcf, 0xda, 0x1b, 0xd4, 0x76, 0x41, + 0x6d, 0x17, 0xd4, 0xb6, 0xa2, 0xde, 0x14, 0x4f, 0xca, 0xdb, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, + 0xea, 0x1f, 0x3b, 0xe4, 0x71, 0x04, 0x00, 0x00, +} diff --git a/fabric/protos/peer/chaincode_event.pb.go b/fabric/protos/peer/chaincode_event.pb.go new file mode 100644 index 0000000..1410ef3 --- /dev/null +++ b/fabric/protos/peer/chaincode_event.pb.go @@ -0,0 +1,113 @@ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: peer/chaincode_event.proto + +package peer // import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/peer" + +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 + +// ChaincodeEvent is used for events and registrations that are specific to chaincode +// string type - "chaincode" +type ChaincodeEvent struct { + ChaincodeId string `protobuf:"bytes,1,opt,name=chaincode_id,json=chaincodeId,proto3" json:"chaincode_id,omitempty"` + TxId string `protobuf:"bytes,2,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` + EventName string `protobuf:"bytes,3,opt,name=event_name,json=eventName,proto3" json:"event_name,omitempty"` + Payload []byte `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ChaincodeEvent) Reset() { *m = ChaincodeEvent{} } +func (m *ChaincodeEvent) String() string { return proto.CompactTextString(m) } +func (*ChaincodeEvent) ProtoMessage() {} +func (*ChaincodeEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_chaincode_event_b240c71081bd7c2d, []int{0} +} +func (m *ChaincodeEvent) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ChaincodeEvent.Unmarshal(m, b) +} +func (m *ChaincodeEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ChaincodeEvent.Marshal(b, m, deterministic) +} +func (dst *ChaincodeEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChaincodeEvent.Merge(dst, src) +} +func (m *ChaincodeEvent) XXX_Size() int { + return xxx_messageInfo_ChaincodeEvent.Size(m) +} +func (m *ChaincodeEvent) XXX_DiscardUnknown() { + xxx_messageInfo_ChaincodeEvent.DiscardUnknown(m) +} + +var xxx_messageInfo_ChaincodeEvent proto.InternalMessageInfo + +func (m *ChaincodeEvent) GetChaincodeId() string { + if m != nil { + return m.ChaincodeId + } + return "" +} + +func (m *ChaincodeEvent) GetTxId() string { + if m != nil { + return m.TxId + } + return "" +} + +func (m *ChaincodeEvent) GetEventName() string { + if m != nil { + return m.EventName + } + return "" +} + +func (m *ChaincodeEvent) GetPayload() []byte { + if m != nil { + return m.Payload + } + return nil +} + +func init() { + proto.RegisterType((*ChaincodeEvent)(nil), "sdk.protos.ChaincodeEvent") +} + +func init() { + proto.RegisterFile("peer/chaincode_event.proto", fileDescriptor_chaincode_event_b240c71081bd7c2d) +} + +var fileDescriptor_chaincode_event_b240c71081bd7c2d = []byte{ + // 218 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2a, 0x48, 0x4d, 0x2d, + 0xd2, 0x4f, 0xce, 0x48, 0xcc, 0xcc, 0x4b, 0xce, 0x4f, 0x49, 0x8d, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, + 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x53, 0xc5, 0x4a, 0x8d, 0x8c, 0x5c, 0x7c, + 0xce, 0x30, 0x15, 0xae, 0x20, 0x05, 0x42, 0x8a, 0x5c, 0x3c, 0x08, 0x3d, 0x99, 0x29, 0x12, 0x8c, + 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0xdc, 0x70, 0x31, 0xcf, 0x14, 0x21, 0x61, 0x2e, 0xd6, 0x92, 0x0a, + 0x90, 0x1c, 0x13, 0x58, 0x8e, 0xa5, 0xa4, 0xc2, 0x33, 0x45, 0x48, 0x96, 0x8b, 0x0b, 0x6c, 0x43, + 0x7c, 0x5e, 0x62, 0x6e, 0xaa, 0x04, 0x33, 0x58, 0x86, 0x13, 0x2c, 0xe2, 0x97, 0x98, 0x9b, 0x2a, + 0x24, 0xc1, 0xc5, 0x5e, 0x90, 0x58, 0x99, 0x93, 0x9f, 0x98, 0x22, 0xc1, 0xa2, 0xc0, 0xa8, 0xc1, + 0x13, 0x04, 0xe3, 0x3a, 0xa5, 0x71, 0x29, 0xe5, 0x17, 0xa5, 0xeb, 0x65, 0x54, 0x16, 0xa4, 0x16, + 0xe5, 0xa4, 0xa6, 0xa4, 0xa7, 0x16, 0xe9, 0xa5, 0x25, 0x26, 0x15, 0x65, 0x26, 0x43, 0xdc, 0x5a, + 0xac, 0x07, 0xf2, 0x87, 0x93, 0x28, 0xaa, 0x33, 0x03, 0x12, 0x93, 0xb3, 0x13, 0xd3, 0x53, 0xa3, + 0x34, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x91, 0x4c, 0xd0, 0x87, + 0x98, 0xa0, 0x0f, 0x31, 0x41, 0x1f, 0x64, 0x42, 0x12, 0xc4, 0xcf, 0xc6, 0x80, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x4a, 0x9d, 0xa8, 0x17, 0x18, 0x01, 0x00, 0x00, +} diff --git a/fabric/protos/peer/configuration.pb.go b/fabric/protos/peer/configuration.pb.go new file mode 100644 index 0000000..3c98f1e --- /dev/null +++ b/fabric/protos/peer/configuration.pb.go @@ -0,0 +1,227 @@ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: peer/configuration.proto + +package peer // import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/peer" + +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 + +// AnchorPeers simply represents list of anchor peers which is used in ConfigurationItem +type AnchorPeers struct { + AnchorPeers []*AnchorPeer `protobuf:"bytes,1,rep,name=anchor_peers,json=anchorPeers,proto3" json:"anchor_peers,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AnchorPeers) Reset() { *m = AnchorPeers{} } +func (m *AnchorPeers) String() string { return proto.CompactTextString(m) } +func (*AnchorPeers) ProtoMessage() {} +func (*AnchorPeers) Descriptor() ([]byte, []int) { + return fileDescriptor_configuration_d9ec63ae33c182ef, []int{0} +} +func (m *AnchorPeers) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AnchorPeers.Unmarshal(m, b) +} +func (m *AnchorPeers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AnchorPeers.Marshal(b, m, deterministic) +} +func (dst *AnchorPeers) XXX_Merge(src proto.Message) { + xxx_messageInfo_AnchorPeers.Merge(dst, src) +} +func (m *AnchorPeers) XXX_Size() int { + return xxx_messageInfo_AnchorPeers.Size(m) +} +func (m *AnchorPeers) XXX_DiscardUnknown() { + xxx_messageInfo_AnchorPeers.DiscardUnknown(m) +} + +var xxx_messageInfo_AnchorPeers proto.InternalMessageInfo + +func (m *AnchorPeers) GetAnchorPeers() []*AnchorPeer { + if m != nil { + return m.AnchorPeers + } + return nil +} + +// AnchorPeer message structure which provides information about anchor peer, it includes host name, +// port number and peer certificate. +type AnchorPeer struct { + // DNS host name of the anchor peer + Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` + // The port number + Port int32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AnchorPeer) Reset() { *m = AnchorPeer{} } +func (m *AnchorPeer) String() string { return proto.CompactTextString(m) } +func (*AnchorPeer) ProtoMessage() {} +func (*AnchorPeer) Descriptor() ([]byte, []int) { + return fileDescriptor_configuration_d9ec63ae33c182ef, []int{1} +} +func (m *AnchorPeer) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AnchorPeer.Unmarshal(m, b) +} +func (m *AnchorPeer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AnchorPeer.Marshal(b, m, deterministic) +} +func (dst *AnchorPeer) XXX_Merge(src proto.Message) { + xxx_messageInfo_AnchorPeer.Merge(dst, src) +} +func (m *AnchorPeer) XXX_Size() int { + return xxx_messageInfo_AnchorPeer.Size(m) +} +func (m *AnchorPeer) XXX_DiscardUnknown() { + xxx_messageInfo_AnchorPeer.DiscardUnknown(m) +} + +var xxx_messageInfo_AnchorPeer proto.InternalMessageInfo + +func (m *AnchorPeer) GetHost() string { + if m != nil { + return m.Host + } + return "" +} + +func (m *AnchorPeer) GetPort() int32 { + if m != nil { + return m.Port + } + return 0 +} + +// APIResource represents an API resource in the peer whose ACL +// is determined by the policy_ref field +type APIResource struct { + PolicyRef string `protobuf:"bytes,1,opt,name=policy_ref,json=policyRef,proto3" json:"policy_ref,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *APIResource) Reset() { *m = APIResource{} } +func (m *APIResource) String() string { return proto.CompactTextString(m) } +func (*APIResource) ProtoMessage() {} +func (*APIResource) Descriptor() ([]byte, []int) { + return fileDescriptor_configuration_d9ec63ae33c182ef, []int{2} +} +func (m *APIResource) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_APIResource.Unmarshal(m, b) +} +func (m *APIResource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_APIResource.Marshal(b, m, deterministic) +} +func (dst *APIResource) XXX_Merge(src proto.Message) { + xxx_messageInfo_APIResource.Merge(dst, src) +} +func (m *APIResource) XXX_Size() int { + return xxx_messageInfo_APIResource.Size(m) +} +func (m *APIResource) XXX_DiscardUnknown() { + xxx_messageInfo_APIResource.DiscardUnknown(m) +} + +var xxx_messageInfo_APIResource proto.InternalMessageInfo + +func (m *APIResource) GetPolicyRef() string { + if m != nil { + return m.PolicyRef + } + return "" +} + +// ACLs provides mappings for resources in a channel. APIResource encapsulates +// reference to a policy used to determine ACL for the resource +type ACLs struct { + Acls map[string]*APIResource `protobuf:"bytes,1,rep,name=acls,proto3" json:"acls,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ACLs) Reset() { *m = ACLs{} } +func (m *ACLs) String() string { return proto.CompactTextString(m) } +func (*ACLs) ProtoMessage() {} +func (*ACLs) Descriptor() ([]byte, []int) { + return fileDescriptor_configuration_d9ec63ae33c182ef, []int{3} +} +func (m *ACLs) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ACLs.Unmarshal(m, b) +} +func (m *ACLs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ACLs.Marshal(b, m, deterministic) +} +func (dst *ACLs) XXX_Merge(src proto.Message) { + xxx_messageInfo_ACLs.Merge(dst, src) +} +func (m *ACLs) XXX_Size() int { + return xxx_messageInfo_ACLs.Size(m) +} +func (m *ACLs) XXX_DiscardUnknown() { + xxx_messageInfo_ACLs.DiscardUnknown(m) +} + +var xxx_messageInfo_ACLs proto.InternalMessageInfo + +func (m *ACLs) GetAcls() map[string]*APIResource { + if m != nil { + return m.Acls + } + return nil +} + +func init() { + proto.RegisterType((*AnchorPeers)(nil), "sdk.protos.AnchorPeers") + proto.RegisterType((*AnchorPeer)(nil), "sdk.protos.AnchorPeer") + proto.RegisterType((*APIResource)(nil), "sdk.protos.APIResource") + proto.RegisterType((*ACLs)(nil), "sdk.protos.ACLs") + proto.RegisterMapType((map[string]*APIResource)(nil), "sdk.protos.ACLs.AclsEntry") +} + +func init() { + proto.RegisterFile("peer/configuration.proto", fileDescriptor_configuration_d9ec63ae33c182ef) +} + +var fileDescriptor_configuration_d9ec63ae33c182ef = []byte{ + // 295 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x91, 0xdf, 0x4b, 0xfb, 0x30, + 0x14, 0xc5, 0xe9, 0x7e, 0x7c, 0x61, 0xb7, 0xdf, 0x07, 0x89, 0x20, 0x45, 0x10, 0x46, 0x9f, 0x36, + 0x91, 0x14, 0xa6, 0x82, 0xf8, 0x56, 0xa7, 0x0f, 0xc2, 0xc0, 0x91, 0x47, 0x5f, 0x46, 0x16, 0x6f, + 0x7f, 0x60, 0x6d, 0xca, 0x4d, 0x2a, 0xf4, 0xcd, 0x3f, 0x5d, 0x9a, 0x6c, 0xab, 0x4f, 0x39, 0x39, + 0xf9, 0x9c, 0xcb, 0x21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x23, 0x47, 0xe2, 0x99, 0xdc, 0x53, 0xa9, 0x8e, + 0xb9, 0xfe, 0xd3, 0xde, 0x97, 0x79, 0x69, 0x8b, 0x76, 0xcf, 0x95, 0xfe, 0x4a, 0xfe, 0xa0, 0x89, + 0x47, 0x13, 0x8f, 0x26, 0x3d, 0xba, 0xf7, 0x5b, 0xb8, 0xfd, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xae, + 0x0a, 0x1d, 0x41, 0xa8, 0x01, 0x00, 0x00, +} diff --git a/fabric/protos/peer/events.pb.go b/fabric/protos/peer/events.pb.go new file mode 100644 index 0000000..9293ba4 --- /dev/null +++ b/fabric/protos/peer/events.pb.go @@ -0,0 +1,707 @@ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: peer/events.proto + +package peer // import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/peer" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "github.com/golang/protobuf/ptypes/timestamp" +import common "github.com/hyperledger/fabric-sdk-go/third_party/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 + +// FilteredBlock is a minimal set of information about a block +type FilteredBlock struct { + ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + Number uint64 `protobuf:"varint,2,opt,name=number,proto3" json:"number,omitempty"` + FilteredTransactions []*FilteredTransaction `protobuf:"bytes,4,rep,name=filtered_transactions,json=filteredTransactions,proto3" json:"filtered_transactions,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FilteredBlock) Reset() { *m = FilteredBlock{} } +func (m *FilteredBlock) String() string { return proto.CompactTextString(m) } +func (*FilteredBlock) ProtoMessage() {} +func (*FilteredBlock) Descriptor() ([]byte, []int) { + return fileDescriptor_events_8af932975aef5a3c, []int{0} +} +func (m *FilteredBlock) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FilteredBlock.Unmarshal(m, b) +} +func (m *FilteredBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FilteredBlock.Marshal(b, m, deterministic) +} +func (dst *FilteredBlock) XXX_Merge(src proto.Message) { + xxx_messageInfo_FilteredBlock.Merge(dst, src) +} +func (m *FilteredBlock) XXX_Size() int { + return xxx_messageInfo_FilteredBlock.Size(m) +} +func (m *FilteredBlock) XXX_DiscardUnknown() { + xxx_messageInfo_FilteredBlock.DiscardUnknown(m) +} + +var xxx_messageInfo_FilteredBlock proto.InternalMessageInfo + +func (m *FilteredBlock) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +func (m *FilteredBlock) GetNumber() uint64 { + if m != nil { + return m.Number + } + return 0 +} + +func (m *FilteredBlock) GetFilteredTransactions() []*FilteredTransaction { + if m != nil { + return m.FilteredTransactions + } + return nil +} + +// FilteredTransaction is a minimal set of information about a transaction +// within a block +type FilteredTransaction struct { + Txid string `protobuf:"bytes,1,opt,name=txid,proto3" json:"txid,omitempty"` + Type common.HeaderType `protobuf:"varint,2,opt,name=type,proto3,enum=common.HeaderType" json:"type,omitempty"` + TxValidationCode TxValidationCode `protobuf:"varint,3,opt,name=tx_validation_code,json=txValidationCode,proto3,enum=protos.TxValidationCode" json:"tx_validation_code,omitempty"` + // Types that are valid to be assigned to Data: + // *FilteredTransaction_TransactionActions + Data isFilteredTransaction_Data `protobuf_oneof:"Data"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FilteredTransaction) Reset() { *m = FilteredTransaction{} } +func (m *FilteredTransaction) String() string { return proto.CompactTextString(m) } +func (*FilteredTransaction) ProtoMessage() {} +func (*FilteredTransaction) Descriptor() ([]byte, []int) { + return fileDescriptor_events_8af932975aef5a3c, []int{1} +} +func (m *FilteredTransaction) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FilteredTransaction.Unmarshal(m, b) +} +func (m *FilteredTransaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FilteredTransaction.Marshal(b, m, deterministic) +} +func (dst *FilteredTransaction) XXX_Merge(src proto.Message) { + xxx_messageInfo_FilteredTransaction.Merge(dst, src) +} +func (m *FilteredTransaction) XXX_Size() int { + return xxx_messageInfo_FilteredTransaction.Size(m) +} +func (m *FilteredTransaction) XXX_DiscardUnknown() { + xxx_messageInfo_FilteredTransaction.DiscardUnknown(m) +} + +var xxx_messageInfo_FilteredTransaction proto.InternalMessageInfo + +func (m *FilteredTransaction) GetTxid() string { + if m != nil { + return m.Txid + } + return "" +} + +func (m *FilteredTransaction) GetType() common.HeaderType { + if m != nil { + return m.Type + } + return common.HeaderType_MESSAGE +} + +func (m *FilteredTransaction) GetTxValidationCode() TxValidationCode { + if m != nil { + return m.TxValidationCode + } + return TxValidationCode_VALID +} + +type isFilteredTransaction_Data interface { + isFilteredTransaction_Data() +} + +type FilteredTransaction_TransactionActions struct { + TransactionActions *FilteredTransactionActions `protobuf:"bytes,4,opt,name=transaction_actions,json=transactionActions,proto3,oneof"` +} + +func (*FilteredTransaction_TransactionActions) isFilteredTransaction_Data() {} + +func (m *FilteredTransaction) GetData() isFilteredTransaction_Data { + if m != nil { + return m.Data + } + return nil +} + +func (m *FilteredTransaction) GetTransactionActions() *FilteredTransactionActions { + if x, ok := m.GetData().(*FilteredTransaction_TransactionActions); ok { + return x.TransactionActions + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*FilteredTransaction) 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 _FilteredTransaction_OneofMarshaler, _FilteredTransaction_OneofUnmarshaler, _FilteredTransaction_OneofSizer, []interface{}{ + (*FilteredTransaction_TransactionActions)(nil), + } +} + +func _FilteredTransaction_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*FilteredTransaction) + // Data + switch x := m.Data.(type) { + case *FilteredTransaction_TransactionActions: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TransactionActions); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("FilteredTransaction.Data has unexpected type %T", x) + } + return nil +} + +func _FilteredTransaction_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*FilteredTransaction) + switch tag { + case 4: // Data.transaction_actions + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(FilteredTransactionActions) + err := b.DecodeMessage(msg) + m.Data = &FilteredTransaction_TransactionActions{msg} + return true, err + default: + return false, nil + } +} + +func _FilteredTransaction_OneofSizer(msg proto.Message) (n int) { + m := msg.(*FilteredTransaction) + // Data + switch x := m.Data.(type) { + case *FilteredTransaction_TransactionActions: + s := proto.Size(x.TransactionActions) + 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 +} + +// FilteredTransactionActions is a wrapper for array of TransactionAction +// message from regular block +type FilteredTransactionActions struct { + ChaincodeActions []*FilteredChaincodeAction `protobuf:"bytes,1,rep,name=chaincode_actions,json=chaincodeActions,proto3" json:"chaincode_actions,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FilteredTransactionActions) Reset() { *m = FilteredTransactionActions{} } +func (m *FilteredTransactionActions) String() string { return proto.CompactTextString(m) } +func (*FilteredTransactionActions) ProtoMessage() {} +func (*FilteredTransactionActions) Descriptor() ([]byte, []int) { + return fileDescriptor_events_8af932975aef5a3c, []int{2} +} +func (m *FilteredTransactionActions) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FilteredTransactionActions.Unmarshal(m, b) +} +func (m *FilteredTransactionActions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FilteredTransactionActions.Marshal(b, m, deterministic) +} +func (dst *FilteredTransactionActions) XXX_Merge(src proto.Message) { + xxx_messageInfo_FilteredTransactionActions.Merge(dst, src) +} +func (m *FilteredTransactionActions) XXX_Size() int { + return xxx_messageInfo_FilteredTransactionActions.Size(m) +} +func (m *FilteredTransactionActions) XXX_DiscardUnknown() { + xxx_messageInfo_FilteredTransactionActions.DiscardUnknown(m) +} + +var xxx_messageInfo_FilteredTransactionActions proto.InternalMessageInfo + +func (m *FilteredTransactionActions) GetChaincodeActions() []*FilteredChaincodeAction { + if m != nil { + return m.ChaincodeActions + } + return nil +} + +// FilteredChaincodeAction is a minimal set of information about an action +// within a transaction +type FilteredChaincodeAction struct { + ChaincodeEvent *ChaincodeEvent `protobuf:"bytes,1,opt,name=chaincode_event,json=chaincodeEvent,proto3" json:"chaincode_event,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FilteredChaincodeAction) Reset() { *m = FilteredChaincodeAction{} } +func (m *FilteredChaincodeAction) String() string { return proto.CompactTextString(m) } +func (*FilteredChaincodeAction) ProtoMessage() {} +func (*FilteredChaincodeAction) Descriptor() ([]byte, []int) { + return fileDescriptor_events_8af932975aef5a3c, []int{3} +} +func (m *FilteredChaincodeAction) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FilteredChaincodeAction.Unmarshal(m, b) +} +func (m *FilteredChaincodeAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FilteredChaincodeAction.Marshal(b, m, deterministic) +} +func (dst *FilteredChaincodeAction) XXX_Merge(src proto.Message) { + xxx_messageInfo_FilteredChaincodeAction.Merge(dst, src) +} +func (m *FilteredChaincodeAction) XXX_Size() int { + return xxx_messageInfo_FilteredChaincodeAction.Size(m) +} +func (m *FilteredChaincodeAction) XXX_DiscardUnknown() { + xxx_messageInfo_FilteredChaincodeAction.DiscardUnknown(m) +} + +var xxx_messageInfo_FilteredChaincodeAction proto.InternalMessageInfo + +func (m *FilteredChaincodeAction) GetChaincodeEvent() *ChaincodeEvent { + if m != nil { + return m.ChaincodeEvent + } + return nil +} + +// DeliverResponse +type DeliverResponse struct { + // Types that are valid to be assigned to Type: + // *DeliverResponse_Status + // *DeliverResponse_Block + // *DeliverResponse_FilteredBlock + 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_events_8af932975aef5a3c, []int{4} +} +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"` +} + +type DeliverResponse_FilteredBlock struct { + FilteredBlock *FilteredBlock `protobuf:"bytes,3,opt,name=filtered_block,json=filteredBlock,proto3,oneof"` +} + +func (*DeliverResponse_Status) isDeliverResponse_Type() {} + +func (*DeliverResponse_Block) isDeliverResponse_Type() {} + +func (*DeliverResponse_FilteredBlock) 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 +} + +func (m *DeliverResponse) GetFilteredBlock() *FilteredBlock { + if x, ok := m.GetType().(*DeliverResponse_FilteredBlock); ok { + return x.FilteredBlock + } + 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), + (*DeliverResponse_FilteredBlock)(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 *DeliverResponse_FilteredBlock: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.FilteredBlock); 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 + case 3: // Type.filtered_block + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(FilteredBlock) + err := b.DecodeMessage(msg) + m.Type = &DeliverResponse_FilteredBlock{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 *DeliverResponse_FilteredBlock: + s := proto.Size(x.FilteredBlock) + 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((*FilteredBlock)(nil), "sdk.protos.FilteredBlock") + proto.RegisterType((*FilteredTransaction)(nil), "sdk.protos.FilteredTransaction") + proto.RegisterType((*FilteredTransactionActions)(nil), "sdk.protos.FilteredTransactionActions") + proto.RegisterType((*FilteredChaincodeAction)(nil), "sdk.protos.FilteredChaincodeAction") + proto.RegisterType((*DeliverResponse)(nil), "sdk.protos.DeliverResponse") +} + +// 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 + +// DeliverClient is the client API for Deliver service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type DeliverClient interface { + // deliver first requires an Envelope of type ab.DELIVER_SEEK_INFO with + // Payload data as a marshaled orderer.SeekInfo message, + // then a stream of block replies is received + Deliver(ctx context.Context, opts ...grpc.CallOption) (Deliver_DeliverClient, error) + // deliver first requires an Envelope of type ab.DELIVER_SEEK_INFO with + // Payload data as a marshaled orderer.SeekInfo message, + // then a stream of **filtered** block replies is received + DeliverFiltered(ctx context.Context, opts ...grpc.CallOption) (Deliver_DeliverFilteredClient, error) +} + +type deliverClient struct { + cc *grpc.ClientConn +} + +func NewDeliverClient(cc *grpc.ClientConn) DeliverClient { + return &deliverClient{cc} +} + +func (c *deliverClient) Deliver(ctx context.Context, opts ...grpc.CallOption) (Deliver_DeliverClient, error) { + stream, err := c.cc.NewStream(ctx, &_Deliver_serviceDesc.Streams[0], "/protos.Deliver/Deliver", opts...) + if err != nil { + return nil, err + } + x := &deliverDeliverClient{stream} + return x, nil +} + +type Deliver_DeliverClient interface { + Send(*common.Envelope) error + Recv() (*DeliverResponse, error) + grpc.ClientStream +} + +type deliverDeliverClient struct { + grpc.ClientStream +} + +func (x *deliverDeliverClient) Send(m *common.Envelope) error { + return x.ClientStream.SendMsg(m) +} + +func (x *deliverDeliverClient) Recv() (*DeliverResponse, error) { + m := new(DeliverResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *deliverClient) DeliverFiltered(ctx context.Context, opts ...grpc.CallOption) (Deliver_DeliverFilteredClient, error) { + stream, err := c.cc.NewStream(ctx, &_Deliver_serviceDesc.Streams[1], "/protos.Deliver/DeliverFiltered", opts...) + if err != nil { + return nil, err + } + x := &deliverDeliverFilteredClient{stream} + return x, nil +} + +type Deliver_DeliverFilteredClient interface { + Send(*common.Envelope) error + Recv() (*DeliverResponse, error) + grpc.ClientStream +} + +type deliverDeliverFilteredClient struct { + grpc.ClientStream +} + +func (x *deliverDeliverFilteredClient) Send(m *common.Envelope) error { + return x.ClientStream.SendMsg(m) +} + +func (x *deliverDeliverFilteredClient) Recv() (*DeliverResponse, error) { + m := new(DeliverResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// DeliverServer is the server API for Deliver service. +type DeliverServer interface { + // deliver first requires an Envelope of type ab.DELIVER_SEEK_INFO with + // Payload data as a marshaled orderer.SeekInfo message, + // then a stream of block replies is received + Deliver(Deliver_DeliverServer) error + // deliver first requires an Envelope of type ab.DELIVER_SEEK_INFO with + // Payload data as a marshaled orderer.SeekInfo message, + // then a stream of **filtered** block replies is received + DeliverFiltered(Deliver_DeliverFilteredServer) error +} + +func RegisterDeliverServer(s *grpc.Server, srv DeliverServer) { + s.RegisterService(&_Deliver_serviceDesc, srv) +} + +func _Deliver_Deliver_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(DeliverServer).Deliver(&deliverDeliverServer{stream}) +} + +type Deliver_DeliverServer interface { + Send(*DeliverResponse) error + Recv() (*common.Envelope, error) + grpc.ServerStream +} + +type deliverDeliverServer struct { + grpc.ServerStream +} + +func (x *deliverDeliverServer) Send(m *DeliverResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *deliverDeliverServer) Recv() (*common.Envelope, error) { + m := new(common.Envelope) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Deliver_DeliverFiltered_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(DeliverServer).DeliverFiltered(&deliverDeliverFilteredServer{stream}) +} + +type Deliver_DeliverFilteredServer interface { + Send(*DeliverResponse) error + Recv() (*common.Envelope, error) + grpc.ServerStream +} + +type deliverDeliverFilteredServer struct { + grpc.ServerStream +} + +func (x *deliverDeliverFilteredServer) Send(m *DeliverResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *deliverDeliverFilteredServer) Recv() (*common.Envelope, error) { + m := new(common.Envelope) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _Deliver_serviceDesc = grpc.ServiceDesc{ + ServiceName: "protos.Deliver", + HandlerType: (*DeliverServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Deliver", + Handler: _Deliver_Deliver_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "DeliverFiltered", + Handler: _Deliver_DeliverFiltered_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "peer/events.proto", +} + +func init() { proto.RegisterFile("peer/events.proto", fileDescriptor_events_8af932975aef5a3c) } + +var fileDescriptor_events_8af932975aef5a3c = []byte{ + // 560 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0x8e, 0x69, 0x08, 0xea, 0x44, 0x49, 0xdb, 0x2d, 0x4d, 0xa3, 0x20, 0xd4, 0xc8, 0x12, 0xc8, + 0x5c, 0x62, 0x64, 0x6e, 0x1c, 0x40, 0xa4, 0x3f, 0x0a, 0x12, 0x87, 0x6a, 0x09, 0x1c, 0x7a, 0xc0, + 0x5a, 0xdb, 0x13, 0xc7, 0xd4, 0xf1, 0x5a, 0xbb, 0x9b, 0x28, 0x79, 0x04, 0xde, 0x80, 0x67, 0xe0, + 0x09, 0x39, 0x22, 0xaf, 0xbd, 0x49, 0x9a, 0x52, 0x24, 0x4e, 0xf6, 0xce, 0x7c,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xb3, 0x30, 0xbc, 0xd6, 0x64, 0x3b, + 0x50, 0x0c, 0xbd, 0xd8, 0x10, 0xef, 0x87, 0x05, 0x4f, 0xaa, 0x62, 0xc9, 0xdb, 0xcd, 0xeb, 0xa1, + 0xb1, 0xbd, 0xcc, 0x16, 0x98, 0xf2, 0x1c, 0x7b, 0xa7, 0x46, 0x78, 0xa7, 0x35, 0xbb, 0xe6, 0x58, + 0xaf, 0x2d, 0x32, 0x5c, 0xf7, 0x6c, 0x8c, 0xff, 0x5b, 0x63, 0xf8, 0x0d, 0x6c, 0x2e, 0xe2, 0xc1, + 0x74, 0x95, 0xa3, 0x48, 0x31, 0x8a, 0x51, 0x0c, 0x26, 0x2c, 0x10, 0x49, 0x68, 0x68, 0xc5, 0xe7, + 0x3c, 0x6c, 0xe9, 0x29, 0xcb, 0x6b, 0x16, 0xde, 0xb2, 0x18, 0x6f, 0x5e, 0xc5, 0x89, 0x9a, 0xce, + 0x83, 0xc2, 0xcb, 0xdd, 0x62, 0xba, 0x25, 0xb3, 0xfc, 0x6f, 0x48, 0xb7, 0x60, 0x06, 0xe5, 0x8f, + 0xe6, 0xcd, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd3, 0x19, 0xd1, 0xa9, 0x84, 0x04, 0x00, 0x00, +} diff --git a/fabric/protos/peer/peer.pb.go b/fabric/protos/peer/peer.pb.go new file mode 100644 index 0000000..457e7ff --- /dev/null +++ b/fabric/protos/peer/peer.pb.go @@ -0,0 +1,211 @@ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: peer/peer.proto + +package peer // import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/peer" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +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 + +type PeerID struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PeerID) Reset() { *m = PeerID{} } +func (m *PeerID) String() string { return proto.CompactTextString(m) } +func (*PeerID) ProtoMessage() {} +func (*PeerID) Descriptor() ([]byte, []int) { + return fileDescriptor_peer_f225b6e437338532, []int{0} +} +func (m *PeerID) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PeerID.Unmarshal(m, b) +} +func (m *PeerID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PeerID.Marshal(b, m, deterministic) +} +func (dst *PeerID) XXX_Merge(src proto.Message) { + xxx_messageInfo_PeerID.Merge(dst, src) +} +func (m *PeerID) XXX_Size() int { + return xxx_messageInfo_PeerID.Size(m) +} +func (m *PeerID) XXX_DiscardUnknown() { + xxx_messageInfo_PeerID.DiscardUnknown(m) +} + +var xxx_messageInfo_PeerID proto.InternalMessageInfo + +func (m *PeerID) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type PeerEndpoint struct { + Id *PeerID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PeerEndpoint) Reset() { *m = PeerEndpoint{} } +func (m *PeerEndpoint) String() string { return proto.CompactTextString(m) } +func (*PeerEndpoint) ProtoMessage() {} +func (*PeerEndpoint) Descriptor() ([]byte, []int) { + return fileDescriptor_peer_f225b6e437338532, []int{1} +} +func (m *PeerEndpoint) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PeerEndpoint.Unmarshal(m, b) +} +func (m *PeerEndpoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PeerEndpoint.Marshal(b, m, deterministic) +} +func (dst *PeerEndpoint) XXX_Merge(src proto.Message) { + xxx_messageInfo_PeerEndpoint.Merge(dst, src) +} +func (m *PeerEndpoint) XXX_Size() int { + return xxx_messageInfo_PeerEndpoint.Size(m) +} +func (m *PeerEndpoint) XXX_DiscardUnknown() { + xxx_messageInfo_PeerEndpoint.DiscardUnknown(m) +} + +var xxx_messageInfo_PeerEndpoint proto.InternalMessageInfo + +func (m *PeerEndpoint) GetId() *PeerID { + if m != nil { + return m.Id + } + return nil +} + +func (m *PeerEndpoint) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func init() { + proto.RegisterType((*PeerID)(nil), "sdk.protos.PeerID") + proto.RegisterType((*PeerEndpoint)(nil), "sdk.protos.PeerEndpoint") +} + +// 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 + +// EndorserClient is the client API for Endorser service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type EndorserClient interface { + ProcessProposal(ctx context.Context, in *SignedProposal, opts ...grpc.CallOption) (*ProposalResponse, error) +} + +type endorserClient struct { + cc *grpc.ClientConn +} + +func NewEndorserClient(cc *grpc.ClientConn) EndorserClient { + return &endorserClient{cc} +} + +func (c *endorserClient) ProcessProposal(ctx context.Context, in *SignedProposal, opts ...grpc.CallOption) (*ProposalResponse, error) { + out := new(ProposalResponse) + err := c.cc.Invoke(ctx, "/protos.Endorser/ProcessProposal", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// EndorserServer is the server API for Endorser service. +type EndorserServer interface { + ProcessProposal(context.Context, *SignedProposal) (*ProposalResponse, error) +} + +func RegisterEndorserServer(s *grpc.Server, srv EndorserServer) { + s.RegisterService(&_Endorser_serviceDesc, srv) +} + +func _Endorser_ProcessProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SignedProposal) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EndorserServer).ProcessProposal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/protos.Endorser/ProcessProposal", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EndorserServer).ProcessProposal(ctx, req.(*SignedProposal)) + } + return interceptor(ctx, in, info, handler) +} + +var _Endorser_serviceDesc = grpc.ServiceDesc{ + ServiceName: "protos.Endorser", + HandlerType: (*EndorserServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ProcessProposal", + Handler: _Endorser_ProcessProposal_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "peer/peer.proto", +} + +func init() { proto.RegisterFile("peer/peer.proto", fileDescriptor_peer_f225b6e437338532) } + +var fileDescriptor_peer_f225b6e437338532 = []byte{ + // 246 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0x4f, 0x4b, 0xc4, 0x30, + 0x10, 0xc5, 0xdd, 0x22, 0xab, 0x8e, 0xe2, 0x42, 0x04, 0x29, 0x65, 0x11, 0xe9, 0x49, 0x2f, 0x29, + 0xac, 0xdf, 0x40, 0x2c, 0xe8, 0xc9, 0x5a, 0x6f, 0x5e, 0xa4, 0x6d, 0xc6, 0x6e, 0x60, 0x37, 0x13, + 0x66, 0xea, 0xc1, 0x6f, 0x2f, 0x4d, 0x5a, 0x71, 0x2f, 0xf9, 0xf3, 0xde, 0x6f, 0x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, 0x00, 0x00, +} diff --git a/fabric/protos/peer/proposal.pb.go b/fabric/protos/peer/proposal.pb.go new file mode 100644 index 0000000..856f93f --- /dev/null +++ b/fabric/protos/peer/proposal.pb.go @@ -0,0 +1,424 @@ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: peer/proposal.proto + +package peer // import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/peer" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import token "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/token" + +// 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 + +// This structure is necessary to sign the proposal which contains the header +// and the payload. Without this structure, we would have to concatenate the +// header and the payload to verify the signature, which could be expensive +// with large payload +// +// When an endorser receives a SignedProposal message, it should verify the +// signature over the proposal bytes. This verification requires the following +// steps: +// 1. Verification of the validity of the certificate that was used to produce +// the signature. The certificate will be available once proposalBytes has +// been unmarshalled to a Proposal message, and Proposal.header has been +// unmarshalled to a Header message. While this unmarshalling-before-verifying +// might not be ideal, it is unavoidable because i) the signature needs to also +// protect the signing certificate; ii) it is desirable that Header is created +// once by the client and never changed (for the sake of accountability and +// non-repudiation). Note also that it is actually impossible to conclusively +// verify the validity of the certificate included in a Proposal, because the +// proposal needs to first be endorsed and ordered with respect to certificate +// expiration transactions. Still, it is useful to pre-filter expired +// certificates at this stage. +// 2. Verification that the certificate is trusted (signed by a trusted CA) and +// that it is allowed to transact with us (with respect to some ACLs); +// 3. Verification that the signature on proposalBytes is valid; +// 4. Detect replay attacks; +type SignedProposal struct { + // The bytes of Proposal + ProposalBytes []byte `protobuf:"bytes,1,opt,name=proposal_bytes,json=proposalBytes,proto3" json:"proposal_bytes,omitempty"` + // Signaure over proposalBytes; this signature is to be verified against + // the creator identity contained in the header of the Proposal message + // marshaled as proposalBytes + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignedProposal) Reset() { *m = SignedProposal{} } +func (m *SignedProposal) String() string { return proto.CompactTextString(m) } +func (*SignedProposal) ProtoMessage() {} +func (*SignedProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_proposal_2be65988745cf952, []int{0} +} +func (m *SignedProposal) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignedProposal.Unmarshal(m, b) +} +func (m *SignedProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignedProposal.Marshal(b, m, deterministic) +} +func (dst *SignedProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignedProposal.Merge(dst, src) +} +func (m *SignedProposal) XXX_Size() int { + return xxx_messageInfo_SignedProposal.Size(m) +} +func (m *SignedProposal) XXX_DiscardUnknown() { + xxx_messageInfo_SignedProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_SignedProposal proto.InternalMessageInfo + +func (m *SignedProposal) GetProposalBytes() []byte { + if m != nil { + return m.ProposalBytes + } + return nil +} + +func (m *SignedProposal) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +// A Proposal is sent to an endorser for endorsement. The proposal contains: +// 1. A header which should be unmarshaled to a Header message. Note that +// Header is both the header of a Proposal and of a Transaction, in that i) +// both headers should be unmarshaled to this message; and ii) it is used to +// compute cryptographic hashes and signatures. The header has fields common +// to all proposals/transactions. In addition it has a type field for +// additional customization. An example of this is the ChaincodeHeaderExtension +// message used to extend the Header for type CHAINCODE. +// 2. A payload whose type depends on the header's type field. +// 3. An extension whose type depends on the header's type field. +// +// Let us see an example. For type CHAINCODE (see the Header message), +// we have the following: +// 1. The header is a Header message whose extensions field is a +// ChaincodeHeaderExtension message. +// 2. The payload is a ChaincodeProposalPayload message. +// 3. The extension is a ChaincodeAction that might be used to ask the +// endorsers to endorse a specific ChaincodeAction, thus emulating the +// submitting peer model. +type Proposal struct { + // The header of the proposal. It is the bytes of the Header + Header []byte `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // The payload of the proposal as defined by the type in the proposal + // header. + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` + // Optional extensions to the proposal. Its content depends on the Header's + // type field. For the type CHAINCODE, it might be the bytes of a + // ChaincodeAction message. + Extension []byte `protobuf:"bytes,3,opt,name=extension,proto3" json:"extension,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Proposal) Reset() { *m = Proposal{} } +func (m *Proposal) String() string { return proto.CompactTextString(m) } +func (*Proposal) ProtoMessage() {} +func (*Proposal) Descriptor() ([]byte, []int) { + return fileDescriptor_proposal_2be65988745cf952, []int{1} +} +func (m *Proposal) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Proposal.Unmarshal(m, b) +} +func (m *Proposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Proposal.Marshal(b, m, deterministic) +} +func (dst *Proposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_Proposal.Merge(dst, src) +} +func (m *Proposal) XXX_Size() int { + return xxx_messageInfo_Proposal.Size(m) +} +func (m *Proposal) XXX_DiscardUnknown() { + xxx_messageInfo_Proposal.DiscardUnknown(m) +} + +var xxx_messageInfo_Proposal proto.InternalMessageInfo + +func (m *Proposal) GetHeader() []byte { + if m != nil { + return m.Header + } + return nil +} + +func (m *Proposal) GetPayload() []byte { + if m != nil { + return m.Payload + } + return nil +} + +func (m *Proposal) GetExtension() []byte { + if m != nil { + return m.Extension + } + return nil +} + +// ChaincodeHeaderExtension is the Header's extentions message to be used when +// the Header's type is CHAINCODE. This extensions is used to specify which +// chaincode to invoke and what should appear on the ledger. +type ChaincodeHeaderExtension struct { + // The PayloadVisibility field controls to what extent the Proposal's payload + // (recall that for the type CHAINCODE, it is ChaincodeProposalPayload + // message) field will be visible in the final transaction and in the ledger. + // Ideally, it would be configurable, supporting at least 3 main visibility + // modes: + // 1. all bytes of the payload are visible; + // 2. only a hash of the payload is visible; + // 3. nothing is visible. + // Notice that the visibility function may be potentially part of the ESCC. + // In that case it overrides PayloadVisibility field. Finally notice that + // this field impacts the content of ProposalResponsePayload.proposalHash. + PayloadVisibility []byte `protobuf:"bytes,1,opt,name=payload_visibility,json=payloadVisibility,proto3" json:"payload_visibility,omitempty"` + // The ID of the chaincode to target. + ChaincodeId *ChaincodeID `protobuf:"bytes,2,opt,name=chaincode_id,json=chaincodeId,proto3" json:"chaincode_id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ChaincodeHeaderExtension) Reset() { *m = ChaincodeHeaderExtension{} } +func (m *ChaincodeHeaderExtension) String() string { return proto.CompactTextString(m) } +func (*ChaincodeHeaderExtension) ProtoMessage() {} +func (*ChaincodeHeaderExtension) Descriptor() ([]byte, []int) { + return fileDescriptor_proposal_2be65988745cf952, []int{2} +} +func (m *ChaincodeHeaderExtension) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ChaincodeHeaderExtension.Unmarshal(m, b) +} +func (m *ChaincodeHeaderExtension) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ChaincodeHeaderExtension.Marshal(b, m, deterministic) +} +func (dst *ChaincodeHeaderExtension) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChaincodeHeaderExtension.Merge(dst, src) +} +func (m *ChaincodeHeaderExtension) XXX_Size() int { + return xxx_messageInfo_ChaincodeHeaderExtension.Size(m) +} +func (m *ChaincodeHeaderExtension) XXX_DiscardUnknown() { + xxx_messageInfo_ChaincodeHeaderExtension.DiscardUnknown(m) +} + +var xxx_messageInfo_ChaincodeHeaderExtension proto.InternalMessageInfo + +func (m *ChaincodeHeaderExtension) GetPayloadVisibility() []byte { + if m != nil { + return m.PayloadVisibility + } + return nil +} + +func (m *ChaincodeHeaderExtension) GetChaincodeId() *ChaincodeID { + if m != nil { + return m.ChaincodeId + } + return nil +} + +// ChaincodeProposalPayload is the Proposal's payload message to be used when +// the Header's type is CHAINCODE. It contains the arguments for this +// invocation. +type ChaincodeProposalPayload struct { + // Input contains the arguments for this invocation. If this invocation + // deploys a new chaincode, ESCC/VSCC are part of this field. + // This is usually a marshaled ChaincodeInvocationSpec + Input []byte `protobuf:"bytes,1,opt,name=input,proto3" json:"input,omitempty"` + // TransientMap contains data (e.g. cryptographic material) that might be used + // to implement some form of application-level confidentiality. The contents + // of this field are supposed to always be omitted from the transaction and + // excluded from the ledger. + TransientMap map[string][]byte `protobuf:"bytes,2,rep,name=TransientMap,proto3" json:"TransientMap,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ChaincodeProposalPayload) Reset() { *m = ChaincodeProposalPayload{} } +func (m *ChaincodeProposalPayload) String() string { return proto.CompactTextString(m) } +func (*ChaincodeProposalPayload) ProtoMessage() {} +func (*ChaincodeProposalPayload) Descriptor() ([]byte, []int) { + return fileDescriptor_proposal_2be65988745cf952, []int{3} +} +func (m *ChaincodeProposalPayload) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ChaincodeProposalPayload.Unmarshal(m, b) +} +func (m *ChaincodeProposalPayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ChaincodeProposalPayload.Marshal(b, m, deterministic) +} +func (dst *ChaincodeProposalPayload) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChaincodeProposalPayload.Merge(dst, src) +} +func (m *ChaincodeProposalPayload) XXX_Size() int { + return xxx_messageInfo_ChaincodeProposalPayload.Size(m) +} +func (m *ChaincodeProposalPayload) XXX_DiscardUnknown() { + xxx_messageInfo_ChaincodeProposalPayload.DiscardUnknown(m) +} + +var xxx_messageInfo_ChaincodeProposalPayload proto.InternalMessageInfo + +func (m *ChaincodeProposalPayload) GetInput() []byte { + if m != nil { + return m.Input + } + return nil +} + +func (m *ChaincodeProposalPayload) GetTransientMap() map[string][]byte { + if m != nil { + return m.TransientMap + } + return nil +} + +// ChaincodeAction contains the actions the events generated by the execution +// of the chaincode. +type ChaincodeAction struct { + // This field contains the read set and the write set produced by the + // chaincode executing this invocation. + Results []byte `protobuf:"bytes,1,opt,name=results,proto3" json:"results,omitempty"` + // This field contains the events generated by the chaincode executing this + // invocation. + Events []byte `protobuf:"bytes,2,opt,name=events,proto3" json:"events,omitempty"` + // This field contains the result of executing this invocation. + Response *Response `protobuf:"bytes,3,opt,name=response,proto3" json:"response,omitempty"` + // This field contains the ChaincodeID of executing this invocation. Endorser + // will set it with the ChaincodeID called by endorser while simulating proposal. + // Committer will validate the version matching with latest chaincode version. + // Adding ChaincodeID to keep version opens up the possibility of multiple + // ChaincodeAction per transaction. + ChaincodeId *ChaincodeID `protobuf:"bytes,4,opt,name=chaincode_id,json=chaincodeId,proto3" json:"chaincode_id,omitempty"` + // This field contains the token expectation generated by the chaincode + // executing this invocation + TokenExpectation *token.TokenExpectation `protobuf:"bytes,5,opt,name=token_expectation,json=tokenExpectation,proto3" json:"token_expectation,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ChaincodeAction) Reset() { *m = ChaincodeAction{} } +func (m *ChaincodeAction) String() string { return proto.CompactTextString(m) } +func (*ChaincodeAction) ProtoMessage() {} +func (*ChaincodeAction) Descriptor() ([]byte, []int) { + return fileDescriptor_proposal_2be65988745cf952, []int{4} +} +func (m *ChaincodeAction) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ChaincodeAction.Unmarshal(m, b) +} +func (m *ChaincodeAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ChaincodeAction.Marshal(b, m, deterministic) +} +func (dst *ChaincodeAction) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChaincodeAction.Merge(dst, src) +} +func (m *ChaincodeAction) XXX_Size() int { + return xxx_messageInfo_ChaincodeAction.Size(m) +} +func (m *ChaincodeAction) XXX_DiscardUnknown() { + xxx_messageInfo_ChaincodeAction.DiscardUnknown(m) +} + +var xxx_messageInfo_ChaincodeAction proto.InternalMessageInfo + +func (m *ChaincodeAction) GetResults() []byte { + if m != nil { + return m.Results + } + return nil +} + +func (m *ChaincodeAction) GetEvents() []byte { + if m != nil { + return m.Events + } + return nil +} + +func (m *ChaincodeAction) GetResponse() *Response { + if m != nil { + return m.Response + } + return nil +} + +func (m *ChaincodeAction) GetChaincodeId() *ChaincodeID { + if m != nil { + return m.ChaincodeId + } + return nil +} + +func (m *ChaincodeAction) GetTokenExpectation() *token.TokenExpectation { + if m != nil { + return m.TokenExpectation + } + return nil +} + +func init() { + proto.RegisterType((*SignedProposal)(nil), "sdk.protos.SignedProposal") + proto.RegisterType((*Proposal)(nil), "sdk.protos.Proposal") + proto.RegisterType((*ChaincodeHeaderExtension)(nil), "sdk.protos.ChaincodeHeaderExtension") + proto.RegisterType((*ChaincodeProposalPayload)(nil), "sdk.protos.ChaincodeProposalPayload") + proto.RegisterMapType((map[string][]byte)(nil), "sdk.protos.ChaincodeProposalPayload.TransientMapEntry") + proto.RegisterType((*ChaincodeAction)(nil), "sdk.protos.ChaincodeAction") +} + +func init() { proto.RegisterFile("peer/proposal.proto", fileDescriptor_proposal_2be65988745cf952) } + +var fileDescriptor_proposal_2be65988745cf952 = []byte{ + // 487 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x4f, 0x6f, 0xd3, 0x30, + 0x14, 0x57, 0x5a, 0x36, 0x36, 0xb7, 0x6c, 0xad, 0x37, 0xa1, 0xa8, 0xda, 0x61, 0x8a, 0x84, 0x34, + 0x24, 0x48, 0xa4, 0x22, 0x21, 0xc4, 0x05, 0x51, 0xa8, 0xc4, 0x0e, 0x48, 0x53, 0x18, 0x3b, 0xec, + 0x52, 0x9c, 0xe4, 0x91, 0x5a, 0x0d, 0xb6, 0x65, 0x3b, 0xd5, 0x72, 0xe4, 0xe3, 0xf1, 0x6d, 0xf8, + 0x08, 0xc8, 0xb1, 0x9d, 0x76, 0xed, 0x85, 0x53, 0xf2, 0xde, 0xef, 0xfd, 0x7e, 0xef, 0xaf, 0xd1, + 0x99, 0x00, 0x90, 0x89, 0x90, 0x5c, 0x70, 0x45, 0xaa, 0x58, 0x48, 0xae, 0x39, 0x3e, 0x6c, 0x3f, + 0x6a, 0x72, 0xde, 0x82, 0xf9, 0x92, 0x50, 0x96, 0xf3, 0x02, 0x2c, 0x3a, 0xb9, 0x78, 0x44, 0x59, + 0x48, 0x50, 0x82, 0x33, 0xe5, 0xd1, 0x50, 0xf3, 0x15, 0xb0, 0x04, 0x1e, 0x04, 0xe4, 0x9a, 0x68, + 0xca, 0x99, 0xb2, 0x48, 0xf4, 0x1d, 0x9d, 0x7c, 0xa3, 0x25, 0x83, 0xe2, 0xc6, 0x51, 0xf1, 0x0b, + 0x74, 0xd2, 0xc9, 0x64, 0x8d, 0x06, 0x15, 0x06, 0x97, 0xc1, 0xd5, 0x30, 0x7d, 0xe6, 0xbd, 0x33, + 0xe3, 0xc4, 0x17, 0xe8, 0x58, 0xd1, 0x92, 0x11, 0x5d, 0x4b, 0x08, 0x7b, 0x6d, 0xc4, 0xc6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cc, 0x6e, 0x24, 0xa8, 0xba, 0xd2, 0x7e, 0xfb, 0xde, 0x34, 0xdb, 0x84, 0x35, + 0x30, 0xad, 0x9c, 0x90, 0xb3, 0xf0, 0x2b, 0x74, 0xe4, 0x8f, 0xae, 0x5d, 0xd9, 0x60, 0x3a, 0xf2, + 0xad, 0xa5, 0xce, 0x9f, 0x76, 0x11, 0x7b, 0x73, 0x7f, 0xf2, 0x7f, 0x73, 0xc7, 0x73, 0x34, 0x6e, + 0x4f, 0x79, 0xb1, 0x75, 0xca, 0xe1, 0x41, 0x4b, 0x0e, 0x3d, 0xf9, 0xd6, 0x04, 0xcc, 0x37, 0x78, + 0x3a, 0xd2, 0x3b, 0x9e, 0xd9, 0x0f, 0x14, 0x71, 0x59, 0xc6, 0xcb, 0x46, 0x80, 0xac, 0xa0, 0x28, + 0x41, 0xc6, 0x3f, 0x49, 0x26, 0x69, 0xee, 0x35, 0xcc, 0x6b, 0x9a, 0x9d, 0x6e, 0x56, 0x91, 0xaf, + 0x48, 0x09, 0xf7, 0x2f, 0x4b, 0xaa, 0x97, 0x75, 0x16, 0xe7, 0xfc, 0x57, 0xb2, 0xc5, 0x4d, 0x2c, + 0x37, 0xb1, 0xdc, 0xc4, 0x70, 0x33, 0xfb, 0x5a, 0xdf, 0xfc, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xaa, + 0xf2, 0x0a, 0xf6, 0xcb, 0x03, 0x00, 0x00, +} diff --git a/fabric/protos/peer/proposal_response.pb.go b/fabric/protos/peer/proposal_response.pb.go new file mode 100644 index 0000000..50da975 --- /dev/null +++ b/fabric/protos/peer/proposal_response.pb.go @@ -0,0 +1,336 @@ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: peer/proposal_response.proto + +package peer // import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/peer" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import timestamp "github.com/golang/protobuf/ptypes/timestamp" + +// 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 + +// A ProposalResponse is returned from an endorser to the proposal submitter. +// The idea is that this message contains the endorser's response to the +// request of a client to perform an action over a chaincode (or more +// generically on the ledger); the response might be success/error (conveyed in +// the Response field) together with a description of the action and a +// signature over it by that endorser. If a sufficient number of distinct +// endorsers agree on the same action and produce signature to that effect, a +// transaction can be generated and sent for ordering. +type ProposalResponse struct { + // Version indicates message protocol version + Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + // Timestamp is the time that the message + // was created as defined by the sender + Timestamp *timestamp.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // A response message indicating whether the + // endorsement of the action was successful + Response *Response `protobuf:"bytes,4,opt,name=response,proto3" json:"response,omitempty"` + // The payload of response. It is the bytes of ProposalResponsePayload + Payload []byte `protobuf:"bytes,5,opt,name=payload,proto3" json:"payload,omitempty"` + // The endorsement of the proposal, basically + // the endorser's signature over the payload + Endorsement *Endorsement `protobuf:"bytes,6,opt,name=endorsement,proto3" json:"endorsement,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ProposalResponse) Reset() { *m = ProposalResponse{} } +func (m *ProposalResponse) String() string { return proto.CompactTextString(m) } +func (*ProposalResponse) ProtoMessage() {} +func (*ProposalResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_proposal_response_22a755721b685f40, []int{0} +} +func (m *ProposalResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ProposalResponse.Unmarshal(m, b) +} +func (m *ProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ProposalResponse.Marshal(b, m, deterministic) +} +func (dst *ProposalResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProposalResponse.Merge(dst, src) +} +func (m *ProposalResponse) XXX_Size() int { + return xxx_messageInfo_ProposalResponse.Size(m) +} +func (m *ProposalResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ProposalResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ProposalResponse proto.InternalMessageInfo + +func (m *ProposalResponse) GetVersion() int32 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *ProposalResponse) GetTimestamp() *timestamp.Timestamp { + if m != nil { + return m.Timestamp + } + return nil +} + +func (m *ProposalResponse) GetResponse() *Response { + if m != nil { + return m.Response + } + return nil +} + +func (m *ProposalResponse) GetPayload() []byte { + if m != nil { + return m.Payload + } + return nil +} + +func (m *ProposalResponse) GetEndorsement() *Endorsement { + if m != nil { + return m.Endorsement + } + return nil +} + +// A response with a representation similar to an HTTP response that can +// be used within another message. +type Response struct { + // A status code that should follow the HTTP status codes. + Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` + // A message associated with the response code. + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + // A payload that can be used to include metadata with this response. + Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Response) Reset() { *m = Response{} } +func (m *Response) String() string { return proto.CompactTextString(m) } +func (*Response) ProtoMessage() {} +func (*Response) Descriptor() ([]byte, []int) { + return fileDescriptor_proposal_response_22a755721b685f40, []int{1} +} +func (m *Response) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Response.Unmarshal(m, b) +} +func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Response.Marshal(b, m, deterministic) +} +func (dst *Response) XXX_Merge(src proto.Message) { + xxx_messageInfo_Response.Merge(dst, src) +} +func (m *Response) XXX_Size() int { + return xxx_messageInfo_Response.Size(m) +} +func (m *Response) XXX_DiscardUnknown() { + xxx_messageInfo_Response.DiscardUnknown(m) +} + +var xxx_messageInfo_Response proto.InternalMessageInfo + +func (m *Response) GetStatus() int32 { + if m != nil { + return m.Status + } + return 0 +} + +func (m *Response) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +func (m *Response) GetPayload() []byte { + if m != nil { + return m.Payload + } + return nil +} + +// ProposalResponsePayload is the payload of a proposal response. This message +// is the "bridge" between the client's request and the endorser's action in +// response to that request. Concretely, for chaincodes, it contains a hashed +// representation of the proposal (proposalHash) and a representation of the +// chaincode state changes and events inside the extension field. +type ProposalResponsePayload struct { + // Hash of the proposal that triggered this response. The hash is used to + // link a response with its proposal, both for bookeeping purposes on an + // asynchronous system and for security reasons (accountability, + // non-repudiation). The hash usually covers the entire Proposal message + // (byte-by-byte). However this implies that the hash can only be verified + // if the entire proposal message is available when ProposalResponsePayload is + // included in a transaction or stored in the ledger. For confidentiality + // reasons, with chaincodes it might be undesirable to store the proposal + // payload in the ledger. If the type is CHAINCODE, this is handled by + // separating the proposal's header and + // the payload: the header is always hashed in its entirety whereas the + // payload can either be hashed fully, or only its hash may be hashed, or + // nothing from the payload can be hashed. The PayloadVisibility field in the + // Header's extension controls to which extent the proposal payload is + // "visible" in the sense that was just explained. + ProposalHash []byte `protobuf:"bytes,1,opt,name=proposal_hash,json=proposalHash,proto3" json:"proposal_hash,omitempty"` + // Extension should be unmarshaled to a type-specific message. The type of + // the extension in any proposal response depends on the type of the proposal + // that the client selected when the proposal was initially sent out. In + // particular, this information is stored in the type field of a Header. For + // chaincode, it's a ChaincodeAction message + Extension []byte `protobuf:"bytes,2,opt,name=extension,proto3" json:"extension,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ProposalResponsePayload) Reset() { *m = ProposalResponsePayload{} } +func (m *ProposalResponsePayload) String() string { return proto.CompactTextString(m) } +func (*ProposalResponsePayload) ProtoMessage() {} +func (*ProposalResponsePayload) Descriptor() ([]byte, []int) { + return fileDescriptor_proposal_response_22a755721b685f40, []int{2} +} +func (m *ProposalResponsePayload) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ProposalResponsePayload.Unmarshal(m, b) +} +func (m *ProposalResponsePayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ProposalResponsePayload.Marshal(b, m, deterministic) +} +func (dst *ProposalResponsePayload) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProposalResponsePayload.Merge(dst, src) +} +func (m *ProposalResponsePayload) XXX_Size() int { + return xxx_messageInfo_ProposalResponsePayload.Size(m) +} +func (m *ProposalResponsePayload) XXX_DiscardUnknown() { + xxx_messageInfo_ProposalResponsePayload.DiscardUnknown(m) +} + +var xxx_messageInfo_ProposalResponsePayload proto.InternalMessageInfo + +func (m *ProposalResponsePayload) GetProposalHash() []byte { + if m != nil { + return m.ProposalHash + } + return nil +} + +func (m *ProposalResponsePayload) GetExtension() []byte { + if m != nil { + return m.Extension + } + return nil +} + +// An endorsement is a signature of an endorser over a proposal response. By +// producing an endorsement message, an endorser implicitly "approves" that +// proposal response and the actions contained therein. When enough +// endorsements have been collected, a transaction can be generated out of a +// set of proposal responses. Note that this message only contains an identity +// and a signature but no signed payload. This is intentional because +// endorsements are supposed to be collected in a transaction, and they are all +// expected to endorse a single proposal response/action (many endorsements +// over a single proposal response) +type Endorsement struct { + // Identity of the endorser (e.g. its certificate) + Endorser []byte `protobuf:"bytes,1,opt,name=endorser,proto3" json:"endorser,omitempty"` + // Signature of the payload included in ProposalResponse concatenated with + // the endorser's certificate; ie, sign(ProposalResponse.payload + endorser) + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Endorsement) Reset() { *m = Endorsement{} } +func (m *Endorsement) String() string { return proto.CompactTextString(m) } +func (*Endorsement) ProtoMessage() {} +func (*Endorsement) Descriptor() ([]byte, []int) { + return fileDescriptor_proposal_response_22a755721b685f40, []int{3} +} +func (m *Endorsement) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Endorsement.Unmarshal(m, b) +} +func (m *Endorsement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Endorsement.Marshal(b, m, deterministic) +} +func (dst *Endorsement) XXX_Merge(src proto.Message) { + xxx_messageInfo_Endorsement.Merge(dst, src) +} +func (m *Endorsement) XXX_Size() int { + return xxx_messageInfo_Endorsement.Size(m) +} +func (m *Endorsement) XXX_DiscardUnknown() { + xxx_messageInfo_Endorsement.DiscardUnknown(m) +} + +var xxx_messageInfo_Endorsement proto.InternalMessageInfo + +func (m *Endorsement) GetEndorser() []byte { + if m != nil { + return m.Endorser + } + return nil +} + +func (m *Endorsement) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +func init() { + proto.RegisterType((*ProposalResponse)(nil), "sdk.protos.ProposalResponse") + proto.RegisterType((*Response)(nil), "sdk.protos.Response") + proto.RegisterType((*ProposalResponsePayload)(nil), "sdk.protos.ProposalResponsePayload") + proto.RegisterType((*Endorsement)(nil), "sdk.protos.Endorsement") +} + +func init() { + proto.RegisterFile("peer/proposal_response.proto", fileDescriptor_proposal_response_22a755721b685f40) +} + +var fileDescriptor_proposal_response_22a755721b685f40 = []byte{ + // 367 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x51, 0x4b, 0xfb, 0x30, + 0x14, 0xc5, 0xe9, 0xfe, 0xff, 0xcd, 0x2d, 0x9b, 0x30, 0x2a, 0x68, 0x19, 0x03, 0x47, 0x7d, 0x99, + 0x20, 0x29, 0x28, 0x82, 0xcf, 0x03, 0xd1, 0xc7, 0x11, 0xc4, 0x07, 0x11, 0x24, 0xdd, 0xee, 0xd2, + 0x62, 0xdb, 0x84, 0xdc, 0x54, 0xdc, 0x07, 0xf6, 0x7b, 0x48, 0xd3, 0xa6, 0xab, 0xe2, 0xd3, 0x38, + 0x77, 0x27, 0xbf, 0x7b, 0xcf, 0xed, 0x25, 0x73, 0x05, 0xa0, 0x23, 0xa5, 0xa5, 0x92, 0xc8, 0xb3, + 0x37, 0x0d, 0xa8, 0x64, 0x81, 0x40, 0x95, 0x96, 0x46, 0xfa, 0x03, 0xfb, 0x83, 0xb3, 0x73, 0x21, + 0xa5, 0xc8, 0x20, 0xb2, 0x32, 0x2e, 0x77, 0x91, 0x49, 0x73, 0x40, 0xc3, 0x73, 0x55, 0x1b, 0xc3, + 0x2f, 0x8f, 0x4c, 0xd7, 0x0d, 0x84, 0x35, 0x0c, 0x3f, 0x20, 0x47, 0x1f, 0xa0, 0x31, 0x95, 0x45, + 0xe0, 0x2d, 0xbc, 0x65, 0x9f, 0x39, 0xe9, 0xdf, 0x91, 0x51, 0x4b, 0x08, 0x7a, 0x0b, 0x6f, 0x39, + 0xbe, 0x9e, 0xd1, 0xba, 0x07, 0x75, 0x3d, 0xe8, 0x93, 0x73, 0xb0, 0x83, 0xd9, 0xbf, 0x22, 0x43, + 0x37, 0x63, 0xf0, 0xdf, 0x3e, 0x9c, 0xd6, 0x2f, 0x90, 0xba, 0xbe, 0xac, 0x75, 0x54, 0x13, 0x28, + 0xbe, 0xcf, 0x24, 0xdf, 0x06, 0xfd, 0x85, 0xb7, 0x9c, 0x30, 0x27, 0xfd, 0x5b, 0x32, 0x86, 0x62, + 0x2b, 0x35, 0x42, 0x0e, 0x85, 0x09, 0x06, 0x16, 0x75, 0xe2, 0x50, 0xf7, 0x87, 0xbf, 0x58, 0xd7, + 0x17, 0x3e, 0x93, 0x61, 0x1b, 0xef, 0x94, 0x0c, 0xd0, 0x70, 0x53, 0x62, 0x93, 0xae, 0x51, 0x55, + 0xd3, 0x1c, 0x10, 0xb9, 0x00, 0x1b, 0x6d, 0xc4, 0x9c, 0xec, 0x8e, 0xf3, 0xef, 0xc7, 0x38, 0xe1, + 0x2b, 0x39, 0xfb, 0xbd, 0xbe, 0x75, 0x33, 0xe9, 0x05, 0x39, 0x6e, 0x3f, 0x4f, 0xc2, 0x31, 0xb1, + 0xdd, 0x26, 0x6c, 0xe2, 0x8a, 0x8f, 0x1c, 0x13, 0x7f, 0x4e, 0x46, 0xf0, 0x69, 0xa0, 0xb0, 0xcb, + 0xee, 0x59, 0xc3, 0xa1, 0x10, 0x3e, 0x90, 0x71, 0x27, 0x91, 0x3f, 0x23, 0xc3, 0x26, 0x93, 0x6e, + 0x60, 0xad, 0xae, 0x40, 0x98, 0x8a, 0x82, 0x9b, 0x52, 0x83, 0x03, 0xb5, 0x85, 0x55, 0x42, 0x42, + 0xa9, 0x05, 0x4d, 0xf6, 0x0a, 0x74, 0x06, 0x5b, 0x01, 0x9a, 0xee, 0x78, 0xac, 0xd3, 0x8d, 0x5b, + 0x5c, 0x75, 0x4d, 0xab, 0x3f, 0xa2, 0x6c, 0xde, 0xb9, 0x80, 0x97, 0x4b, 0x91, 0x9a, 0xa4, 0x8c, + 0xe9, 0x46, 0xe6, 0x51, 0x87, 0x11, 0xd5, 0x8c, 0xfa, 0xba, 0x30, 0xaa, 0x18, 0x71, 0x7d, 0x79, + 0x37, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x0e, 0x52, 0x0b, 0x35, 0xa0, 0x02, 0x00, 0x00, +} diff --git a/fabric/protos/peer/query.pb.go b/fabric/protos/peer/query.pb.go new file mode 100644 index 0000000..f69101f --- /dev/null +++ b/fabric/protos/peer/query.pb.go @@ -0,0 +1,277 @@ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: peer/query.proto + +package peer // import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/peer" + +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 + +// ChaincodeQueryResponse returns information about each chaincode that pertains +// to a query in lscc.go, such as GetChaincodes (returns all chaincodes +// instantiated on a channel), and GetInstalledChaincodes (returns all chaincodes +// installed on a peer) +type ChaincodeQueryResponse struct { + Chaincodes []*ChaincodeInfo `protobuf:"bytes,1,rep,name=chaincodes,proto3" json:"chaincodes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ChaincodeQueryResponse) Reset() { *m = ChaincodeQueryResponse{} } +func (m *ChaincodeQueryResponse) String() string { return proto.CompactTextString(m) } +func (*ChaincodeQueryResponse) ProtoMessage() {} +func (*ChaincodeQueryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_query_37e5d407118e73f5, []int{0} +} +func (m *ChaincodeQueryResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ChaincodeQueryResponse.Unmarshal(m, b) +} +func (m *ChaincodeQueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ChaincodeQueryResponse.Marshal(b, m, deterministic) +} +func (dst *ChaincodeQueryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChaincodeQueryResponse.Merge(dst, src) +} +func (m *ChaincodeQueryResponse) XXX_Size() int { + return xxx_messageInfo_ChaincodeQueryResponse.Size(m) +} +func (m *ChaincodeQueryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ChaincodeQueryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ChaincodeQueryResponse proto.InternalMessageInfo + +func (m *ChaincodeQueryResponse) GetChaincodes() []*ChaincodeInfo { + if m != nil { + return m.Chaincodes + } + return nil +} + +// ChaincodeInfo contains general information about an installed/instantiated +// chaincode +type ChaincodeInfo struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + // the path as specified by the install/instantiate transaction + Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` + // the chaincode function upon instantiation and its arguments. This will be + // blank if the query is returning information about installed chaincodes. + Input string `protobuf:"bytes,4,opt,name=input,proto3" json:"input,omitempty"` + // the name of the ESCC for this chaincode. This will be + // blank if the query is returning information about installed chaincodes. + Escc string `protobuf:"bytes,5,opt,name=escc,proto3" json:"escc,omitempty"` + // the name of the VSCC for this chaincode. This will be + // blank if the query is returning information about installed chaincodes. + Vscc string `protobuf:"bytes,6,opt,name=vscc,proto3" json:"vscc,omitempty"` + // the chaincode unique id. + // computed as: H( + // H(name || version) || + // H(CodePackage) + // ) + Id []byte `protobuf:"bytes,7,opt,name=id,proto3" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ChaincodeInfo) Reset() { *m = ChaincodeInfo{} } +func (m *ChaincodeInfo) String() string { return proto.CompactTextString(m) } +func (*ChaincodeInfo) ProtoMessage() {} +func (*ChaincodeInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_query_37e5d407118e73f5, []int{1} +} +func (m *ChaincodeInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ChaincodeInfo.Unmarshal(m, b) +} +func (m *ChaincodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ChaincodeInfo.Marshal(b, m, deterministic) +} +func (dst *ChaincodeInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChaincodeInfo.Merge(dst, src) +} +func (m *ChaincodeInfo) XXX_Size() int { + return xxx_messageInfo_ChaincodeInfo.Size(m) +} +func (m *ChaincodeInfo) XXX_DiscardUnknown() { + xxx_messageInfo_ChaincodeInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_ChaincodeInfo proto.InternalMessageInfo + +func (m *ChaincodeInfo) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ChaincodeInfo) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *ChaincodeInfo) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *ChaincodeInfo) GetInput() string { + if m != nil { + return m.Input + } + return "" +} + +func (m *ChaincodeInfo) GetEscc() string { + if m != nil { + return m.Escc + } + return "" +} + +func (m *ChaincodeInfo) GetVscc() string { + if m != nil { + return m.Vscc + } + return "" +} + +func (m *ChaincodeInfo) GetId() []byte { + if m != nil { + return m.Id + } + return nil +} + +// ChannelQueryResponse returns information about each channel that pertains +// to a query in lscc.go, such as GetChannels (returns all channels for a +// given peer) +type ChannelQueryResponse struct { + Channels []*ChannelInfo `protobuf:"bytes,1,rep,name=channels,proto3" json:"channels,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ChannelQueryResponse) Reset() { *m = ChannelQueryResponse{} } +func (m *ChannelQueryResponse) String() string { return proto.CompactTextString(m) } +func (*ChannelQueryResponse) ProtoMessage() {} +func (*ChannelQueryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_query_37e5d407118e73f5, []int{2} +} +func (m *ChannelQueryResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ChannelQueryResponse.Unmarshal(m, b) +} +func (m *ChannelQueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ChannelQueryResponse.Marshal(b, m, deterministic) +} +func (dst *ChannelQueryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChannelQueryResponse.Merge(dst, src) +} +func (m *ChannelQueryResponse) XXX_Size() int { + return xxx_messageInfo_ChannelQueryResponse.Size(m) +} +func (m *ChannelQueryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ChannelQueryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ChannelQueryResponse proto.InternalMessageInfo + +func (m *ChannelQueryResponse) GetChannels() []*ChannelInfo { + if m != nil { + return m.Channels + } + return nil +} + +// ChannelInfo contains general information about channels +type ChannelInfo struct { + ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ChannelInfo) Reset() { *m = ChannelInfo{} } +func (m *ChannelInfo) String() string { return proto.CompactTextString(m) } +func (*ChannelInfo) ProtoMessage() {} +func (*ChannelInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_query_37e5d407118e73f5, []int{3} +} +func (m *ChannelInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ChannelInfo.Unmarshal(m, b) +} +func (m *ChannelInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ChannelInfo.Marshal(b, m, deterministic) +} +func (dst *ChannelInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChannelInfo.Merge(dst, src) +} +func (m *ChannelInfo) XXX_Size() int { + return xxx_messageInfo_ChannelInfo.Size(m) +} +func (m *ChannelInfo) XXX_DiscardUnknown() { + xxx_messageInfo_ChannelInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_ChannelInfo proto.InternalMessageInfo + +func (m *ChannelInfo) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +func init() { + proto.RegisterType((*ChaincodeQueryResponse)(nil), "sdk.protos.ChaincodeQueryResponse") + proto.RegisterType((*ChaincodeInfo)(nil), "sdk.protos.ChaincodeInfo") + proto.RegisterType((*ChannelQueryResponse)(nil), "sdk.protos.ChannelQueryResponse") + proto.RegisterType((*ChannelInfo)(nil), "sdk.protos.ChannelInfo") +} + +func init() { proto.RegisterFile("peer/query.proto", fileDescriptor_query_37e5d407118e73f5) } + +var fileDescriptor_query_37e5d407118e73f5 = []byte{ + // 296 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0xdf, 0x4a, 0xc3, 0x30, + 0x14, 0xc6, 0xe9, 0xfe, 0xba, 0x33, 0x15, 0x89, 0x53, 0x72, 0x23, 0x8c, 0x5e, 0x4d, 0x90, 0x16, + 0x14, 0x5f, 0xc0, 0x5d, 0xc8, 0xae, 0x86, 0xbd, 0xf4, 0x46, 0xba, 0xe4, 0x6c, 0x0d, 0x6c, 0x49, + 0x4c, 0xba, 0xc1, 0x9e, 0xc6, 0x57, 0x95, 0x93, 0xac, 0xa3, 0xbb, 0xea, 0x39, 0xbf, 0xef, 0x17, + 0xca, 0x97, 0xc0, 0x9d, 0x45, 0x74, 0xf9, 0xef, 0x1e, 0xdd, 0x31, 0xb3, 0xce, 0xd4, 0x86, 0x0d, + 0xc2, 0xc7, 0xa7, 0x4b, 0x78, 0x9c, 0x57, 0xa5, 0xd2, 0xc2, 0x48, 0xfc, 0xa2, 0xbc, 0x40, 0x6f, + 0x8d, 0xf6, 0xc8, 0xde, 0x01, 0x44, 0x93, 0x78, 0x9e, 0x4c, 0xbb, 0xb3, 0xf1, 0xeb, 0x43, 0x3c, + 0xed, 0xb3, 0xf3, 0x99, 0x85, 0x5e, 0x9b, 0xa2, 0x25, 0xa6, 0x7f, 0x09, 0xdc, 0x5c, 0xa4, 0x8c, + 0x41, 0x4f, 0x97, 0x3b, 0xe4, 0xc9, 0x34, 0x99, 0x8d, 0x8a, 0x30, 0x33, 0x0e, 0xc3, 0x03, 0x3a, + 0xaf, 0x8c, 0xe6, 0x9d, 0x80, 0x9b, 0x95, 0x6c, 0x5b, 0xd6, 0x15, 0xef, 0x46, 0x9b, 0x66, 0x36, + 0x81, 0xbe, 0xd2, 0x76, 0x5f, 0xf3, 0x5e, 0x80, 0x71, 0x21, 0x13, 0xbd, 0x10, 0xbc, 0x1f, 0x4d, + 0x9a, 0x89, 0x1d, 0x88, 0x0d, 0x22, 0xa3, 0x99, 0xdd, 0x42, 0x47, 0x49, 0x3e, 0x9c, 0x26, 0xb3, + 0xeb, 0xa2, 0xa3, 0x64, 0xfa, 0x09, 0x93, 0x79, 0x55, 0x6a, 0x8d, 0xdb, 0xcb, 0xc2, 0x39, 0x5c, + 0x89, 0xc8, 0x9b, 0xba, 0xf7, 0xad, 0xba, 0xc4, 0x43, 0xd9, 0xb3, 0x94, 0xbe, 0xc0, 0xb8, 0x15, + 0xb0, 0xa7, 0x70, 0x61, 0xb4, 0xfe, 0x28, 0x79, 0x6a, 0x3b, 0x3a, 0x91, 0x85, 0xfc, 0x58, 0x42, + 0x6a, 0xdc, 0x26, 0xab, 0x8e, 0x16, 0xdd, 0x16, 0xe5, 0x06, 0x5d, 0xb6, 0x2e, 0x57, 0x4e, 0x89, + 0xe6, 0x27, 0xf4, 0x46, 0xdf, 0xcf, 0x1b, 0x55, 0x57, 0xfb, 0x55, 0x26, 0xcc, 0x2e, 0x6f, 0xa9, + 0x79, 0x54, 0xf3, 0xa8, 0xe6, 0xa4, 0xae, 0xe2, 0x13, 0xbe, 0xfd, 0x07, 0x00, 0x00, 0xff, 0xff, + 0x79, 0x94, 0xb3, 0xbd, 0xdd, 0x01, 0x00, 0x00, +} diff --git a/fabric/protos/peer/signed_cc_dep_spec.pb.go b/fabric/protos/peer/signed_cc_dep_spec.pb.go new file mode 100644 index 0000000..716fb70 --- /dev/null +++ b/fabric/protos/peer/signed_cc_dep_spec.pb.go @@ -0,0 +1,114 @@ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: peer/signed_cc_dep_spec.proto + +package peer // import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/peer" + +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 + +// SignedChaincodeDeploymentSpec carries the CDS along with endorsements +type SignedChaincodeDeploymentSpec struct { + // This is the bytes of the ChaincodeDeploymentSpec + ChaincodeDeploymentSpec []byte `protobuf:"bytes,1,opt,name=chaincode_deployment_spec,json=chaincodeDeploymentSpec,proto3" json:"chaincode_deployment_spec,omitempty"` + // This is the instantiation policy which is identical in structure + // to endorsement policy. This policy is checked by the VSCC at commit + // time on the instantiation (all peers will get the same policy as it + // will be part of the LSCC instantation record and will be part of the + // hash as well) + InstantiationPolicy []byte `protobuf:"bytes,2,opt,name=instantiation_policy,json=instantiationPolicy,proto3" json:"instantiation_policy,omitempty"` + // The endorsements of the above deployment spec, the owner's signature over + // chaincode_deployment_spec and Endorsement.endorser. + OwnerEndorsements []*Endorsement `protobuf:"bytes,3,rep,name=owner_endorsements,json=ownerEndorsements,proto3" json:"owner_endorsements,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignedChaincodeDeploymentSpec) Reset() { *m = SignedChaincodeDeploymentSpec{} } +func (m *SignedChaincodeDeploymentSpec) String() string { return proto.CompactTextString(m) } +func (*SignedChaincodeDeploymentSpec) ProtoMessage() {} +func (*SignedChaincodeDeploymentSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_signed_cc_dep_spec_80ee01f5d5123140, []int{0} +} +func (m *SignedChaincodeDeploymentSpec) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignedChaincodeDeploymentSpec.Unmarshal(m, b) +} +func (m *SignedChaincodeDeploymentSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignedChaincodeDeploymentSpec.Marshal(b, m, deterministic) +} +func (dst *SignedChaincodeDeploymentSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignedChaincodeDeploymentSpec.Merge(dst, src) +} +func (m *SignedChaincodeDeploymentSpec) XXX_Size() int { + return xxx_messageInfo_SignedChaincodeDeploymentSpec.Size(m) +} +func (m *SignedChaincodeDeploymentSpec) XXX_DiscardUnknown() { + xxx_messageInfo_SignedChaincodeDeploymentSpec.DiscardUnknown(m) +} + +var xxx_messageInfo_SignedChaincodeDeploymentSpec proto.InternalMessageInfo + +func (m *SignedChaincodeDeploymentSpec) GetChaincodeDeploymentSpec() []byte { + if m != nil { + return m.ChaincodeDeploymentSpec + } + return nil +} + +func (m *SignedChaincodeDeploymentSpec) GetInstantiationPolicy() []byte { + if m != nil { + return m.InstantiationPolicy + } + return nil +} + +func (m *SignedChaincodeDeploymentSpec) GetOwnerEndorsements() []*Endorsement { + if m != nil { + return m.OwnerEndorsements + } + return nil +} + +func init() { + proto.RegisterType((*SignedChaincodeDeploymentSpec)(nil), "sdk.protos.SignedChaincodeDeploymentSpec") +} + +func init() { + proto.RegisterFile("peer/signed_cc_dep_spec.proto", fileDescriptor_signed_cc_dep_spec_80ee01f5d5123140) +} + +var fileDescriptor_signed_cc_dep_spec_80ee01f5d5123140 = []byte{ + // 255 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xc1, 0x4a, 0xc3, 0x40, + 0x10, 0x86, 0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xc5, 0x2c, 0x49, 0xda, 0xa2, 0x1b, 0x18, 0xa5, 0xc7, + 0xa6, 0x45, 0x29, 0xde, 0xab, 0x5a, 0x1c, 0xec, 0xf3, 0x63, 0x25, 0x6f, 0x37, 0xad, 0x0b, 0xdd, + 0x47, 0x5d, 0x00, 0xed, 0xca, 0x03, 0xb5, 0x4c, 0x6a, 0x99, 0xd4, 0x72, 0x54, 0xeb, 0xd4, 0xe5, + 0xfd, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x40, 0x4c, 0x9e, 0x73, 0x01, 0x00, 0x00, +} diff --git a/fabric/protos/peer/transaction.pb.go b/fabric/protos/peer/transaction.pb.go new file mode 100644 index 0000000..f8dd878 --- /dev/null +++ b/fabric/protos/peer/transaction.pb.go @@ -0,0 +1,539 @@ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: peer/transaction.proto + +package peer // import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/peer" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "github.com/golang/protobuf/ptypes/timestamp" +import common "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/common" + +// 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 TxValidationCode int32 + +const ( + TxValidationCode_VALID TxValidationCode = 0 + TxValidationCode_NIL_ENVELOPE TxValidationCode = 1 + TxValidationCode_BAD_PAYLOAD TxValidationCode = 2 + TxValidationCode_BAD_COMMON_HEADER TxValidationCode = 3 + TxValidationCode_BAD_CREATOR_SIGNATURE TxValidationCode = 4 + TxValidationCode_INVALID_ENDORSER_TRANSACTION TxValidationCode = 5 + TxValidationCode_INVALID_CONFIG_TRANSACTION TxValidationCode = 6 + TxValidationCode_UNSUPPORTED_TX_PAYLOAD TxValidationCode = 7 + TxValidationCode_BAD_PROPOSAL_TXID TxValidationCode = 8 + TxValidationCode_DUPLICATE_TXID TxValidationCode = 9 + TxValidationCode_ENDORSEMENT_POLICY_FAILURE TxValidationCode = 10 + TxValidationCode_MVCC_READ_CONFLICT TxValidationCode = 11 + TxValidationCode_PHANTOM_READ_CONFLICT TxValidationCode = 12 + TxValidationCode_UNKNOWN_TX_TYPE TxValidationCode = 13 + TxValidationCode_TARGET_CHAIN_NOT_FOUND TxValidationCode = 14 + TxValidationCode_MARSHAL_TX_ERROR TxValidationCode = 15 + TxValidationCode_NIL_TXACTION TxValidationCode = 16 + TxValidationCode_EXPIRED_CHAINCODE TxValidationCode = 17 + TxValidationCode_CHAINCODE_VERSION_CONFLICT TxValidationCode = 18 + TxValidationCode_BAD_HEADER_EXTENSION TxValidationCode = 19 + TxValidationCode_BAD_CHANNEL_HEADER TxValidationCode = 20 + TxValidationCode_BAD_RESPONSE_PAYLOAD TxValidationCode = 21 + TxValidationCode_BAD_RWSET TxValidationCode = 22 + TxValidationCode_ILLEGAL_WRITESET TxValidationCode = 23 + TxValidationCode_INVALID_WRITESET TxValidationCode = 24 + TxValidationCode_NOT_VALIDATED TxValidationCode = 254 + TxValidationCode_INVALID_OTHER_REASON TxValidationCode = 255 +) + +var TxValidationCode_name = map[int32]string{ + 0: "VALID", + 1: "NIL_ENVELOPE", + 2: "BAD_PAYLOAD", + 3: "BAD_COMMON_HEADER", + 4: "BAD_CREATOR_SIGNATURE", + 5: "INVALID_ENDORSER_TRANSACTION", + 6: "INVALID_CONFIG_TRANSACTION", + 7: "UNSUPPORTED_TX_PAYLOAD", + 8: "BAD_PROPOSAL_TXID", + 9: "DUPLICATE_TXID", + 10: "ENDORSEMENT_POLICY_FAILURE", + 11: "MVCC_READ_CONFLICT", + 12: "PHANTOM_READ_CONFLICT", + 13: "UNKNOWN_TX_TYPE", + 14: "TARGET_CHAIN_NOT_FOUND", + 15: "MARSHAL_TX_ERROR", + 16: "NIL_TXACTION", + 17: "EXPIRED_CHAINCODE", + 18: "CHAINCODE_VERSION_CONFLICT", + 19: "BAD_HEADER_EXTENSION", + 20: "BAD_CHANNEL_HEADER", + 21: "BAD_RESPONSE_PAYLOAD", + 22: "BAD_RWSET", + 23: "ILLEGAL_WRITESET", + 24: "INVALID_WRITESET", + 254: "NOT_VALIDATED", + 255: "INVALID_OTHER_REASON", +} +var TxValidationCode_value = map[string]int32{ + "VALID": 0, + "NIL_ENVELOPE": 1, + "BAD_PAYLOAD": 2, + "BAD_COMMON_HEADER": 3, + "BAD_CREATOR_SIGNATURE": 4, + "INVALID_ENDORSER_TRANSACTION": 5, + "INVALID_CONFIG_TRANSACTION": 6, + "UNSUPPORTED_TX_PAYLOAD": 7, + "BAD_PROPOSAL_TXID": 8, + "DUPLICATE_TXID": 9, + "ENDORSEMENT_POLICY_FAILURE": 10, + "MVCC_READ_CONFLICT": 11, + "PHANTOM_READ_CONFLICT": 12, + "UNKNOWN_TX_TYPE": 13, + "TARGET_CHAIN_NOT_FOUND": 14, + "MARSHAL_TX_ERROR": 15, + "NIL_TXACTION": 16, + "EXPIRED_CHAINCODE": 17, + "CHAINCODE_VERSION_CONFLICT": 18, + "BAD_HEADER_EXTENSION": 19, + "BAD_CHANNEL_HEADER": 20, + "BAD_RESPONSE_PAYLOAD": 21, + "BAD_RWSET": 22, + "ILLEGAL_WRITESET": 23, + "INVALID_WRITESET": 24, + "NOT_VALIDATED": 254, + "INVALID_OTHER_REASON": 255, +} + +func (x TxValidationCode) String() string { + return proto.EnumName(TxValidationCode_name, int32(x)) +} +func (TxValidationCode) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_transaction_4fbd1a0e1a50cfab, []int{0} +} + +// Reserved entries in the key-level metadata map +type MetaDataKeys int32 + +const ( + MetaDataKeys_VALIDATION_PARAMETER MetaDataKeys = 0 +) + +var MetaDataKeys_name = map[int32]string{ + 0: "VALIDATION_PARAMETER", +} +var MetaDataKeys_value = map[string]int32{ + "VALIDATION_PARAMETER": 0, +} + +func (x MetaDataKeys) String() string { + return proto.EnumName(MetaDataKeys_name, int32(x)) +} +func (MetaDataKeys) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_transaction_4fbd1a0e1a50cfab, []int{1} +} + +// This message is necessary to facilitate the verification of the signature +// (in the signature field) over the bytes of the transaction (in the +// transactionBytes field). +type SignedTransaction struct { + // The bytes of the Transaction. NDD + TransactionBytes []byte `protobuf:"bytes,1,opt,name=transaction_bytes,json=transactionBytes,proto3" json:"transaction_bytes,omitempty"` + // Signature of the transactionBytes The public key of the signature is in + // the header field of TransactionAction There might be multiple + // TransactionAction, so multiple headers, but there should be same + // transactor identity (cert) in all headers + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignedTransaction) Reset() { *m = SignedTransaction{} } +func (m *SignedTransaction) String() string { return proto.CompactTextString(m) } +func (*SignedTransaction) ProtoMessage() {} +func (*SignedTransaction) Descriptor() ([]byte, []int) { + return fileDescriptor_transaction_4fbd1a0e1a50cfab, []int{0} +} +func (m *SignedTransaction) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignedTransaction.Unmarshal(m, b) +} +func (m *SignedTransaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignedTransaction.Marshal(b, m, deterministic) +} +func (dst *SignedTransaction) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignedTransaction.Merge(dst, src) +} +func (m *SignedTransaction) XXX_Size() int { + return xxx_messageInfo_SignedTransaction.Size(m) +} +func (m *SignedTransaction) XXX_DiscardUnknown() { + xxx_messageInfo_SignedTransaction.DiscardUnknown(m) +} + +var xxx_messageInfo_SignedTransaction proto.InternalMessageInfo + +func (m *SignedTransaction) GetTransactionBytes() []byte { + if m != nil { + return m.TransactionBytes + } + return nil +} + +func (m *SignedTransaction) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +// ProcessedTransaction wraps an Envelope that includes a transaction along with an indication +// of whether the transaction was validated or invalidated by committing peer. +// The use case is that GetTransactionByID API needs to retrieve the transaction Envelope +// from block storage, and return it to a client, and indicate whether the transaction +// was validated or invalidated by committing peer. So that the originally submitted +// transaction Envelope is not modified, the ProcessedTransaction wrapper is returned. +type ProcessedTransaction struct { + // An Envelope which includes a processed transaction + TransactionEnvelope *common.Envelope `protobuf:"bytes,1,opt,name=transactionEnvelope,proto3" json:"transactionEnvelope,omitempty"` + // An indication of whether the transaction was validated or invalidated by committing peer + ValidationCode int32 `protobuf:"varint,2,opt,name=validationCode,proto3" json:"validationCode,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ProcessedTransaction) Reset() { *m = ProcessedTransaction{} } +func (m *ProcessedTransaction) String() string { return proto.CompactTextString(m) } +func (*ProcessedTransaction) ProtoMessage() {} +func (*ProcessedTransaction) Descriptor() ([]byte, []int) { + return fileDescriptor_transaction_4fbd1a0e1a50cfab, []int{1} +} +func (m *ProcessedTransaction) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ProcessedTransaction.Unmarshal(m, b) +} +func (m *ProcessedTransaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ProcessedTransaction.Marshal(b, m, deterministic) +} +func (dst *ProcessedTransaction) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProcessedTransaction.Merge(dst, src) +} +func (m *ProcessedTransaction) XXX_Size() int { + return xxx_messageInfo_ProcessedTransaction.Size(m) +} +func (m *ProcessedTransaction) XXX_DiscardUnknown() { + xxx_messageInfo_ProcessedTransaction.DiscardUnknown(m) +} + +var xxx_messageInfo_ProcessedTransaction proto.InternalMessageInfo + +func (m *ProcessedTransaction) GetTransactionEnvelope() *common.Envelope { + if m != nil { + return m.TransactionEnvelope + } + return nil +} + +func (m *ProcessedTransaction) GetValidationCode() int32 { + if m != nil { + return m.ValidationCode + } + return 0 +} + +// The transaction to be sent to the ordering service. A transaction contains +// one or more TransactionAction. Each TransactionAction binds a proposal to +// potentially multiple actions. The transaction is atomic meaning that either +// all actions in the transaction will be committed or none will. Note that +// while a Transaction might include more than one Header, the Header.creator +// field must be the same in each. +// A single client is free to issue a number of independent Proposal, each with +// their header (Header) and request payload (ChaincodeProposalPayload). Each +// proposal is independently endorsed generating an action +// (ProposalResponsePayload) with one signature per Endorser. Any number of +// independent proposals (and their action) might be included in a transaction +// to ensure that they are treated atomically. +type Transaction struct { + // The payload is an array of TransactionAction. An array is necessary to + // accommodate multiple actions per transaction + Actions []*TransactionAction `protobuf:"bytes,1,rep,name=actions,proto3" json:"actions,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Transaction) Reset() { *m = Transaction{} } +func (m *Transaction) String() string { return proto.CompactTextString(m) } +func (*Transaction) ProtoMessage() {} +func (*Transaction) Descriptor() ([]byte, []int) { + return fileDescriptor_transaction_4fbd1a0e1a50cfab, []int{2} +} +func (m *Transaction) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Transaction.Unmarshal(m, b) +} +func (m *Transaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Transaction.Marshal(b, m, deterministic) +} +func (dst *Transaction) XXX_Merge(src proto.Message) { + xxx_messageInfo_Transaction.Merge(dst, src) +} +func (m *Transaction) XXX_Size() int { + return xxx_messageInfo_Transaction.Size(m) +} +func (m *Transaction) XXX_DiscardUnknown() { + xxx_messageInfo_Transaction.DiscardUnknown(m) +} + +var xxx_messageInfo_Transaction proto.InternalMessageInfo + +func (m *Transaction) GetActions() []*TransactionAction { + if m != nil { + return m.Actions + } + return nil +} + +// TransactionAction binds a proposal to its action. The type field in the +// header dictates the type of action to be applied to the ledger. +type TransactionAction struct { + // The header of the proposal action, which is the proposal header + Header []byte `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // The payload of the action as defined by the type in the header For + // chaincode, it's the bytes of ChaincodeActionPayload + 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 *TransactionAction) Reset() { *m = TransactionAction{} } +func (m *TransactionAction) String() string { return proto.CompactTextString(m) } +func (*TransactionAction) ProtoMessage() {} +func (*TransactionAction) Descriptor() ([]byte, []int) { + return fileDescriptor_transaction_4fbd1a0e1a50cfab, []int{3} +} +func (m *TransactionAction) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TransactionAction.Unmarshal(m, b) +} +func (m *TransactionAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TransactionAction.Marshal(b, m, deterministic) +} +func (dst *TransactionAction) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransactionAction.Merge(dst, src) +} +func (m *TransactionAction) XXX_Size() int { + return xxx_messageInfo_TransactionAction.Size(m) +} +func (m *TransactionAction) XXX_DiscardUnknown() { + xxx_messageInfo_TransactionAction.DiscardUnknown(m) +} + +var xxx_messageInfo_TransactionAction proto.InternalMessageInfo + +func (m *TransactionAction) GetHeader() []byte { + if m != nil { + return m.Header + } + return nil +} + +func (m *TransactionAction) GetPayload() []byte { + if m != nil { + return m.Payload + } + return nil +} + +// ChaincodeActionPayload is the message to be used for the TransactionAction's +// payload when the Header's type is set to CHAINCODE. It carries the +// chaincodeProposalPayload and an endorsed action to apply to the ledger. +type ChaincodeActionPayload struct { + // This field contains the bytes of the ChaincodeProposalPayload message from + // the original invocation (essentially the arguments) after the application + // of the visibility function. The main visibility modes are "full" (the + // entire ChaincodeProposalPayload message is included here), "hash" (only + // the hash of the ChaincodeProposalPayload message is included) or + // "nothing". This field will be used to check the consistency of + // ProposalResponsePayload.proposalHash. For the CHAINCODE type, + // ProposalResponsePayload.proposalHash is supposed to be H(ProposalHeader || + // f(ChaincodeProposalPayload)) where f is the visibility function. + ChaincodeProposalPayload []byte `protobuf:"bytes,1,opt,name=chaincode_proposal_payload,json=chaincodeProposalPayload,proto3" json:"chaincode_proposal_payload,omitempty"` + // The list of actions to apply to the ledger + Action *ChaincodeEndorsedAction `protobuf:"bytes,2,opt,name=action,proto3" json:"action,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ChaincodeActionPayload) Reset() { *m = ChaincodeActionPayload{} } +func (m *ChaincodeActionPayload) String() string { return proto.CompactTextString(m) } +func (*ChaincodeActionPayload) ProtoMessage() {} +func (*ChaincodeActionPayload) Descriptor() ([]byte, []int) { + return fileDescriptor_transaction_4fbd1a0e1a50cfab, []int{4} +} +func (m *ChaincodeActionPayload) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ChaincodeActionPayload.Unmarshal(m, b) +} +func (m *ChaincodeActionPayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ChaincodeActionPayload.Marshal(b, m, deterministic) +} +func (dst *ChaincodeActionPayload) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChaincodeActionPayload.Merge(dst, src) +} +func (m *ChaincodeActionPayload) XXX_Size() int { + return xxx_messageInfo_ChaincodeActionPayload.Size(m) +} +func (m *ChaincodeActionPayload) XXX_DiscardUnknown() { + xxx_messageInfo_ChaincodeActionPayload.DiscardUnknown(m) +} + +var xxx_messageInfo_ChaincodeActionPayload proto.InternalMessageInfo + +func (m *ChaincodeActionPayload) GetChaincodeProposalPayload() []byte { + if m != nil { + return m.ChaincodeProposalPayload + } + return nil +} + +func (m *ChaincodeActionPayload) GetAction() *ChaincodeEndorsedAction { + if m != nil { + return m.Action + } + return nil +} + +// ChaincodeEndorsedAction carries information about the endorsement of a +// specific proposal +type ChaincodeEndorsedAction struct { + // This is the bytes of the ProposalResponsePayload message signed by the + // endorsers. Recall that for the CHAINCODE type, the + // ProposalResponsePayload's extenstion field carries a ChaincodeAction + ProposalResponsePayload []byte `protobuf:"bytes,1,opt,name=proposal_response_payload,json=proposalResponsePayload,proto3" json:"proposal_response_payload,omitempty"` + // The endorsement of the proposal, basically the endorser's signature over + // proposalResponsePayload + Endorsements []*Endorsement `protobuf:"bytes,2,rep,name=endorsements,proto3" json:"endorsements,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ChaincodeEndorsedAction) Reset() { *m = ChaincodeEndorsedAction{} } +func (m *ChaincodeEndorsedAction) String() string { return proto.CompactTextString(m) } +func (*ChaincodeEndorsedAction) ProtoMessage() {} +func (*ChaincodeEndorsedAction) Descriptor() ([]byte, []int) { + return fileDescriptor_transaction_4fbd1a0e1a50cfab, []int{5} +} +func (m *ChaincodeEndorsedAction) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ChaincodeEndorsedAction.Unmarshal(m, b) +} +func (m *ChaincodeEndorsedAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ChaincodeEndorsedAction.Marshal(b, m, deterministic) +} +func (dst *ChaincodeEndorsedAction) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChaincodeEndorsedAction.Merge(dst, src) +} +func (m *ChaincodeEndorsedAction) XXX_Size() int { + return xxx_messageInfo_ChaincodeEndorsedAction.Size(m) +} +func (m *ChaincodeEndorsedAction) XXX_DiscardUnknown() { + xxx_messageInfo_ChaincodeEndorsedAction.DiscardUnknown(m) +} + +var xxx_messageInfo_ChaincodeEndorsedAction proto.InternalMessageInfo + +func (m *ChaincodeEndorsedAction) GetProposalResponsePayload() []byte { + if m != nil { + return m.ProposalResponsePayload + } + return nil +} + +func (m *ChaincodeEndorsedAction) GetEndorsements() []*Endorsement { + if m != nil { + return m.Endorsements + } + return nil +} + +func init() { + proto.RegisterType((*SignedTransaction)(nil), "sdk.protos.SignedTransaction") + proto.RegisterType((*ProcessedTransaction)(nil), "sdk.protos.ProcessedTransaction") + proto.RegisterType((*Transaction)(nil), "sdk.protos.Transaction") + proto.RegisterType((*TransactionAction)(nil), "sdk.protos.TransactionAction") + proto.RegisterType((*ChaincodeActionPayload)(nil), "sdk.protos.ChaincodeActionPayload") + proto.RegisterType((*ChaincodeEndorsedAction)(nil), "sdk.protos.ChaincodeEndorsedAction") + proto.RegisterEnum("sdk.protos.TxValidationCode", TxValidationCode_name, TxValidationCode_value) + proto.RegisterEnum("sdk.protos.MetaDataKeys", MetaDataKeys_name, MetaDataKeys_value) +} + +func init() { proto.RegisterFile("peer/transaction.proto", fileDescriptor_transaction_4fbd1a0e1a50cfab) } + +var fileDescriptor_transaction_4fbd1a0e1a50cfab = []byte{ + // 877 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x55, 0x41, 0x6f, 0xe2, 0x46, + 0x14, 0x5e, 0xb2, 0x4d, 0xd2, 0x0c, 0x24, 0x19, 0x06, 0x42, 0x08, 0x8a, 0xba, 0x2b, 0x0e, 0x55, + 0xba, 0x95, 0x40, 0xca, 0x1e, 0x2a, 0x55, 0xbd, 0x0c, 0xf6, 0x24, 0x58, 0x6b, 0x66, 0xac, 0xf1, + 0x40, 0x48, 0x0f, 0x1d, 0x19, 0x98, 0x25, 0xa8, 0x60, 0x23, 0xdb, 0x59, 0x35, 0xd7, 0xfe, 0x80, + 0xf6, 0xd2, 0xdf, 0xdb, 0x56, 0xe3, 0xb1, 0x81, 0x24, 0xed, 0x05, 0x33, 0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ce, 0xc3, 0xd3, 0x5a, 0xc5, 0x4b, 0x35, 0x9b, 0xab, 0xb8, + 0xf3, 0x39, 0x98, 0xc4, 0x8b, 0x69, 0xf1, 0xee, 0xeb, 0x6b, 0xba, 0x87, 0x76, 0xae, 0x13, 0x2f, + 0x98, 0xfe, 0x1a, 0xcc, 0xd5, 0xcf, 0xdf, 0xcd, 0x17, 0xe9, 0xc3, 0xe3, 0x44, 0xdf, 0x7e, 0xdd, + 0x9d, 0xf4, 0xae, 0x49, 0x37, 0x17, 0x7f, 0xd2, 0xd5, 0xe9, 0x13, 0xf3, 0x51, 0xf8, 0xf8, 0x6f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xba, 0xd3, 0xb2, 0x32, 0x35, 0x06, 0x00, 0x00, +} diff --git a/fabric/protos/token/expectations.pb.go b/fabric/protos/token/expectations.pb.go new file mode 100644 index 0000000..cf00590 --- /dev/null +++ b/fabric/protos/token/expectations.pb.go @@ -0,0 +1,357 @@ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: token/expectations.proto + +package token // import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/token" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "github.com/golang/protobuf/ptypes/timestamp" + +// 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 + +// TokenExpectation represent the belief that someone should achieve in terms of a token action +type TokenExpectation struct { + // Types that are valid to be assigned to Expectation: + // *TokenExpectation_PlainExpectation + Expectation isTokenExpectation_Expectation `protobuf_oneof:"Expectation"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TokenExpectation) Reset() { *m = TokenExpectation{} } +func (m *TokenExpectation) String() string { return proto.CompactTextString(m) } +func (*TokenExpectation) ProtoMessage() {} +func (*TokenExpectation) Descriptor() ([]byte, []int) { + return fileDescriptor_expectations_8d8d9622f86de889, []int{0} +} +func (m *TokenExpectation) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TokenExpectation.Unmarshal(m, b) +} +func (m *TokenExpectation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TokenExpectation.Marshal(b, m, deterministic) +} +func (dst *TokenExpectation) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenExpectation.Merge(dst, src) +} +func (m *TokenExpectation) XXX_Size() int { + return xxx_messageInfo_TokenExpectation.Size(m) +} +func (m *TokenExpectation) XXX_DiscardUnknown() { + xxx_messageInfo_TokenExpectation.DiscardUnknown(m) +} + +var xxx_messageInfo_TokenExpectation proto.InternalMessageInfo + +type isTokenExpectation_Expectation interface { + isTokenExpectation_Expectation() +} + +type TokenExpectation_PlainExpectation struct { + PlainExpectation *PlainExpectation `protobuf:"bytes,1,opt,name=plain_expectation,json=plainExpectation,proto3,oneof"` +} + +func (*TokenExpectation_PlainExpectation) isTokenExpectation_Expectation() {} + +func (m *TokenExpectation) GetExpectation() isTokenExpectation_Expectation { + if m != nil { + return m.Expectation + } + return nil +} + +func (m *TokenExpectation) GetPlainExpectation() *PlainExpectation { + if x, ok := m.GetExpectation().(*TokenExpectation_PlainExpectation); ok { + return x.PlainExpectation + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*TokenExpectation) 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 _TokenExpectation_OneofMarshaler, _TokenExpectation_OneofUnmarshaler, _TokenExpectation_OneofSizer, []interface{}{ + (*TokenExpectation_PlainExpectation)(nil), + } +} + +func _TokenExpectation_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*TokenExpectation) + // Expectation + switch x := m.Expectation.(type) { + case *TokenExpectation_PlainExpectation: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.PlainExpectation); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("TokenExpectation.Expectation has unexpected type %T", x) + } + return nil +} + +func _TokenExpectation_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*TokenExpectation) + switch tag { + case 1: // Expectation.plain_expectation + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PlainExpectation) + err := b.DecodeMessage(msg) + m.Expectation = &TokenExpectation_PlainExpectation{msg} + return true, err + default: + return false, nil + } +} + +func _TokenExpectation_OneofSizer(msg proto.Message) (n int) { + m := msg.(*TokenExpectation) + // Expectation + switch x := m.Expectation.(type) { + case *TokenExpectation_PlainExpectation: + s := proto.Size(x.PlainExpectation) + 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 +} + +// PlainExpectation represent the plain expectation where no confidentiality is provided. +type PlainExpectation struct { + // Types that are valid to be assigned to Payload: + // *PlainExpectation_ImportExpectation + // *PlainExpectation_TransferExpectation + Payload isPlainExpectation_Payload `protobuf_oneof:"payload"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PlainExpectation) Reset() { *m = PlainExpectation{} } +func (m *PlainExpectation) String() string { return proto.CompactTextString(m) } +func (*PlainExpectation) ProtoMessage() {} +func (*PlainExpectation) Descriptor() ([]byte, []int) { + return fileDescriptor_expectations_8d8d9622f86de889, []int{1} +} +func (m *PlainExpectation) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PlainExpectation.Unmarshal(m, b) +} +func (m *PlainExpectation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PlainExpectation.Marshal(b, m, deterministic) +} +func (dst *PlainExpectation) XXX_Merge(src proto.Message) { + xxx_messageInfo_PlainExpectation.Merge(dst, src) +} +func (m *PlainExpectation) XXX_Size() int { + return xxx_messageInfo_PlainExpectation.Size(m) +} +func (m *PlainExpectation) XXX_DiscardUnknown() { + xxx_messageInfo_PlainExpectation.DiscardUnknown(m) +} + +var xxx_messageInfo_PlainExpectation proto.InternalMessageInfo + +type isPlainExpectation_Payload interface { + isPlainExpectation_Payload() +} + +type PlainExpectation_ImportExpectation struct { + ImportExpectation *PlainTokenExpectation `protobuf:"bytes,1,opt,name=import_expectation,json=importExpectation,proto3,oneof"` +} + +type PlainExpectation_TransferExpectation struct { + TransferExpectation *PlainTokenExpectation `protobuf:"bytes,2,opt,name=transfer_expectation,json=transferExpectation,proto3,oneof"` +} + +func (*PlainExpectation_ImportExpectation) isPlainExpectation_Payload() {} + +func (*PlainExpectation_TransferExpectation) isPlainExpectation_Payload() {} + +func (m *PlainExpectation) GetPayload() isPlainExpectation_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (m *PlainExpectation) GetImportExpectation() *PlainTokenExpectation { + if x, ok := m.GetPayload().(*PlainExpectation_ImportExpectation); ok { + return x.ImportExpectation + } + return nil +} + +func (m *PlainExpectation) GetTransferExpectation() *PlainTokenExpectation { + if x, ok := m.GetPayload().(*PlainExpectation_TransferExpectation); ok { + return x.TransferExpectation + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*PlainExpectation) 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 _PlainExpectation_OneofMarshaler, _PlainExpectation_OneofUnmarshaler, _PlainExpectation_OneofSizer, []interface{}{ + (*PlainExpectation_ImportExpectation)(nil), + (*PlainExpectation_TransferExpectation)(nil), + } +} + +func _PlainExpectation_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*PlainExpectation) + // payload + switch x := m.Payload.(type) { + case *PlainExpectation_ImportExpectation: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ImportExpectation); err != nil { + return err + } + case *PlainExpectation_TransferExpectation: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TransferExpectation); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("PlainExpectation.Payload has unexpected type %T", x) + } + return nil +} + +func _PlainExpectation_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*PlainExpectation) + switch tag { + case 1: // payload.import_expectation + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PlainTokenExpectation) + err := b.DecodeMessage(msg) + m.Payload = &PlainExpectation_ImportExpectation{msg} + return true, err + case 2: // payload.transfer_expectation + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PlainTokenExpectation) + err := b.DecodeMessage(msg) + m.Payload = &PlainExpectation_TransferExpectation{msg} + return true, err + default: + return false, nil + } +} + +func _PlainExpectation_OneofSizer(msg proto.Message) (n int) { + m := msg.(*PlainExpectation) + // payload + switch x := m.Payload.(type) { + case *PlainExpectation_ImportExpectation: + s := proto.Size(x.ImportExpectation) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *PlainExpectation_TransferExpectation: + s := proto.Size(x.TransferExpectation) + 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 +} + +// PlainTokenExpectation represents the expecation that +// certain outputs will be matched +type PlainTokenExpectation struct { + // Outputs contains the expected outputs + Outputs []*PlainOutput `protobuf:"bytes,1,rep,name=outputs,proto3" json:"outputs,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PlainTokenExpectation) Reset() { *m = PlainTokenExpectation{} } +func (m *PlainTokenExpectation) String() string { return proto.CompactTextString(m) } +func (*PlainTokenExpectation) ProtoMessage() {} +func (*PlainTokenExpectation) Descriptor() ([]byte, []int) { + return fileDescriptor_expectations_8d8d9622f86de889, []int{2} +} +func (m *PlainTokenExpectation) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PlainTokenExpectation.Unmarshal(m, b) +} +func (m *PlainTokenExpectation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PlainTokenExpectation.Marshal(b, m, deterministic) +} +func (dst *PlainTokenExpectation) XXX_Merge(src proto.Message) { + xxx_messageInfo_PlainTokenExpectation.Merge(dst, src) +} +func (m *PlainTokenExpectation) XXX_Size() int { + return xxx_messageInfo_PlainTokenExpectation.Size(m) +} +func (m *PlainTokenExpectation) XXX_DiscardUnknown() { + xxx_messageInfo_PlainTokenExpectation.DiscardUnknown(m) +} + +var xxx_messageInfo_PlainTokenExpectation proto.InternalMessageInfo + +func (m *PlainTokenExpectation) GetOutputs() []*PlainOutput { + if m != nil { + return m.Outputs + } + return nil +} + +func init() { + proto.RegisterType((*TokenExpectation)(nil), "sdk.protos.TokenExpectation") + proto.RegisterType((*PlainExpectation)(nil), "sdk.protos.PlainExpectation") + proto.RegisterType((*PlainTokenExpectation)(nil), "sdk.protos.PlainTokenExpectation") +} + +func init() { + proto.RegisterFile("token/expectations.proto", fileDescriptor_expectations_8d8d9622f86de889) +} + +var fileDescriptor_expectations_8d8d9622f86de889 = []byte{ + // 296 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xdd, 0x4a, 0xfb, 0x30, + 0x14, 0x5f, 0xff, 0x7f, 0x70, 0x98, 0x2a, 0x74, 0x55, 0xb1, 0x0c, 0xc4, 0x51, 0x41, 0x86, 0x17, + 0x0d, 0xcc, 0x07, 0x10, 0x06, 0xe2, 0xae, 0xfc, 0x28, 0x5e, 0x79, 0x23, 0x69, 0x97, 0x76, 0xd1, + 0xb6, 0x27, 0x24, 0xa7, 0xe0, 0x1e, 0xcf, 0x37, 0x93, 0x26, 0x14, 0xb3, 0xb2, 0x0b, 0xaf, 0xc2, + 0x39, 0xbf, 0xaf, 0x73, 0x38, 0x21, 0x11, 0xc2, 0x27, 0x6f, 0x28, 0xff, 0x92, 0x3c, 0x47, 0x86, + 0x02, 0x1a, 0x9d, 0x48, 0x05, 0x08, 0xe1, 0x81, 0x79, 0xf4, 0xf4, 0xb2, 0x04, 0x28, 0x2b, 0x4e, + 0x4d, 0x99, 0xb5, 0x05, 0x45, 0x51, 0x73, 0x8d, 0xac, 0x96, 0x96, 0x38, 0x3d, 0xb7, 0x16, 0xa8, + 0x58, 0xa3, 0x59, 0xde, 0x59, 0x58, 0x20, 0xfe, 0x20, 0xc1, 0x6b, 0x07, 0xdd, 0xff, 0x9a, 0x87, + 0x0f, 0x64, 0x22, 0x2b, 0x26, 0x9a, 0x77, 0x27, 0x31, 0xf2, 0x66, 0xde, 0xdc, 0x5f, 0x44, 0x56, + 0xa6, 0x93, 0xe7, 0x8e, 0xe0, 0x88, 0x56, 0xa3, 0x34, 0x90, 0x83, 0xde, 0xf2, 0x98, 0xf8, 0x4e, + 0x19, 0x7f, 0x7b, 0x24, 0x18, 0xea, 0xc2, 0x47, 0x12, 0x8a, 0x5a, 0x82, 0xc2, 0x3d, 0x69, 0x17, + 0x3b, 0x69, 0xc3, 0x39, 0x57, 0xa3, 0x74, 0x62, 0xa5, 0xae, 0x5f, 0x4a, 0x4e, 0xcd, 0x96, 0x05, + 0x57, 0x3b, 0x8e, 0xff, 0xfe, 0xe6, 0x78, 0xd2, 0x8b, 0xdd, 0x3d, 0x0e, 0xc9, 0x58, 0xb2, 0x6d, + 0x05, 0x6c, 0x1d, 0xdf, 0x91, 0xb3, 0xbd, 0xd2, 0xf0, 0x9a, 0x8c, 0xa1, 0x45, 0xd9, 0xa2, 0x8e, + 0xbc, 0xd9, 0xff, 0xb9, 0xbf, 0x38, 0xb2, 0x19, 0x4f, 0xa6, 0x99, 0xf6, 0xe0, 0xf2, 0x85, 0x5c, + 0x81, 0x2a, 0x93, 0xcd, 0x56, 0x72, 0x55, 0xf1, 0x75, 0xc9, 0x55, 0x52, 0xb0, 0x4c, 0x89, 0xbc, + 0x9f, 0xcc, 0x5c, 0xea, 0xed, 0xa6, 0x14, 0xb8, 0x69, 0xb3, 0x24, 0x87, 0x9a, 0x3a, 0x5c, 0x6a, + 0xb9, 0xf6, 0xd0, 0x9a, 0x1a, 0x6e, 0x66, 0x7f, 0xc1, 0xed, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xfa, 0xd2, 0xe0, 0xe0, 0x28, 0x02, 0x00, 0x00, +} diff --git a/fabric/protos/token/prover.pb.go b/fabric/protos/token/prover.pb.go new file mode 100644 index 0000000..0171964 --- /dev/null +++ b/fabric/protos/token/prover.pb.go @@ -0,0 +1,1563 @@ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: token/prover.proto + +package token // import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/token" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import timestamp "github.com/golang/protobuf/ptypes/timestamp" + +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 + +// TokenToIssue describes a token to be issued in the system +type TokenToIssue struct { + // Recipient refers to the owner of the token to be issued + Recipient []byte `protobuf:"bytes,1,opt,name=recipient,proto3" json:"recipient,omitempty"` + // Type refers to the token type + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + // Quantity refers to the number of token units to be issued + Quantity uint64 `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TokenToIssue) Reset() { *m = TokenToIssue{} } +func (m *TokenToIssue) String() string { return proto.CompactTextString(m) } +func (*TokenToIssue) ProtoMessage() {} +func (*TokenToIssue) Descriptor() ([]byte, []int) { + return fileDescriptor_prover_aacdf31643d38144, []int{0} +} +func (m *TokenToIssue) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TokenToIssue.Unmarshal(m, b) +} +func (m *TokenToIssue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TokenToIssue.Marshal(b, m, deterministic) +} +func (dst *TokenToIssue) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenToIssue.Merge(dst, src) +} +func (m *TokenToIssue) XXX_Size() int { + return xxx_messageInfo_TokenToIssue.Size(m) +} +func (m *TokenToIssue) XXX_DiscardUnknown() { + xxx_messageInfo_TokenToIssue.DiscardUnknown(m) +} + +var xxx_messageInfo_TokenToIssue proto.InternalMessageInfo + +func (m *TokenToIssue) GetRecipient() []byte { + if m != nil { + return m.Recipient + } + return nil +} + +func (m *TokenToIssue) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *TokenToIssue) GetQuantity() uint64 { + if m != nil { + return m.Quantity + } + return 0 +} + +// RecipientTransferShare describes how much a recipient will receive in a token transfer +type RecipientTransferShare struct { + // Recipient refers to the prospective owner of a transferred token + Recipient []byte `protobuf:"bytes,1,opt,name=recipient,proto3" json:"recipient,omitempty"` + // Quantity refers to the number of token units to be transferred to the recipient + Quantity uint64 `protobuf:"varint,2,opt,name=quantity,proto3" json:"quantity,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RecipientTransferShare) Reset() { *m = RecipientTransferShare{} } +func (m *RecipientTransferShare) String() string { return proto.CompactTextString(m) } +func (*RecipientTransferShare) ProtoMessage() {} +func (*RecipientTransferShare) Descriptor() ([]byte, []int) { + return fileDescriptor_prover_aacdf31643d38144, []int{1} +} +func (m *RecipientTransferShare) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RecipientTransferShare.Unmarshal(m, b) +} +func (m *RecipientTransferShare) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RecipientTransferShare.Marshal(b, m, deterministic) +} +func (dst *RecipientTransferShare) XXX_Merge(src proto.Message) { + xxx_messageInfo_RecipientTransferShare.Merge(dst, src) +} +func (m *RecipientTransferShare) XXX_Size() int { + return xxx_messageInfo_RecipientTransferShare.Size(m) +} +func (m *RecipientTransferShare) XXX_DiscardUnknown() { + xxx_messageInfo_RecipientTransferShare.DiscardUnknown(m) +} + +var xxx_messageInfo_RecipientTransferShare proto.InternalMessageInfo + +func (m *RecipientTransferShare) GetRecipient() []byte { + if m != nil { + return m.Recipient + } + return nil +} + +func (m *RecipientTransferShare) GetQuantity() uint64 { + if m != nil { + return m.Quantity + } + return 0 +} + +// TokenOutput is used to specify a token returned by ListRequest +type TokenOutput struct { + // ID is used to uniquely identify the token + Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Type is the type of the token + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + // Quantity represents the number for this type of token + Quantity uint64 `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TokenOutput) Reset() { *m = TokenOutput{} } +func (m *TokenOutput) String() string { return proto.CompactTextString(m) } +func (*TokenOutput) ProtoMessage() {} +func (*TokenOutput) Descriptor() ([]byte, []int) { + return fileDescriptor_prover_aacdf31643d38144, []int{2} +} +func (m *TokenOutput) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TokenOutput.Unmarshal(m, b) +} +func (m *TokenOutput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TokenOutput.Marshal(b, m, deterministic) +} +func (dst *TokenOutput) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenOutput.Merge(dst, src) +} +func (m *TokenOutput) XXX_Size() int { + return xxx_messageInfo_TokenOutput.Size(m) +} +func (m *TokenOutput) XXX_DiscardUnknown() { + xxx_messageInfo_TokenOutput.DiscardUnknown(m) +} + +var xxx_messageInfo_TokenOutput proto.InternalMessageInfo + +func (m *TokenOutput) GetId() []byte { + if m != nil { + return m.Id + } + return nil +} + +func (m *TokenOutput) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *TokenOutput) GetQuantity() uint64 { + if m != nil { + return m.Quantity + } + return 0 +} + +// UnspentTokens is used to hold the output of listRequest +type UnspentTokens struct { + Tokens []*TokenOutput `protobuf:"bytes,1,rep,name=tokens,proto3" json:"tokens,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UnspentTokens) Reset() { *m = UnspentTokens{} } +func (m *UnspentTokens) String() string { return proto.CompactTextString(m) } +func (*UnspentTokens) ProtoMessage() {} +func (*UnspentTokens) Descriptor() ([]byte, []int) { + return fileDescriptor_prover_aacdf31643d38144, []int{3} +} +func (m *UnspentTokens) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UnspentTokens.Unmarshal(m, b) +} +func (m *UnspentTokens) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UnspentTokens.Marshal(b, m, deterministic) +} +func (dst *UnspentTokens) XXX_Merge(src proto.Message) { + xxx_messageInfo_UnspentTokens.Merge(dst, src) +} +func (m *UnspentTokens) XXX_Size() int { + return xxx_messageInfo_UnspentTokens.Size(m) +} +func (m *UnspentTokens) XXX_DiscardUnknown() { + xxx_messageInfo_UnspentTokens.DiscardUnknown(m) +} + +var xxx_messageInfo_UnspentTokens proto.InternalMessageInfo + +func (m *UnspentTokens) GetTokens() []*TokenOutput { + if m != nil { + return m.Tokens + } + return nil +} + +// ListRequest is used to request a list of unspent tokens +type ListRequest struct { + Credential []byte `protobuf:"bytes,1,opt,name=credential,proto3" json:"credential,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListRequest) Reset() { *m = ListRequest{} } +func (m *ListRequest) String() string { return proto.CompactTextString(m) } +func (*ListRequest) ProtoMessage() {} +func (*ListRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_prover_aacdf31643d38144, []int{4} +} +func (m *ListRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListRequest.Unmarshal(m, b) +} +func (m *ListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListRequest.Marshal(b, m, deterministic) +} +func (dst *ListRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListRequest.Merge(dst, src) +} +func (m *ListRequest) XXX_Size() int { + return xxx_messageInfo_ListRequest.Size(m) +} +func (m *ListRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListRequest proto.InternalMessageInfo + +func (m *ListRequest) GetCredential() []byte { + if m != nil { + return m.Credential + } + return nil +} + +// ImportRequest is used to request creation of imports +type ImportRequest struct { + // Credential contains information about the party who is requesting the operation + // the content of this field depends on the charateristic of the token manager system used. + Credential []byte `protobuf:"bytes,1,opt,name=credential,proto3" json:"credential,omitempty"` + // TokenToIssue contains the information about the tokens to be issued + TokensToIssue []*TokenToIssue `protobuf:"bytes,2,rep,name=tokens_to_issue,json=tokensToIssue,proto3" json:"tokens_to_issue,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ImportRequest) Reset() { *m = ImportRequest{} } +func (m *ImportRequest) String() string { return proto.CompactTextString(m) } +func (*ImportRequest) ProtoMessage() {} +func (*ImportRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_prover_aacdf31643d38144, []int{5} +} +func (m *ImportRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ImportRequest.Unmarshal(m, b) +} +func (m *ImportRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ImportRequest.Marshal(b, m, deterministic) +} +func (dst *ImportRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ImportRequest.Merge(dst, src) +} +func (m *ImportRequest) XXX_Size() int { + return xxx_messageInfo_ImportRequest.Size(m) +} +func (m *ImportRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ImportRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ImportRequest proto.InternalMessageInfo + +func (m *ImportRequest) GetCredential() []byte { + if m != nil { + return m.Credential + } + return nil +} + +func (m *ImportRequest) GetTokensToIssue() []*TokenToIssue { + if m != nil { + return m.TokensToIssue + } + return nil +} + +// RequestTransfer is used to request creation of transfers +type TransferRequest struct { + Credential []byte `protobuf:"bytes,1,opt,name=credential,proto3" json:"credential,omitempty"` + TokenIds [][]byte `protobuf:"bytes,2,rep,name=token_ids,json=tokenIds,proto3" json:"token_ids,omitempty"` + Shares []*RecipientTransferShare `protobuf:"bytes,3,rep,name=shares,proto3" json:"shares,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TransferRequest) Reset() { *m = TransferRequest{} } +func (m *TransferRequest) String() string { return proto.CompactTextString(m) } +func (*TransferRequest) ProtoMessage() {} +func (*TransferRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_prover_aacdf31643d38144, []int{6} +} +func (m *TransferRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TransferRequest.Unmarshal(m, b) +} +func (m *TransferRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TransferRequest.Marshal(b, m, deterministic) +} +func (dst *TransferRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransferRequest.Merge(dst, src) +} +func (m *TransferRequest) XXX_Size() int { + return xxx_messageInfo_TransferRequest.Size(m) +} +func (m *TransferRequest) XXX_DiscardUnknown() { + xxx_messageInfo_TransferRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_TransferRequest proto.InternalMessageInfo + +func (m *TransferRequest) GetCredential() []byte { + if m != nil { + return m.Credential + } + return nil +} + +func (m *TransferRequest) GetTokenIds() [][]byte { + if m != nil { + return m.TokenIds + } + return nil +} + +func (m *TransferRequest) GetShares() []*RecipientTransferShare { + if m != nil { + return m.Shares + } + return nil +} + +// RedeemRequest is used to request token redemption +type RedeemRequest struct { + // Credential contains information for the party who is requesting the operation + // The content of this field depends on the characteristic of token manager system + Credential []byte `protobuf:"bytes,1,opt,name=credential,proto3" json:"credential,omitempty"` + // token_ids specifies the ids for the tokens that will be redeemed + TokenIds [][]byte `protobuf:"bytes,2,rep,name=token_ids,json=tokenIds,proto3" json:"token_ids,omitempty"` + // quantity refers to the number of units of a given token needs to be redeemed. + QuantityToRedeem uint64 `protobuf:"varint,3,opt,name=quantity_to_redeem,json=quantityToRedeem,proto3" json:"quantity_to_redeem,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RedeemRequest) Reset() { *m = RedeemRequest{} } +func (m *RedeemRequest) String() string { return proto.CompactTextString(m) } +func (*RedeemRequest) ProtoMessage() {} +func (*RedeemRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_prover_aacdf31643d38144, []int{7} +} +func (m *RedeemRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RedeemRequest.Unmarshal(m, b) +} +func (m *RedeemRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RedeemRequest.Marshal(b, m, deterministic) +} +func (dst *RedeemRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_RedeemRequest.Merge(dst, src) +} +func (m *RedeemRequest) XXX_Size() int { + return xxx_messageInfo_RedeemRequest.Size(m) +} +func (m *RedeemRequest) XXX_DiscardUnknown() { + xxx_messageInfo_RedeemRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_RedeemRequest proto.InternalMessageInfo + +func (m *RedeemRequest) GetCredential() []byte { + if m != nil { + return m.Credential + } + return nil +} + +func (m *RedeemRequest) GetTokenIds() [][]byte { + if m != nil { + return m.TokenIds + } + return nil +} + +func (m *RedeemRequest) GetQuantityToRedeem() uint64 { + if m != nil { + return m.QuantityToRedeem + } + return 0 +} + +// ALlowance defines how many and what tokens a recipient can transfer on behalf of their actual owner +type AllowanceRecipientShare struct { + // Recipient refers to the entity allowed to spend the specified quantity from the tokens identified by token IDs + Recipient []byte `protobuf:"bytes,1,opt,name=recipient,proto3" json:"recipient,omitempty"` + // Quantity is how many tokens are delegated to the recipient + Quantity uint64 `protobuf:"varint,2,opt,name=quantity,proto3" json:"quantity,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AllowanceRecipientShare) Reset() { *m = AllowanceRecipientShare{} } +func (m *AllowanceRecipientShare) String() string { return proto.CompactTextString(m) } +func (*AllowanceRecipientShare) ProtoMessage() {} +func (*AllowanceRecipientShare) Descriptor() ([]byte, []int) { + return fileDescriptor_prover_aacdf31643d38144, []int{8} +} +func (m *AllowanceRecipientShare) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AllowanceRecipientShare.Unmarshal(m, b) +} +func (m *AllowanceRecipientShare) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AllowanceRecipientShare.Marshal(b, m, deterministic) +} +func (dst *AllowanceRecipientShare) XXX_Merge(src proto.Message) { + xxx_messageInfo_AllowanceRecipientShare.Merge(dst, src) +} +func (m *AllowanceRecipientShare) XXX_Size() int { + return xxx_messageInfo_AllowanceRecipientShare.Size(m) +} +func (m *AllowanceRecipientShare) XXX_DiscardUnknown() { + xxx_messageInfo_AllowanceRecipientShare.DiscardUnknown(m) +} + +var xxx_messageInfo_AllowanceRecipientShare proto.InternalMessageInfo + +func (m *AllowanceRecipientShare) GetRecipient() []byte { + if m != nil { + return m.Recipient + } + return nil +} + +func (m *AllowanceRecipientShare) GetQuantity() uint64 { + if m != nil { + return m.Quantity + } + return 0 +} + +// ApproveRequest is used to request the creation of allowance from one owner to another +type ApproveRequest struct { + // Credential refers to the public credential of the request creator + Credential []byte `protobuf:"bytes,1,opt,name=credential,proto3" json:"credential,omitempty"` + // Allowance describes the tokens the creator of the request is willing to delegate + AllowanceShares []*AllowanceRecipientShare `protobuf:"bytes,2,rep,name=allowance_shares,json=allowanceShares,proto3" json:"allowance_shares,omitempty"` + // TokenIds are the token identifiers used to create the allowance + TokenIds [][]byte `protobuf:"bytes,3,rep,name=token_ids,json=tokenIds,proto3" json:"token_ids,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ApproveRequest) Reset() { *m = ApproveRequest{} } +func (m *ApproveRequest) String() string { return proto.CompactTextString(m) } +func (*ApproveRequest) ProtoMessage() {} +func (*ApproveRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_prover_aacdf31643d38144, []int{9} +} +func (m *ApproveRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ApproveRequest.Unmarshal(m, b) +} +func (m *ApproveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ApproveRequest.Marshal(b, m, deterministic) +} +func (dst *ApproveRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ApproveRequest.Merge(dst, src) +} +func (m *ApproveRequest) XXX_Size() int { + return xxx_messageInfo_ApproveRequest.Size(m) +} +func (m *ApproveRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ApproveRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ApproveRequest proto.InternalMessageInfo + +func (m *ApproveRequest) GetCredential() []byte { + if m != nil { + return m.Credential + } + return nil +} + +func (m *ApproveRequest) GetAllowanceShares() []*AllowanceRecipientShare { + if m != nil { + return m.AllowanceShares + } + return nil +} + +func (m *ApproveRequest) GetTokenIds() [][]byte { + if m != nil { + return m.TokenIds + } + return nil +} + +// ExpectationRequest is used to request indirect token import or transfer based on the token expectation +type ExpectationRequest struct { + // credential contains information for the party who is requesting the operation + // The content of this field depends on the characteristic of token manager system + Credential []byte `protobuf:"bytes,1,opt,name=credential,proto3" json:"credential,omitempty"` + // expectation contains the expected outputs for token import or transfer + Expectation *TokenExpectation `protobuf:"bytes,2,opt,name=expectation,proto3" json:"expectation,omitempty"` + // TokenIds are the token identifiers used to fulfill the expectation + TokenIds [][]byte `protobuf:"bytes,3,rep,name=token_ids,json=tokenIds,proto3" json:"token_ids,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ExpectationRequest) Reset() { *m = ExpectationRequest{} } +func (m *ExpectationRequest) String() string { return proto.CompactTextString(m) } +func (*ExpectationRequest) ProtoMessage() {} +func (*ExpectationRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_prover_aacdf31643d38144, []int{10} +} +func (m *ExpectationRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ExpectationRequest.Unmarshal(m, b) +} +func (m *ExpectationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ExpectationRequest.Marshal(b, m, deterministic) +} +func (dst *ExpectationRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExpectationRequest.Merge(dst, src) +} +func (m *ExpectationRequest) XXX_Size() int { + return xxx_messageInfo_ExpectationRequest.Size(m) +} +func (m *ExpectationRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ExpectationRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ExpectationRequest proto.InternalMessageInfo + +func (m *ExpectationRequest) GetCredential() []byte { + if m != nil { + return m.Credential + } + return nil +} + +func (m *ExpectationRequest) GetExpectation() *TokenExpectation { + if m != nil { + return m.Expectation + } + return nil +} + +func (m *ExpectationRequest) GetTokenIds() [][]byte { + if m != nil { + return m.TokenIds + } + return nil +} + +// Header is a generic replay prevention and identity message to include in a signed command +type Header struct { + // Timestamp is the local time when the message was created + // by the sender + Timestamp *timestamp.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // ChannelId identifies the channel this message is bound for + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + // Nonce is a sufficientley long random value + // used to ensure the request has enough entropy. + Nonce []byte `protobuf:"bytes,3,opt,name=nonce,proto3" json:"nonce,omitempty"` + // Creator of the message. + // Typically, a marshaled msp.SerializedIdentity + Creator []byte `protobuf:"bytes,4,opt,name=creator,proto3" json:"creator,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_prover_aacdf31643d38144, []int{11} +} +func (m *Header) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Header.Unmarshal(m, b) +} +func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Header.Marshal(b, m, deterministic) +} +func (dst *Header) XXX_Merge(src proto.Message) { + xxx_messageInfo_Header.Merge(dst, src) +} +func (m *Header) XXX_Size() int { + return xxx_messageInfo_Header.Size(m) +} +func (m *Header) XXX_DiscardUnknown() { + xxx_messageInfo_Header.DiscardUnknown(m) +} + +var xxx_messageInfo_Header proto.InternalMessageInfo + +func (m *Header) GetTimestamp() *timestamp.Timestamp { + if m != nil { + return m.Timestamp + } + return nil +} + +func (m *Header) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +func (m *Header) GetNonce() []byte { + if m != nil { + return m.Nonce + } + return nil +} + +func (m *Header) GetCreator() []byte { + if m != nil { + return m.Creator + } + return nil +} + +// Command describes the type of operation that a client is requesting. +type Command struct { + // Header is the header of this command + Header *Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // Payload is the payload of this command. It can assume one of the following value + // + // Types that are valid to be assigned to Payload: + // *Command_ImportRequest + // *Command_TransferRequest + // *Command_ListRequest + // *Command_RedeemRequest + // *Command_ApproveRequest + // *Command_TransferFromRequest + // *Command_ExpectationRequest + Payload isCommand_Payload `protobuf_oneof:"payload"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Command) Reset() { *m = Command{} } +func (m *Command) String() string { return proto.CompactTextString(m) } +func (*Command) ProtoMessage() {} +func (*Command) Descriptor() ([]byte, []int) { + return fileDescriptor_prover_aacdf31643d38144, []int{12} +} +func (m *Command) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Command.Unmarshal(m, b) +} +func (m *Command) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Command.Marshal(b, m, deterministic) +} +func (dst *Command) XXX_Merge(src proto.Message) { + xxx_messageInfo_Command.Merge(dst, src) +} +func (m *Command) XXX_Size() int { + return xxx_messageInfo_Command.Size(m) +} +func (m *Command) XXX_DiscardUnknown() { + xxx_messageInfo_Command.DiscardUnknown(m) +} + +var xxx_messageInfo_Command proto.InternalMessageInfo + +func (m *Command) GetHeader() *Header { + if m != nil { + return m.Header + } + return nil +} + +type isCommand_Payload interface { + isCommand_Payload() +} + +type Command_ImportRequest struct { + ImportRequest *ImportRequest `protobuf:"bytes,2,opt,name=import_request,json=importRequest,proto3,oneof"` +} + +type Command_TransferRequest struct { + TransferRequest *TransferRequest `protobuf:"bytes,3,opt,name=transfer_request,json=transferRequest,proto3,oneof"` +} + +type Command_ListRequest struct { + ListRequest *ListRequest `protobuf:"bytes,4,opt,name=list_request,json=listRequest,proto3,oneof"` +} + +type Command_RedeemRequest struct { + RedeemRequest *RedeemRequest `protobuf:"bytes,5,opt,name=redeem_request,json=redeemRequest,proto3,oneof"` +} + +type Command_ApproveRequest struct { + ApproveRequest *ApproveRequest `protobuf:"bytes,6,opt,name=approve_request,json=approveRequest,proto3,oneof"` +} + +type Command_TransferFromRequest struct { + TransferFromRequest *TransferRequest `protobuf:"bytes,7,opt,name=transfer_from_request,json=transferFromRequest,proto3,oneof"` +} + +type Command_ExpectationRequest struct { + ExpectationRequest *ExpectationRequest `protobuf:"bytes,8,opt,name=expectation_request,json=expectationRequest,proto3,oneof"` +} + +func (*Command_ImportRequest) isCommand_Payload() {} + +func (*Command_TransferRequest) isCommand_Payload() {} + +func (*Command_ListRequest) isCommand_Payload() {} + +func (*Command_RedeemRequest) isCommand_Payload() {} + +func (*Command_ApproveRequest) isCommand_Payload() {} + +func (*Command_TransferFromRequest) isCommand_Payload() {} + +func (*Command_ExpectationRequest) isCommand_Payload() {} + +func (m *Command) GetPayload() isCommand_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (m *Command) GetImportRequest() *ImportRequest { + if x, ok := m.GetPayload().(*Command_ImportRequest); ok { + return x.ImportRequest + } + return nil +} + +func (m *Command) GetTransferRequest() *TransferRequest { + if x, ok := m.GetPayload().(*Command_TransferRequest); ok { + return x.TransferRequest + } + return nil +} + +func (m *Command) GetListRequest() *ListRequest { + if x, ok := m.GetPayload().(*Command_ListRequest); ok { + return x.ListRequest + } + return nil +} + +func (m *Command) GetRedeemRequest() *RedeemRequest { + if x, ok := m.GetPayload().(*Command_RedeemRequest); ok { + return x.RedeemRequest + } + return nil +} + +func (m *Command) GetApproveRequest() *ApproveRequest { + if x, ok := m.GetPayload().(*Command_ApproveRequest); ok { + return x.ApproveRequest + } + return nil +} + +func (m *Command) GetTransferFromRequest() *TransferRequest { + if x, ok := m.GetPayload().(*Command_TransferFromRequest); ok { + return x.TransferFromRequest + } + return nil +} + +func (m *Command) GetExpectationRequest() *ExpectationRequest { + if x, ok := m.GetPayload().(*Command_ExpectationRequest); ok { + return x.ExpectationRequest + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Command) 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 _Command_OneofMarshaler, _Command_OneofUnmarshaler, _Command_OneofSizer, []interface{}{ + (*Command_ImportRequest)(nil), + (*Command_TransferRequest)(nil), + (*Command_ListRequest)(nil), + (*Command_RedeemRequest)(nil), + (*Command_ApproveRequest)(nil), + (*Command_TransferFromRequest)(nil), + (*Command_ExpectationRequest)(nil), + } +} + +func _Command_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Command) + // payload + switch x := m.Payload.(type) { + case *Command_ImportRequest: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ImportRequest); err != nil { + return err + } + case *Command_TransferRequest: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TransferRequest); err != nil { + return err + } + case *Command_ListRequest: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ListRequest); err != nil { + return err + } + case *Command_RedeemRequest: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.RedeemRequest); err != nil { + return err + } + case *Command_ApproveRequest: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ApproveRequest); err != nil { + return err + } + case *Command_TransferFromRequest: + b.EncodeVarint(7<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TransferFromRequest); err != nil { + return err + } + case *Command_ExpectationRequest: + b.EncodeVarint(8<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ExpectationRequest); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Command.Payload has unexpected type %T", x) + } + return nil +} + +func _Command_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Command) + switch tag { + case 2: // payload.import_request + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ImportRequest) + err := b.DecodeMessage(msg) + m.Payload = &Command_ImportRequest{msg} + return true, err + case 3: // payload.transfer_request + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TransferRequest) + err := b.DecodeMessage(msg) + m.Payload = &Command_TransferRequest{msg} + return true, err + case 4: // payload.list_request + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ListRequest) + err := b.DecodeMessage(msg) + m.Payload = &Command_ListRequest{msg} + return true, err + case 5: // payload.redeem_request + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RedeemRequest) + err := b.DecodeMessage(msg) + m.Payload = &Command_RedeemRequest{msg} + return true, err + case 6: // payload.approve_request + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ApproveRequest) + err := b.DecodeMessage(msg) + m.Payload = &Command_ApproveRequest{msg} + return true, err + case 7: // payload.transfer_from_request + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TransferRequest) + err := b.DecodeMessage(msg) + m.Payload = &Command_TransferFromRequest{msg} + return true, err + case 8: // payload.expectation_request + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ExpectationRequest) + err := b.DecodeMessage(msg) + m.Payload = &Command_ExpectationRequest{msg} + return true, err + default: + return false, nil + } +} + +func _Command_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Command) + // payload + switch x := m.Payload.(type) { + case *Command_ImportRequest: + s := proto.Size(x.ImportRequest) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *Command_TransferRequest: + s := proto.Size(x.TransferRequest) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *Command_ListRequest: + s := proto.Size(x.ListRequest) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *Command_RedeemRequest: + s := proto.Size(x.RedeemRequest) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *Command_ApproveRequest: + s := proto.Size(x.ApproveRequest) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *Command_TransferFromRequest: + s := proto.Size(x.TransferFromRequest) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *Command_ExpectationRequest: + s := proto.Size(x.ExpectationRequest) + 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 +} + +// SignedCommand is a command that carries the signature of the command's creator. +type SignedCommand struct { + // Command is the serialised version of a Command message + Command []byte `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` + // Signature is the signature over command + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignedCommand) Reset() { *m = SignedCommand{} } +func (m *SignedCommand) String() string { return proto.CompactTextString(m) } +func (*SignedCommand) ProtoMessage() {} +func (*SignedCommand) Descriptor() ([]byte, []int) { + return fileDescriptor_prover_aacdf31643d38144, []int{13} +} +func (m *SignedCommand) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignedCommand.Unmarshal(m, b) +} +func (m *SignedCommand) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignedCommand.Marshal(b, m, deterministic) +} +func (dst *SignedCommand) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignedCommand.Merge(dst, src) +} +func (m *SignedCommand) XXX_Size() int { + return xxx_messageInfo_SignedCommand.Size(m) +} +func (m *SignedCommand) XXX_DiscardUnknown() { + xxx_messageInfo_SignedCommand.DiscardUnknown(m) +} + +var xxx_messageInfo_SignedCommand proto.InternalMessageInfo + +func (m *SignedCommand) GetCommand() []byte { + if m != nil { + return m.Command + } + return nil +} + +func (m *SignedCommand) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +type CommandResponseHeader struct { + // Timestamp is the time that the message + // was created as defined by the sender + Timestamp *timestamp.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // CommandHash is the hash computed on the concatenation of the SignedCommand's command and signature fields. + // If not specified differently, SHA256 is used + // The hash is used to link a response with its request, both for bookeeping purposes on an + // asynchronous system and for security reasons (accountability, non-repudiation) + CommandHash []byte `protobuf:"bytes,2,opt,name=command_hash,json=commandHash,proto3" json:"command_hash,omitempty"` + // Creator is the identity of the party creating this message + Creator []byte `protobuf:"bytes,3,opt,name=creator,proto3" json:"creator,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CommandResponseHeader) Reset() { *m = CommandResponseHeader{} } +func (m *CommandResponseHeader) String() string { return proto.CompactTextString(m) } +func (*CommandResponseHeader) ProtoMessage() {} +func (*CommandResponseHeader) Descriptor() ([]byte, []int) { + return fileDescriptor_prover_aacdf31643d38144, []int{14} +} +func (m *CommandResponseHeader) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommandResponseHeader.Unmarshal(m, b) +} +func (m *CommandResponseHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommandResponseHeader.Marshal(b, m, deterministic) +} +func (dst *CommandResponseHeader) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommandResponseHeader.Merge(dst, src) +} +func (m *CommandResponseHeader) XXX_Size() int { + return xxx_messageInfo_CommandResponseHeader.Size(m) +} +func (m *CommandResponseHeader) XXX_DiscardUnknown() { + xxx_messageInfo_CommandResponseHeader.DiscardUnknown(m) +} + +var xxx_messageInfo_CommandResponseHeader proto.InternalMessageInfo + +func (m *CommandResponseHeader) GetTimestamp() *timestamp.Timestamp { + if m != nil { + return m.Timestamp + } + return nil +} + +func (m *CommandResponseHeader) GetCommandHash() []byte { + if m != nil { + return m.CommandHash + } + return nil +} + +func (m *CommandResponseHeader) GetCreator() []byte { + if m != nil { + return m.Creator + } + return nil +} + +// Error reports an application error +type Error struct { + // Message associated with this response. + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + // Payload that can be used to include metadata with this response. + 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 *Error) Reset() { *m = Error{} } +func (m *Error) String() string { return proto.CompactTextString(m) } +func (*Error) ProtoMessage() {} +func (*Error) Descriptor() ([]byte, []int) { + return fileDescriptor_prover_aacdf31643d38144, []int{15} +} +func (m *Error) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Error.Unmarshal(m, b) +} +func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Error.Marshal(b, m, deterministic) +} +func (dst *Error) XXX_Merge(src proto.Message) { + xxx_messageInfo_Error.Merge(dst, src) +} +func (m *Error) XXX_Size() int { + return xxx_messageInfo_Error.Size(m) +} +func (m *Error) XXX_DiscardUnknown() { + xxx_messageInfo_Error.DiscardUnknown(m) +} + +var xxx_messageInfo_Error proto.InternalMessageInfo + +func (m *Error) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +func (m *Error) GetPayload() []byte { + if m != nil { + return m.Payload + } + return nil +} + +// A CommnandResponse is returned from a prover to the command submitter. +type CommandResponse struct { + // Header of the response. + Header *CommandResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // Payload of the response. + // + // Types that are valid to be assigned to Payload: + // *CommandResponse_Err + // *CommandResponse_TokenTransaction + // *CommandResponse_UnspentTokens + Payload isCommandResponse_Payload `protobuf_oneof:"payload"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CommandResponse) Reset() { *m = CommandResponse{} } +func (m *CommandResponse) String() string { return proto.CompactTextString(m) } +func (*CommandResponse) ProtoMessage() {} +func (*CommandResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_prover_aacdf31643d38144, []int{16} +} +func (m *CommandResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommandResponse.Unmarshal(m, b) +} +func (m *CommandResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommandResponse.Marshal(b, m, deterministic) +} +func (dst *CommandResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommandResponse.Merge(dst, src) +} +func (m *CommandResponse) XXX_Size() int { + return xxx_messageInfo_CommandResponse.Size(m) +} +func (m *CommandResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CommandResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_CommandResponse proto.InternalMessageInfo + +func (m *CommandResponse) GetHeader() *CommandResponseHeader { + if m != nil { + return m.Header + } + return nil +} + +type isCommandResponse_Payload interface { + isCommandResponse_Payload() +} + +type CommandResponse_Err struct { + Err *Error `protobuf:"bytes,2,opt,name=err,proto3,oneof"` +} + +type CommandResponse_TokenTransaction struct { + TokenTransaction *TokenTransaction `protobuf:"bytes,3,opt,name=token_transaction,json=tokenTransaction,proto3,oneof"` +} + +type CommandResponse_UnspentTokens struct { + UnspentTokens *UnspentTokens `protobuf:"bytes,4,opt,name=unspent_tokens,json=unspentTokens,proto3,oneof"` +} + +func (*CommandResponse_Err) isCommandResponse_Payload() {} + +func (*CommandResponse_TokenTransaction) isCommandResponse_Payload() {} + +func (*CommandResponse_UnspentTokens) isCommandResponse_Payload() {} + +func (m *CommandResponse) GetPayload() isCommandResponse_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (m *CommandResponse) GetErr() *Error { + if x, ok := m.GetPayload().(*CommandResponse_Err); ok { + return x.Err + } + return nil +} + +func (m *CommandResponse) GetTokenTransaction() *TokenTransaction { + if x, ok := m.GetPayload().(*CommandResponse_TokenTransaction); ok { + return x.TokenTransaction + } + return nil +} + +func (m *CommandResponse) GetUnspentTokens() *UnspentTokens { + if x, ok := m.GetPayload().(*CommandResponse_UnspentTokens); ok { + return x.UnspentTokens + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*CommandResponse) 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 _CommandResponse_OneofMarshaler, _CommandResponse_OneofUnmarshaler, _CommandResponse_OneofSizer, []interface{}{ + (*CommandResponse_Err)(nil), + (*CommandResponse_TokenTransaction)(nil), + (*CommandResponse_UnspentTokens)(nil), + } +} + +func _CommandResponse_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*CommandResponse) + // payload + switch x := m.Payload.(type) { + case *CommandResponse_Err: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Err); err != nil { + return err + } + case *CommandResponse_TokenTransaction: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.TokenTransaction); err != nil { + return err + } + case *CommandResponse_UnspentTokens: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.UnspentTokens); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("CommandResponse.Payload has unexpected type %T", x) + } + return nil +} + +func _CommandResponse_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*CommandResponse) + switch tag { + case 2: // payload.err + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Error) + err := b.DecodeMessage(msg) + m.Payload = &CommandResponse_Err{msg} + return true, err + case 3: // payload.token_transaction + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TokenTransaction) + err := b.DecodeMessage(msg) + m.Payload = &CommandResponse_TokenTransaction{msg} + return true, err + case 4: // payload.unspent_tokens + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(UnspentTokens) + err := b.DecodeMessage(msg) + m.Payload = &CommandResponse_UnspentTokens{msg} + return true, err + default: + return false, nil + } +} + +func _CommandResponse_OneofSizer(msg proto.Message) (n int) { + m := msg.(*CommandResponse) + // payload + switch x := m.Payload.(type) { + case *CommandResponse_Err: + s := proto.Size(x.Err) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *CommandResponse_TokenTransaction: + s := proto.Size(x.TokenTransaction) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *CommandResponse_UnspentTokens: + s := proto.Size(x.UnspentTokens) + 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 +} + +// SignedCommandResponse is a signed command response +type SignedCommandResponse struct { + // Response is the serialised version of a CommandResponse message + Response []byte `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` + // Signature is the signature over command + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignedCommandResponse) Reset() { *m = SignedCommandResponse{} } +func (m *SignedCommandResponse) String() string { return proto.CompactTextString(m) } +func (*SignedCommandResponse) ProtoMessage() {} +func (*SignedCommandResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_prover_aacdf31643d38144, []int{17} +} +func (m *SignedCommandResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignedCommandResponse.Unmarshal(m, b) +} +func (m *SignedCommandResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignedCommandResponse.Marshal(b, m, deterministic) +} +func (dst *SignedCommandResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignedCommandResponse.Merge(dst, src) +} +func (m *SignedCommandResponse) XXX_Size() int { + return xxx_messageInfo_SignedCommandResponse.Size(m) +} +func (m *SignedCommandResponse) XXX_DiscardUnknown() { + xxx_messageInfo_SignedCommandResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_SignedCommandResponse proto.InternalMessageInfo + +func (m *SignedCommandResponse) GetResponse() []byte { + if m != nil { + return m.Response + } + return nil +} + +func (m *SignedCommandResponse) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +func init() { + proto.RegisterType((*TokenToIssue)(nil), "sdk.protos.TokenToIssue") + proto.RegisterType((*RecipientTransferShare)(nil), "sdk.protos.RecipientTransferShare") + proto.RegisterType((*TokenOutput)(nil), "sdk.protos.TokenOutput") + proto.RegisterType((*UnspentTokens)(nil), "sdk.protos.UnspentTokens") + proto.RegisterType((*ListRequest)(nil), "sdk.protos.ListRequest") + proto.RegisterType((*ImportRequest)(nil), "sdk.protos.ImportRequest") + proto.RegisterType((*TransferRequest)(nil), "sdk.protos.TransferRequest") + proto.RegisterType((*RedeemRequest)(nil), "sdk.protos.RedeemRequest") + proto.RegisterType((*AllowanceRecipientShare)(nil), "sdk.protos.AllowanceRecipientShare") + proto.RegisterType((*ApproveRequest)(nil), "sdk.protos.ApproveRequest") + proto.RegisterType((*ExpectationRequest)(nil), "sdk.protos.ExpectationRequest") + proto.RegisterType((*Header)(nil), "sdk.protos.Header") + proto.RegisterType((*Command)(nil), "sdk.protos.Command") + proto.RegisterType((*SignedCommand)(nil), "sdk.protos.SignedCommand") + proto.RegisterType((*CommandResponseHeader)(nil), "sdk.protos.CommandResponseHeader") + proto.RegisterType((*Error)(nil), "sdk.protos.Error") + proto.RegisterType((*CommandResponse)(nil), "sdk.protos.CommandResponse") + proto.RegisterType((*SignedCommandResponse)(nil), "sdk.protos.SignedCommandResponse") +} + +// 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 + +// ProverClient is the client API for Prover service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ProverClient interface { + // ProcessCommand processes the passed command ensuring proper access control. + // The returned response allows the client to understand if the + // operation was succeffully executed and if not, the response + // reports the reason of the failure. + ProcessCommand(ctx context.Context, in *SignedCommand, opts ...grpc.CallOption) (*SignedCommandResponse, error) +} + +type proverClient struct { + cc *grpc.ClientConn +} + +func NewProverClient(cc *grpc.ClientConn) ProverClient { + return &proverClient{cc} +} + +func (c *proverClient) ProcessCommand(ctx context.Context, in *SignedCommand, opts ...grpc.CallOption) (*SignedCommandResponse, error) { + out := new(SignedCommandResponse) + err := c.cc.Invoke(ctx, "/protos.Prover/ProcessCommand", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ProverServer is the server API for Prover service. +type ProverServer interface { + // ProcessCommand processes the passed command ensuring proper access control. + // The returned response allows the client to understand if the + // operation was succeffully executed and if not, the response + // reports the reason of the failure. + ProcessCommand(context.Context, *SignedCommand) (*SignedCommandResponse, error) +} + +func RegisterProverServer(s *grpc.Server, srv ProverServer) { + s.RegisterService(&_Prover_serviceDesc, srv) +} + +func _Prover_ProcessCommand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SignedCommand) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProverServer).ProcessCommand(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/protos.Prover/ProcessCommand", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProverServer).ProcessCommand(ctx, req.(*SignedCommand)) + } + return interceptor(ctx, in, info, handler) +} + +var _Prover_serviceDesc = grpc.ServiceDesc{ + ServiceName: "protos.Prover", + HandlerType: (*ProverServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ProcessCommand", + Handler: _Prover_ProcessCommand_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "token/prover.proto", +} + +func init() { proto.RegisterFile("token/prover.proto", fileDescriptor_prover_aacdf31643d38144) } + +var fileDescriptor_prover_aacdf31643d38144 = []byte{ + // 1010 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xdd, 0x6f, 0x1b, 0x45, + 0x10, 0xf7, 0xd9, 0xae, 0x13, 0x8f, 0xbf, 0xd2, 0x4d, 0xd3, 0x9c, 0x0c, 0x69, 0xd3, 0x43, 0x42, + 0x11, 0x1f, 0xb6, 0x14, 0x04, 0xaa, 0xa0, 0xaa, 0x48, 0xa1, 0x70, 0x41, 0x54, 0xb4, 0x1b, 0xf3, + 0x82, 0x90, 0xac, 0xcd, 0xdd, 0xc6, 0x5e, 0xe1, 0xbb, 0xbd, 0xee, 0xee, 0x01, 0xe1, 0x0f, 0xe0, + 0x0d, 0x24, 0x1e, 0x79, 0xe0, 0xff, 0xe4, 0x11, 0xdd, 0x7e, 0x9c, 0xef, 0xdc, 0xd0, 0x06, 0x95, + 0x27, 0x7b, 0x67, 0x66, 0x67, 0x7e, 0x3b, 0xfb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, 0xf3, 0xf3, 0x83, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x10, 0x78, 0x90, 0x5b, 0x9b, 0x0a, + 0x00, 0x00, +} diff --git a/fabric/protos/token/transaction.pb.go b/fabric/protos/token/transaction.pb.go new file mode 100644 index 0000000..8c01800 --- /dev/null +++ b/fabric/protos/token/transaction.pb.go @@ -0,0 +1,819 @@ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: token/transaction.proto + +package token // import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/token" + +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 + +// TokenTransaction governs the structure of Payload.data, when +// the transaction's envelope header indicates a transaction of type +// "Token" +type TokenTransaction struct { + // action carries the content of this transaction. + // + // Types that are valid to be assigned to Action: + // *TokenTransaction_PlainAction + Action isTokenTransaction_Action `protobuf_oneof:"action"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TokenTransaction) Reset() { *m = TokenTransaction{} } +func (m *TokenTransaction) String() string { return proto.CompactTextString(m) } +func (*TokenTransaction) ProtoMessage() {} +func (*TokenTransaction) Descriptor() ([]byte, []int) { + return fileDescriptor_transaction_a359b0c8d648a383, []int{0} +} +func (m *TokenTransaction) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TokenTransaction.Unmarshal(m, b) +} +func (m *TokenTransaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TokenTransaction.Marshal(b, m, deterministic) +} +func (dst *TokenTransaction) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenTransaction.Merge(dst, src) +} +func (m *TokenTransaction) XXX_Size() int { + return xxx_messageInfo_TokenTransaction.Size(m) +} +func (m *TokenTransaction) XXX_DiscardUnknown() { + xxx_messageInfo_TokenTransaction.DiscardUnknown(m) +} + +var xxx_messageInfo_TokenTransaction proto.InternalMessageInfo + +type isTokenTransaction_Action interface { + isTokenTransaction_Action() +} + +type TokenTransaction_PlainAction struct { + PlainAction *PlainTokenAction `protobuf:"bytes,1,opt,name=plain_action,json=plainAction,proto3,oneof"` +} + +func (*TokenTransaction_PlainAction) isTokenTransaction_Action() {} + +func (m *TokenTransaction) GetAction() isTokenTransaction_Action { + if m != nil { + return m.Action + } + return nil +} + +func (m *TokenTransaction) GetPlainAction() *PlainTokenAction { + if x, ok := m.GetAction().(*TokenTransaction_PlainAction); ok { + return x.PlainAction + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*TokenTransaction) 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 _TokenTransaction_OneofMarshaler, _TokenTransaction_OneofUnmarshaler, _TokenTransaction_OneofSizer, []interface{}{ + (*TokenTransaction_PlainAction)(nil), + } +} + +func _TokenTransaction_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*TokenTransaction) + // action + switch x := m.Action.(type) { + case *TokenTransaction_PlainAction: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.PlainAction); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("TokenTransaction.Action has unexpected type %T", x) + } + return nil +} + +func _TokenTransaction_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*TokenTransaction) + switch tag { + case 1: // action.plain_action + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PlainTokenAction) + err := b.DecodeMessage(msg) + m.Action = &TokenTransaction_PlainAction{msg} + return true, err + default: + return false, nil + } +} + +func _TokenTransaction_OneofSizer(msg proto.Message) (n int) { + m := msg.(*TokenTransaction) + // action + switch x := m.Action.(type) { + case *TokenTransaction_PlainAction: + s := proto.Size(x.PlainAction) + 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 +} + +// PlainTokenAction governs the structure of a token action that is +// subjected to no privacy restrictions +type PlainTokenAction struct { + // Types that are valid to be assigned to Data: + // *PlainTokenAction_PlainImport + // *PlainTokenAction_PlainTransfer + // *PlainTokenAction_PlainRedeem + // *PlainTokenAction_PlainApprove + // *PlainTokenAction_PlainTransfer_From + Data isPlainTokenAction_Data `protobuf_oneof:"data"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PlainTokenAction) Reset() { *m = PlainTokenAction{} } +func (m *PlainTokenAction) String() string { return proto.CompactTextString(m) } +func (*PlainTokenAction) ProtoMessage() {} +func (*PlainTokenAction) Descriptor() ([]byte, []int) { + return fileDescriptor_transaction_a359b0c8d648a383, []int{1} +} +func (m *PlainTokenAction) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PlainTokenAction.Unmarshal(m, b) +} +func (m *PlainTokenAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PlainTokenAction.Marshal(b, m, deterministic) +} +func (dst *PlainTokenAction) XXX_Merge(src proto.Message) { + xxx_messageInfo_PlainTokenAction.Merge(dst, src) +} +func (m *PlainTokenAction) XXX_Size() int { + return xxx_messageInfo_PlainTokenAction.Size(m) +} +func (m *PlainTokenAction) XXX_DiscardUnknown() { + xxx_messageInfo_PlainTokenAction.DiscardUnknown(m) +} + +var xxx_messageInfo_PlainTokenAction proto.InternalMessageInfo + +type isPlainTokenAction_Data interface { + isPlainTokenAction_Data() +} + +type PlainTokenAction_PlainImport struct { + PlainImport *PlainImport `protobuf:"bytes,1,opt,name=plain_import,json=plainImport,proto3,oneof"` +} + +type PlainTokenAction_PlainTransfer struct { + PlainTransfer *PlainTransfer `protobuf:"bytes,2,opt,name=plain_transfer,json=plainTransfer,proto3,oneof"` +} + +type PlainTokenAction_PlainRedeem struct { + PlainRedeem *PlainTransfer `protobuf:"bytes,3,opt,name=plain_redeem,json=plainRedeem,proto3,oneof"` +} + +type PlainTokenAction_PlainApprove struct { + PlainApprove *PlainApprove `protobuf:"bytes,4,opt,name=plain_approve,json=plainApprove,proto3,oneof"` +} + +type PlainTokenAction_PlainTransfer_From struct { + PlainTransfer_From *PlainTransferFrom `protobuf:"bytes,5,opt,name=plain_transfer_From,json=plainTransferFrom,proto3,oneof"` +} + +func (*PlainTokenAction_PlainImport) isPlainTokenAction_Data() {} + +func (*PlainTokenAction_PlainTransfer) isPlainTokenAction_Data() {} + +func (*PlainTokenAction_PlainRedeem) isPlainTokenAction_Data() {} + +func (*PlainTokenAction_PlainApprove) isPlainTokenAction_Data() {} + +func (*PlainTokenAction_PlainTransfer_From) isPlainTokenAction_Data() {} + +func (m *PlainTokenAction) GetData() isPlainTokenAction_Data { + if m != nil { + return m.Data + } + return nil +} + +func (m *PlainTokenAction) GetPlainImport() *PlainImport { + if x, ok := m.GetData().(*PlainTokenAction_PlainImport); ok { + return x.PlainImport + } + return nil +} + +func (m *PlainTokenAction) GetPlainTransfer() *PlainTransfer { + if x, ok := m.GetData().(*PlainTokenAction_PlainTransfer); ok { + return x.PlainTransfer + } + return nil +} + +func (m *PlainTokenAction) GetPlainRedeem() *PlainTransfer { + if x, ok := m.GetData().(*PlainTokenAction_PlainRedeem); ok { + return x.PlainRedeem + } + return nil +} + +func (m *PlainTokenAction) GetPlainApprove() *PlainApprove { + if x, ok := m.GetData().(*PlainTokenAction_PlainApprove); ok { + return x.PlainApprove + } + return nil +} + +func (m *PlainTokenAction) GetPlainTransfer_From() *PlainTransferFrom { + if x, ok := m.GetData().(*PlainTokenAction_PlainTransfer_From); ok { + return x.PlainTransfer_From + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*PlainTokenAction) 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 _PlainTokenAction_OneofMarshaler, _PlainTokenAction_OneofUnmarshaler, _PlainTokenAction_OneofSizer, []interface{}{ + (*PlainTokenAction_PlainImport)(nil), + (*PlainTokenAction_PlainTransfer)(nil), + (*PlainTokenAction_PlainRedeem)(nil), + (*PlainTokenAction_PlainApprove)(nil), + (*PlainTokenAction_PlainTransfer_From)(nil), + } +} + +func _PlainTokenAction_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*PlainTokenAction) + // data + switch x := m.Data.(type) { + case *PlainTokenAction_PlainImport: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.PlainImport); err != nil { + return err + } + case *PlainTokenAction_PlainTransfer: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.PlainTransfer); err != nil { + return err + } + case *PlainTokenAction_PlainRedeem: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.PlainRedeem); err != nil { + return err + } + case *PlainTokenAction_PlainApprove: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.PlainApprove); err != nil { + return err + } + case *PlainTokenAction_PlainTransfer_From: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.PlainTransfer_From); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("PlainTokenAction.Data has unexpected type %T", x) + } + return nil +} + +func _PlainTokenAction_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*PlainTokenAction) + switch tag { + case 1: // data.plain_import + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PlainImport) + err := b.DecodeMessage(msg) + m.Data = &PlainTokenAction_PlainImport{msg} + return true, err + case 2: // data.plain_transfer + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PlainTransfer) + err := b.DecodeMessage(msg) + m.Data = &PlainTokenAction_PlainTransfer{msg} + return true, err + case 3: // data.plain_redeem + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PlainTransfer) + err := b.DecodeMessage(msg) + m.Data = &PlainTokenAction_PlainRedeem{msg} + return true, err + case 4: // data.plain_approve + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PlainApprove) + err := b.DecodeMessage(msg) + m.Data = &PlainTokenAction_PlainApprove{msg} + return true, err + case 5: // data.plain_transfer_From + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PlainTransferFrom) + err := b.DecodeMessage(msg) + m.Data = &PlainTokenAction_PlainTransfer_From{msg} + return true, err + default: + return false, nil + } +} + +func _PlainTokenAction_OneofSizer(msg proto.Message) (n int) { + m := msg.(*PlainTokenAction) + // data + switch x := m.Data.(type) { + case *PlainTokenAction_PlainImport: + s := proto.Size(x.PlainImport) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *PlainTokenAction_PlainTransfer: + s := proto.Size(x.PlainTransfer) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *PlainTokenAction_PlainRedeem: + s := proto.Size(x.PlainRedeem) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *PlainTokenAction_PlainApprove: + s := proto.Size(x.PlainApprove) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *PlainTokenAction_PlainTransfer_From: + s := proto.Size(x.PlainTransfer_From) + 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 +} + +// PlainImport specifies an import of one or more tokens in plaintext format +type PlainImport struct { + // An import transaction may contain one or more outputs + Outputs []*PlainOutput `protobuf:"bytes,1,rep,name=outputs,proto3" json:"outputs,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PlainImport) Reset() { *m = PlainImport{} } +func (m *PlainImport) String() string { return proto.CompactTextString(m) } +func (*PlainImport) ProtoMessage() {} +func (*PlainImport) Descriptor() ([]byte, []int) { + return fileDescriptor_transaction_a359b0c8d648a383, []int{2} +} +func (m *PlainImport) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PlainImport.Unmarshal(m, b) +} +func (m *PlainImport) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PlainImport.Marshal(b, m, deterministic) +} +func (dst *PlainImport) XXX_Merge(src proto.Message) { + xxx_messageInfo_PlainImport.Merge(dst, src) +} +func (m *PlainImport) XXX_Size() int { + return xxx_messageInfo_PlainImport.Size(m) +} +func (m *PlainImport) XXX_DiscardUnknown() { + xxx_messageInfo_PlainImport.DiscardUnknown(m) +} + +var xxx_messageInfo_PlainImport proto.InternalMessageInfo + +func (m *PlainImport) GetOutputs() []*PlainOutput { + if m != nil { + return m.Outputs + } + return nil +} + +// PlainTransfer specifies a transfer of one or more plaintext tokens to one or more outputs +type PlainTransfer struct { + // The inputs to the transfer transaction are specified by their ID + Inputs []*InputId `protobuf:"bytes,1,rep,name=inputs,proto3" json:"inputs,omitempty"` + // A transfer transaction may contain one or more outputs + Outputs []*PlainOutput `protobuf:"bytes,2,rep,name=outputs,proto3" json:"outputs,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PlainTransfer) Reset() { *m = PlainTransfer{} } +func (m *PlainTransfer) String() string { return proto.CompactTextString(m) } +func (*PlainTransfer) ProtoMessage() {} +func (*PlainTransfer) Descriptor() ([]byte, []int) { + return fileDescriptor_transaction_a359b0c8d648a383, []int{3} +} +func (m *PlainTransfer) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PlainTransfer.Unmarshal(m, b) +} +func (m *PlainTransfer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PlainTransfer.Marshal(b, m, deterministic) +} +func (dst *PlainTransfer) XXX_Merge(src proto.Message) { + xxx_messageInfo_PlainTransfer.Merge(dst, src) +} +func (m *PlainTransfer) XXX_Size() int { + return xxx_messageInfo_PlainTransfer.Size(m) +} +func (m *PlainTransfer) XXX_DiscardUnknown() { + xxx_messageInfo_PlainTransfer.DiscardUnknown(m) +} + +var xxx_messageInfo_PlainTransfer proto.InternalMessageInfo + +func (m *PlainTransfer) GetInputs() []*InputId { + if m != nil { + return m.Inputs + } + return nil +} + +func (m *PlainTransfer) GetOutputs() []*PlainOutput { + if m != nil { + return m.Outputs + } + return nil +} + +// PlainApprove specifies an approve of one or more tokens in plaintext format +type PlainApprove struct { + // The inputs to the transfer transaction are specified by their ID + Inputs []*InputId `protobuf:"bytes,1,rep,name=inputs,proto3" json:"inputs,omitempty"` + // An approve transaction contains one or more plain delegated outputs + DelegatedOutputs []*PlainDelegatedOutput `protobuf:"bytes,2,rep,name=delegated_outputs,json=delegatedOutputs,proto3" json:"delegated_outputs,omitempty"` + // An approve transaction contains one plain output + Output *PlainOutput `protobuf:"bytes,3,opt,name=output,proto3" json:"output,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PlainApprove) Reset() { *m = PlainApprove{} } +func (m *PlainApprove) String() string { return proto.CompactTextString(m) } +func (*PlainApprove) ProtoMessage() {} +func (*PlainApprove) Descriptor() ([]byte, []int) { + return fileDescriptor_transaction_a359b0c8d648a383, []int{4} +} +func (m *PlainApprove) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PlainApprove.Unmarshal(m, b) +} +func (m *PlainApprove) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PlainApprove.Marshal(b, m, deterministic) +} +func (dst *PlainApprove) XXX_Merge(src proto.Message) { + xxx_messageInfo_PlainApprove.Merge(dst, src) +} +func (m *PlainApprove) XXX_Size() int { + return xxx_messageInfo_PlainApprove.Size(m) +} +func (m *PlainApprove) XXX_DiscardUnknown() { + xxx_messageInfo_PlainApprove.DiscardUnknown(m) +} + +var xxx_messageInfo_PlainApprove proto.InternalMessageInfo + +func (m *PlainApprove) GetInputs() []*InputId { + if m != nil { + return m.Inputs + } + return nil +} + +func (m *PlainApprove) GetDelegatedOutputs() []*PlainDelegatedOutput { + if m != nil { + return m.DelegatedOutputs + } + return nil +} + +func (m *PlainApprove) GetOutput() *PlainOutput { + if m != nil { + return m.Output + } + return nil +} + +// PlainTransferFrom specifies a transfer of one or more plaintext delegated tokens to one or more outputs +// an to a delegated output +type PlainTransferFrom struct { + // The inputs to the transfer transaction are specified by their ID + Inputs []*InputId `protobuf:"bytes,1,rep,name=inputs,proto3" json:"inputs,omitempty"` + // A transferFrom transaction contains multiple outputs + Outputs []*PlainOutput `protobuf:"bytes,2,rep,name=outputs,proto3" json:"outputs,omitempty"` + // A transferFrom transaction may contain one delegatable output + DelegatedOutput *PlainDelegatedOutput `protobuf:"bytes,3,opt,name=delegated_output,json=delegatedOutput,proto3" json:"delegated_output,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PlainTransferFrom) Reset() { *m = PlainTransferFrom{} } +func (m *PlainTransferFrom) String() string { return proto.CompactTextString(m) } +func (*PlainTransferFrom) ProtoMessage() {} +func (*PlainTransferFrom) Descriptor() ([]byte, []int) { + return fileDescriptor_transaction_a359b0c8d648a383, []int{5} +} +func (m *PlainTransferFrom) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PlainTransferFrom.Unmarshal(m, b) +} +func (m *PlainTransferFrom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PlainTransferFrom.Marshal(b, m, deterministic) +} +func (dst *PlainTransferFrom) XXX_Merge(src proto.Message) { + xxx_messageInfo_PlainTransferFrom.Merge(dst, src) +} +func (m *PlainTransferFrom) XXX_Size() int { + return xxx_messageInfo_PlainTransferFrom.Size(m) +} +func (m *PlainTransferFrom) XXX_DiscardUnknown() { + xxx_messageInfo_PlainTransferFrom.DiscardUnknown(m) +} + +var xxx_messageInfo_PlainTransferFrom proto.InternalMessageInfo + +func (m *PlainTransferFrom) GetInputs() []*InputId { + if m != nil { + return m.Inputs + } + return nil +} + +func (m *PlainTransferFrom) GetOutputs() []*PlainOutput { + if m != nil { + return m.Outputs + } + return nil +} + +func (m *PlainTransferFrom) GetDelegatedOutput() *PlainDelegatedOutput { + if m != nil { + return m.DelegatedOutput + } + return nil +} + +// A PlainOutput is the result of import and transfer transactions using plaintext tokens +type PlainOutput struct { + // The owner is the serialization of a SerializedIdentity struct + Owner []byte `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + // The token type + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + // The quantity of tokens + Quantity uint64 `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PlainOutput) Reset() { *m = PlainOutput{} } +func (m *PlainOutput) String() string { return proto.CompactTextString(m) } +func (*PlainOutput) ProtoMessage() {} +func (*PlainOutput) Descriptor() ([]byte, []int) { + return fileDescriptor_transaction_a359b0c8d648a383, []int{6} +} +func (m *PlainOutput) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PlainOutput.Unmarshal(m, b) +} +func (m *PlainOutput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PlainOutput.Marshal(b, m, deterministic) +} +func (dst *PlainOutput) XXX_Merge(src proto.Message) { + xxx_messageInfo_PlainOutput.Merge(dst, src) +} +func (m *PlainOutput) XXX_Size() int { + return xxx_messageInfo_PlainOutput.Size(m) +} +func (m *PlainOutput) XXX_DiscardUnknown() { + xxx_messageInfo_PlainOutput.DiscardUnknown(m) +} + +var xxx_messageInfo_PlainOutput proto.InternalMessageInfo + +func (m *PlainOutput) GetOwner() []byte { + if m != nil { + return m.Owner + } + return nil +} + +func (m *PlainOutput) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *PlainOutput) GetQuantity() uint64 { + if m != nil { + return m.Quantity + } + return 0 +} + +// An InputId specifies an output using the transaction ID and the index of the output in the transaction +type InputId struct { + // The transaction ID + TxId string `protobuf:"bytes,1,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` + // The index of the output in the transaction + Index uint32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *InputId) Reset() { *m = InputId{} } +func (m *InputId) String() string { return proto.CompactTextString(m) } +func (*InputId) ProtoMessage() {} +func (*InputId) Descriptor() ([]byte, []int) { + return fileDescriptor_transaction_a359b0c8d648a383, []int{7} +} +func (m *InputId) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_InputId.Unmarshal(m, b) +} +func (m *InputId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_InputId.Marshal(b, m, deterministic) +} +func (dst *InputId) XXX_Merge(src proto.Message) { + xxx_messageInfo_InputId.Merge(dst, src) +} +func (m *InputId) XXX_Size() int { + return xxx_messageInfo_InputId.Size(m) +} +func (m *InputId) XXX_DiscardUnknown() { + xxx_messageInfo_InputId.DiscardUnknown(m) +} + +var xxx_messageInfo_InputId proto.InternalMessageInfo + +func (m *InputId) GetTxId() string { + if m != nil { + return m.TxId + } + return "" +} + +func (m *InputId) GetIndex() uint32 { + if m != nil { + return m.Index + } + return 0 +} + +// A PlainDelegatedOutput is the result of approve transactions using plaintext tokens +type PlainDelegatedOutput struct { + // The owner is the serialization of a SerializedIdentity struct + Owner []byte `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + // The delegatees is an arrary of the serialized identities that can spend the output on behalf + // the owner + Delegatees [][]byte `protobuf:"bytes,2,rep,name=delegatees,proto3" json:"delegatees,omitempty"` + // The token type + Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` + // The quantity of tokens + Quantity uint64 `protobuf:"varint,4,opt,name=quantity,proto3" json:"quantity,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PlainDelegatedOutput) Reset() { *m = PlainDelegatedOutput{} } +func (m *PlainDelegatedOutput) String() string { return proto.CompactTextString(m) } +func (*PlainDelegatedOutput) ProtoMessage() {} +func (*PlainDelegatedOutput) Descriptor() ([]byte, []int) { + return fileDescriptor_transaction_a359b0c8d648a383, []int{8} +} +func (m *PlainDelegatedOutput) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PlainDelegatedOutput.Unmarshal(m, b) +} +func (m *PlainDelegatedOutput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PlainDelegatedOutput.Marshal(b, m, deterministic) +} +func (dst *PlainDelegatedOutput) XXX_Merge(src proto.Message) { + xxx_messageInfo_PlainDelegatedOutput.Merge(dst, src) +} +func (m *PlainDelegatedOutput) XXX_Size() int { + return xxx_messageInfo_PlainDelegatedOutput.Size(m) +} +func (m *PlainDelegatedOutput) XXX_DiscardUnknown() { + xxx_messageInfo_PlainDelegatedOutput.DiscardUnknown(m) +} + +var xxx_messageInfo_PlainDelegatedOutput proto.InternalMessageInfo + +func (m *PlainDelegatedOutput) GetOwner() []byte { + if m != nil { + return m.Owner + } + return nil +} + +func (m *PlainDelegatedOutput) GetDelegatees() [][]byte { + if m != nil { + return m.Delegatees + } + return nil +} + +func (m *PlainDelegatedOutput) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *PlainDelegatedOutput) GetQuantity() uint64 { + if m != nil { + return m.Quantity + } + return 0 +} + +func init() { + proto.RegisterType((*TokenTransaction)(nil), "sdk.TokenTransaction") + proto.RegisterType((*PlainTokenAction)(nil), "sdk.PlainTokenAction") + proto.RegisterType((*PlainImport)(nil), "sdk.PlainImport") + proto.RegisterType((*PlainTransfer)(nil), "sdk.PlainTransfer") + proto.RegisterType((*PlainApprove)(nil), "sdk.PlainApprove") + proto.RegisterType((*PlainTransferFrom)(nil), "sdk.PlainTransferFrom") + proto.RegisterType((*PlainOutput)(nil), "sdk.PlainOutput") + proto.RegisterType((*InputId)(nil), "sdk.InputId") + proto.RegisterType((*PlainDelegatedOutput)(nil), "sdk.PlainDelegatedOutput") +} + +func init() { + proto.RegisterFile("token/transaction.proto", fileDescriptor_transaction_a359b0c8d648a383) +} + +var fileDescriptor_transaction_a359b0c8d648a383 = []byte{ + // 505 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x4f, 0x8f, 0xd2, 0x40, + 0x14, 0xa7, 0x50, 0xba, 0xf8, 0x68, 0x57, 0x98, 0x5d, 0x63, 0xe3, 0xc1, 0x90, 0xc6, 0x18, 0x63, + 0x0c, 0x8d, 0xee, 0xaa, 0x57, 0x97, 0x6c, 0x0c, 0x9c, 0x34, 0x23, 0x17, 0xbd, 0x90, 0xc2, 0xcc, + 0xb2, 0x8d, 0xd0, 0x19, 0x87, 0x41, 0x21, 0xf1, 0x93, 0x78, 0xf1, 0x63, 0xf8, 0xf5, 0x4c, 0xdf, + 0x4c, 0xd9, 0x16, 0xc5, 0x78, 0xd8, 0x5b, 0x7f, 0xbf, 0x37, 0xbf, 0x3f, 0x6f, 0xda, 0x14, 0xee, + 0x6b, 0xf1, 0x99, 0x67, 0xb1, 0x56, 0x49, 0xb6, 0x4a, 0x66, 0x3a, 0x15, 0x59, 0x5f, 0x2a, 0xa1, + 0x45, 0x34, 0x86, 0xce, 0x38, 0x1f, 0x8d, 0x6f, 0x26, 0xe4, 0x15, 0xf8, 0x72, 0x91, 0xa4, 0xd9, + 0xc4, 0xe0, 0xd0, 0xe9, 0x39, 0x4f, 0xda, 0x2f, 0xba, 0xfd, 0xf7, 0x39, 0x89, 0xa7, 0x2f, 0x70, + 0x30, 0xac, 0xd1, 0x36, 0x1e, 0x34, 0x70, 0xd0, 0x02, 0xcf, 0x28, 0xa2, 0x5f, 0x75, 0xe8, 0xec, + 0x9f, 0x26, 0xcf, 0x0b, 0xdb, 0x74, 0x29, 0x85, 0xd2, 0xd6, 0xd6, 0x37, 0xb6, 0x23, 0xe4, 0x76, + 0x8e, 0x06, 0x92, 0xd7, 0x70, 0x6c, 0x24, 0x58, 0xfc, 0x8a, 0xab, 0xb0, 0x8e, 0xa2, 0x63, 0xdb, + 0xc5, 0xb2, 0xc3, 0x1a, 0x0d, 0x64, 0x99, 0x20, 0x67, 0x45, 0x96, 0xe2, 0x8c, 0xf3, 0x65, 0xd8, + 0x38, 0x20, 0x33, 0x69, 0x14, 0x0f, 0x91, 0x73, 0x08, 0xec, 0xde, 0x52, 0x2a, 0xf1, 0x95, 0x87, + 0x2e, 0xaa, 0x02, 0xa3, 0xba, 0x30, 0xe4, 0xb0, 0x46, 0x8d, 0xb5, 0xc5, 0xe4, 0x12, 0x4e, 0xaa, + 0x1d, 0x27, 0x6f, 0x95, 0x58, 0x86, 0x4d, 0xd4, 0x92, 0x6a, 0x62, 0x3e, 0x19, 0xd6, 0x68, 0x57, + 0xee, 0x93, 0x03, 0x0f, 0x5c, 0x96, 0xe8, 0x24, 0x7a, 0x09, 0xed, 0xd2, 0x7d, 0x90, 0xc7, 0x70, + 0x24, 0xd6, 0x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4b, 0x3e, 0x2d, 0x31, 0xbb, 0xce, 0x8d, + 0x03, 0x9d, 0xdd, 0x6a, 0xe7, 0xc1, 0xb3, 0x4f, 0x4f, 0xe7, 0xa9, 0xbe, 0x5e, 0x4f, 0xfb, 0x33, + 0xb1, 0x8c, 0xaf, 0xb7, 0x92, 0xab, 0x05, 0x67, 0x73, 0xae, 0xe2, 0xab, 0x64, 0xaa, 0xd2, 0x59, + 0x8c, 0x3f, 0xa4, 0x55, 0x8c, 0x7f, 0xaa, 0xa9, 0x87, 0xe8, 0xec, 0x77, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x10, 0xe3, 0xb3, 0x61, 0xb9, 0x04, 0x00, 0x00, +} diff --git a/fabric/protos/utils/commonutils.go b/fabric/protos/utils/commonutils.go new file mode 100644 index 0000000..aacb3bc --- /dev/null +++ b/fabric/protos/utils/commonutils.go @@ -0,0 +1,118 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ + +package utils + +import ( + "fmt" + "time" + + "github.com/golang/protobuf/proto" + "github.com/golang/protobuf/ptypes/timestamp" + cb "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/common" + "github.com/pkg/errors" +) + +// MarshalOrPanic serializes a protobuf message and panics if this +// operation fails +func MarshalOrPanic(pb proto.Message) []byte { + data, err := proto.Marshal(pb) + if err != nil { + panic(err) + } + return data +} + +// Marshal serializes a protobuf message. +func Marshal(pb proto.Message) ([]byte, error) { + return proto.Marshal(pb) +} + +// ExtractEnvelopeOrPanic retrieves the requested envelope from a given block +// and unmarshals it -- it panics if either of these operations fail +func ExtractEnvelopeOrPanic(block *cb.Block, index int) *cb.Envelope { + envelope, err := ExtractEnvelope(block, index) + if err != nil { + panic(err) + } + return envelope +} + +// ExtractEnvelope retrieves the requested envelope from a given block and +// unmarshals it +func ExtractEnvelope(block *cb.Block, index int) (*cb.Envelope, error) { + if block.Data == nil { + return nil, errors.New("block data is nil") + } + + envelopeCount := len(block.Data.Data) + if index < 0 || index >= envelopeCount { + return nil, errors.New("envelope index out of bounds") + } + marshaledEnvelope := block.Data.Data[index] + envelope, err := GetEnvelopeFromBlock(marshaledEnvelope) + err = errors.WithMessage(err, fmt.Sprintf("block data does not carry an envelope at index %d", index)) + return envelope, err +} + +// ExtractPayloadOrPanic retrieves the payload of a given envelope and +// unmarshals it -- it panics if either of these operations fail +func ExtractPayloadOrPanic(envelope *cb.Envelope) *cb.Payload { + payload, err := ExtractPayload(envelope) + if err != nil { + panic(err) + } + return payload +} + +// ExtractPayload retrieves the payload of a given envelope and unmarshals it. +func ExtractPayload(envelope *cb.Envelope) (*cb.Payload, error) { + payload := &cb.Payload{} + err := proto.Unmarshal(envelope.Payload, payload) + err = errors.Wrap(err, "no payload in envelope") + return payload, err +} + +// MakeChannelHeader creates a ChannelHeader. +func MakeChannelHeader(headerType cb.HeaderType, version int32, chainID string, epoch uint64) *cb.ChannelHeader { + return &cb.ChannelHeader{ + Type: int32(headerType), + Version: version, + Timestamp: ×tamp.Timestamp{ + Seconds: time.Now().Unix(), + Nanos: 0, + }, + ChannelId: chainID, + Epoch: epoch, + } +} + +// MakePayloadHeader creates a Payload Header. +func MakePayloadHeader(ch *cb.ChannelHeader, sh *cb.SignatureHeader) *cb.Header { + return &cb.Header{ + ChannelHeader: MarshalOrPanic(ch), + SignatureHeader: MarshalOrPanic(sh), + } +} + +// UnmarshalChannelHeader returns a ChannelHeader from bytes +func UnmarshalChannelHeader(bytes []byte) (*cb.ChannelHeader, error) { + chdr := &cb.ChannelHeader{} + err := proto.Unmarshal(bytes, chdr) + return chdr, errors.Wrap(err, "error unmarshaling ChannelHeader") +} + +// CreateUtcTimestamp returns a google/protobuf/Timestamp in UTC +func CreateUtcTimestamp() *timestamp.Timestamp { + now := time.Now().UTC() + secs := now.Unix() + nanos := int32(now.UnixNano() - (secs * 1000000000)) + return &(timestamp.Timestamp{Seconds: secs, Nanos: nanos}) +} diff --git a/fabric/protos/utils/proputils.go b/fabric/protos/utils/proputils.go new file mode 100644 index 0000000..dbd94ee --- /dev/null +++ b/fabric/protos/utils/proputils.go @@ -0,0 +1,214 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ + +package utils + +import ( + "github.com/golang/protobuf/proto" + "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/common" + "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/peer" + "github.com/pkg/errors" +) + +// GetHeader Get Header from bytes +func GetHeader(bytes []byte) (*common.Header, error) { + hdr := &common.Header{} + err := proto.Unmarshal(bytes, hdr) + return hdr, errors.Wrap(err, "error unmarshaling Header") +} + +// GetChaincodeHeaderExtension get chaincode header extension given header +func GetChaincodeHeaderExtension(hdr *common.Header) (*peer.ChaincodeHeaderExtension, error) { + chdr, err := UnmarshalChannelHeader(hdr.ChannelHeader) + if err != nil { + return nil, err + } + + chaincodeHdrExt := &peer.ChaincodeHeaderExtension{} + err = proto.Unmarshal(chdr.Extension, chaincodeHdrExt) + return chaincodeHdrExt, errors.Wrap(err, "error unmarshaling ChaincodeHeaderExtension") +} + +// GetChaincodeAction gets the ChaincodeAction given chaicnode action bytes +func GetChaincodeAction(caBytes []byte) (*peer.ChaincodeAction, error) { + chaincodeAction := &peer.ChaincodeAction{} + err := proto.Unmarshal(caBytes, chaincodeAction) + return chaincodeAction, errors.Wrap(err, "error unmarshaling ChaincodeAction") +} + +// GetChaincodeEvents gets the ChaincodeEvents given chaincode event bytes +func GetChaincodeEvents(eBytes []byte) (*peer.ChaincodeEvent, error) { + chaincodeEvent := &peer.ChaincodeEvent{} + err := proto.Unmarshal(eBytes, chaincodeEvent) + return chaincodeEvent, errors.Wrap(err, "error unmarshaling ChaicnodeEvent") +} + +// GetProposalResponsePayload gets the proposal response payload +func GetProposalResponsePayload(prpBytes []byte) (*peer.ProposalResponsePayload, error) { + prp := &peer.ProposalResponsePayload{} + err := proto.Unmarshal(prpBytes, prp) + return prp, errors.Wrap(err, "error unmarshaling ProposalResponsePayload") +} + +// GetPayload Get Payload from Envelope message +func GetPayload(e *common.Envelope) (*common.Payload, error) { + payload := &common.Payload{} + err := proto.Unmarshal(e.Payload, payload) + return payload, errors.Wrap(err, "error unmarshaling Payload") +} + +// GetTransaction Get Transaction from bytes +func GetTransaction(txBytes []byte) (*peer.Transaction, error) { + tx := &peer.Transaction{} + err := proto.Unmarshal(txBytes, tx) + return tx, errors.Wrap(err, "error unmarshaling Transaction") + +} + +// GetChaincodeActionPayload Get ChaincodeActionPayload from bytes +func GetChaincodeActionPayload(capBytes []byte) (*peer.ChaincodeActionPayload, error) { + cap := &peer.ChaincodeActionPayload{} + err := proto.Unmarshal(capBytes, cap) + return cap, errors.Wrap(err, "error unmarshaling ChaincodeActionPayload") +} + +// GetChaincodeProposalPayload Get ChaincodeProposalPayload from bytes +func GetChaincodeProposalPayload(bytes []byte) (*peer.ChaincodeProposalPayload, error) { + cpp := &peer.ChaincodeProposalPayload{} + err := proto.Unmarshal(bytes, cpp) + return cpp, errors.Wrap(err, "error unmarshaling 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") +} + +// CreateChaincodeProposalWithTxIDNonceAndTransient creates a proposal from +// given input +func CreateChaincodeProposalWithTxIDNonceAndTransient(txid string, typ common.HeaderType, chainID string, cis *peer.ChaincodeInvocationSpec, nonce, creator []byte, transientMap map[string][]byte) (*peer.Proposal, string, error) { + ccHdrExt := &peer.ChaincodeHeaderExtension{ChaincodeId: cis.ChaincodeSpec.ChaincodeId} + ccHdrExtBytes, err := proto.Marshal(ccHdrExt) + if err != nil { + return nil, "", errors.Wrap(err, "error marshaling ChaincodeHeaderExtension") + } + + cisBytes, err := proto.Marshal(cis) + if err != nil { + return nil, "", errors.Wrap(err, "error marshaling ChaincodeInvocationSpec") + } + + ccPropPayload := &peer.ChaincodeProposalPayload{Input: cisBytes, TransientMap: transientMap} + ccPropPayloadBytes, err := proto.Marshal(ccPropPayload) + if err != nil { + return nil, "", errors.Wrap(err, "error marshaling ChaincodeProposalPayload") + } + + // TODO: epoch is now set to zero. This must be changed once we + // get a more appropriate mechanism to handle it in. + var epoch uint64 + + timestamp := CreateUtcTimestamp() + + hdr := &common.Header{ + ChannelHeader: MarshalOrPanic( + &common.ChannelHeader{ + Type: int32(typ), + TxId: txid, + Timestamp: timestamp, + ChannelId: chainID, + Extension: ccHdrExtBytes, + Epoch: epoch, + }, + ), + SignatureHeader: MarshalOrPanic( + &common.SignatureHeader{ + Nonce: nonce, + Creator: creator, + }, + ), + } + + hdrBytes, err := proto.Marshal(hdr) + if err != nil { + return nil, "", err + } + + prop := &peer.Proposal{ + Header: hdrBytes, + Payload: ccPropPayloadBytes, + } + return prop, txid, nil +} + +// GetBytesProposalResponsePayload gets proposal response payload +func GetBytesProposalResponsePayload(hash []byte, response *peer.Response, result []byte, event []byte, ccid *peer.ChaincodeID) ([]byte, error) { + cAct := &peer.ChaincodeAction{ + Events: event, Results: result, + Response: response, + ChaincodeId: ccid, + } + cActBytes, err := proto.Marshal(cAct) + if err != nil { + return nil, errors.Wrap(err, "error marshaling ChaincodeAction") + } + + prp := &peer.ProposalResponsePayload{ + Extension: cActBytes, + ProposalHash: hash, + } + prpBytes, err := proto.Marshal(prp) + return prpBytes, errors.Wrap(err, "error marshaling ProposalResponsePayload") +} + +// GetBytesChaincodeProposalPayload gets the chaincode proposal payload +func GetBytesChaincodeProposalPayload(cpp *peer.ChaincodeProposalPayload) ([]byte, error) { + cppBytes, err := proto.Marshal(cpp) + return cppBytes, errors.Wrap(err, "error marshaling ChaincodeProposalPayload") +} + +// GetBytesChaincodeEvent gets the bytes of ChaincodeEvent +func GetBytesChaincodeEvent(event *peer.ChaincodeEvent) ([]byte, error) { + eventBytes, err := proto.Marshal(event) + return eventBytes, errors.Wrap(err, "error marshaling ChaincodeEvent") +} + +// GetBytesChaincodeActionPayload get the bytes of ChaincodeActionPayload from +// the message +func GetBytesChaincodeActionPayload(cap *peer.ChaincodeActionPayload) ([]byte, error) { + capBytes, err := proto.Marshal(cap) + return capBytes, errors.Wrap(err, "error marshaling ChaincodeActionPayload") +} + +// GetBytesProposal returns the bytes of a proposal message +func GetBytesProposal(prop *peer.Proposal) ([]byte, error) { + propBytes, err := proto.Marshal(prop) + return propBytes, errors.Wrap(err, "error marshaling Proposal") +} + +// GetBytesTransaction get the bytes of Transaction from the message +func GetBytesTransaction(tx *peer.Transaction) ([]byte, error) { + bytes, err := proto.Marshal(tx) + return bytes, errors.Wrap(err, "error unmarshaling Transaction") +} + +// GetBytesPayload get the bytes of Payload from the message +func GetBytesPayload(payl *common.Payload) ([]byte, error) { + bytes, err := proto.Marshal(payl) + return bytes, errors.Wrap(err, "error marshaling Payload") +} + +// GetBytesEnvelope get the bytes of Envelope from the message +func GetBytesEnvelope(env *common.Envelope) ([]byte, error) { + bytes, err := proto.Marshal(env) + return bytes, errors.Wrap(err, "error marshaling Envelope") +} diff --git a/fabric/protos/utils/txutils.go b/fabric/protos/utils/txutils.go new file mode 100644 index 0000000..b4343d2 --- /dev/null +++ b/fabric/protos/utils/txutils.go @@ -0,0 +1,85 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ +/* +Notice: This file has been modified for Hyperledger Fabric SDK Go usage. +Please review third_party pinning scripts and patches for more details. +*/ + +package utils + +import ( + "github.com/golang/protobuf/proto" + "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/common" + "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/peer" + "github.com/pkg/errors" +) + +// GetPayloads gets the underlying payload objects in a TransactionAction +func GetPayloads(txActions *peer.TransactionAction) (*peer.ChaincodeActionPayload, *peer.ChaincodeAction, error) { + // TODO: pass in the tx type (in what follows we're assuming the + // type is ENDORSER_TRANSACTION) + ccPayload, err := GetChaincodeActionPayload(txActions.Payload) + if err != nil { + return nil, nil, err + } + + if ccPayload.Action == nil || ccPayload.Action.ProposalResponsePayload == nil { + return nil, nil, errors.New("no payload in ChaincodeActionPayload") + } + pRespPayload, err := GetProposalResponsePayload(ccPayload.Action.ProposalResponsePayload) + if err != nil { + return nil, nil, err + } + + if pRespPayload.Extension == nil { + return nil, nil, errors.New("response payload is missing extension") + } + + respPayload, err := GetChaincodeAction(pRespPayload.Extension) + if err != nil { + return ccPayload, nil, err + } + return ccPayload, respPayload, nil +} + +// GetEnvelopeFromBlock gets an envelope from a block's Data field. +func GetEnvelopeFromBlock(data []byte) (*common.Envelope, error) { + // Block always begins with an envelope + var err error + env := &common.Envelope{} + if err = proto.Unmarshal(data, env); err != nil { + return nil, errors.Wrap(err, "error unmarshaling Envelope") + } + + return env, nil +} + +// GetBytesProposalPayloadForTx takes a ChaincodeProposalPayload and returns +// its serialized version according to the visibility field +func GetBytesProposalPayloadForTx(payload *peer.ChaincodeProposalPayload, visibility []byte) ([]byte, error) { + // check for nil argument + if payload == nil { + return nil, errors.New("nil arguments") + } + + // strip the transient bytes off the payload - this needs to be done no + // matter the visibility mode + cppNoTransient := &peer.ChaincodeProposalPayload{Input: payload.Input, TransientMap: nil} + cppBytes, err := GetBytesChaincodeProposalPayload(cppNoTransient) + if err != nil { + return nil, err + } + + // currently the fabric only supports full visibility: this means that + // there are no restrictions on which parts of the proposal payload will + // be visible in the final transaction; this default approach requires + // no additional instructions in the PayloadVisibility field; however + // the fabric may be extended to encode more elaborate visibility + // mechanisms that shall be encoded in this field (and handled + // appropriately by the peer) + + return cppBytes, nil +}