common

package
v1.0.0-preview Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package common is a generated protocol buffer package.

It is generated from these files:

common/common.proto
common/configuration.proto
common/msp_principal.proto

It has these top-level messages:

LastConfiguration
Metadata
MetadataSignature
Header
ChainHeader
SignatureHeader
Payload
Envelope
Block
BlockHeader
BlockData
BlockMetadata
ConfigurationEnvelope
ConfigurationTemplate
SignedConfigurationItem
ConfigurationItem
ConfigurationSignature
Policy
SignaturePolicyEnvelope
SignaturePolicy
HashingAlgorithm
BlockDataHashingStructure
OrdererAddresses
MSPPrincipal
OrganizationUnit
MSPRole

Index

Constants

This section is empty.

Variables

View Source
var BlockMetadataIndex_name = map[int32]string{
	0: "SIGNATURES",
	1: "LAST_CONFIGURATION",
	2: "TRANSACTIONS_FILTER",
	3: "ORDERER",
}
View Source
var BlockMetadataIndex_value = map[string]int32{
	"SIGNATURES":          0,
	"LAST_CONFIGURATION":  1,
	"TRANSACTIONS_FILTER": 2,
	"ORDERER":             3,
}
View Source
var ConfigurationItem_ConfigurationType_name = map[int32]string{
	0: "Policy",
	1: "Chain",
	2: "Orderer",
	3: "Peer",
	4: "MSP",
}
View Source
var ConfigurationItem_ConfigurationType_value = map[string]int32{
	"Policy":  0,
	"Chain":   1,
	"Orderer": 2,
	"Peer":    3,
	"MSP":     4,
}
View Source
var HeaderType_name = map[int32]string{
	0: "MESSAGE",
	1: "CONFIGURATION_TRANSACTION",
	2: "CONFIGURATION_ITEM",
	3: "ENDORSER_TRANSACTION",
	4: "ORDERER_TRANSACTION",
	5: "DELIVER_SEEK_INFO",
}
View Source
var HeaderType_value = map[string]int32{
	"MESSAGE":                   0,
	"CONFIGURATION_TRANSACTION": 1,
	"CONFIGURATION_ITEM":        2,
	"ENDORSER_TRANSACTION":      3,
	"ORDERER_TRANSACTION":       4,
	"DELIVER_SEEK_INFO":         5,
}
View Source
var MSPPrincipal_Classification_name = map[int32]string{
	0: "ByMSPRole",
	1: "ByOrganizationUnit",
	2: "ByIdentity",
}
View Source
var MSPPrincipal_Classification_value = map[string]int32{
	"ByMSPRole":          0,
	"ByOrganizationUnit": 1,
	"ByIdentity":         2,
}
View Source
var MSPRole_MSPRoleType_name = map[int32]string{
	0: "Member",
	1: "Admin",
}
View Source
var MSPRole_MSPRoleType_value = map[string]int32{
	"Member": 0,
	"Admin":  1,
}
View Source
var Policy_PolicyType_name = map[int32]string{
	0: "UNKNOWN",
	1: "SIGNATURE",
	2: "MSP",
}
View Source
var Policy_PolicyType_value = map[string]int32{
	"UNKNOWN":   0,
	"SIGNATURE": 1,
	"MSP":       2,
}
View Source
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",
	503: "SERVICE_UNAVAILABLE",
}
View Source
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,
	"SERVICE_UNAVAILABLE":      503,
}

Functions

This section is empty.

Types

type Block

type Block struct {
	Header   *BlockHeader   `protobuf:"bytes,1,opt,name=Header" json:"Header,omitempty"`
	Data     *BlockData     `protobuf:"bytes,2,opt,name=Data" json:"Data,omitempty"`
	Metadata *BlockMetadata `protobuf:"bytes,3,opt,name=Metadata" json:"Metadata,omitempty"`
}

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.

func NewBlock

func NewBlock(seqNum uint64, previousHash []byte) *Block

NewBlock construct a block with no data and no metadata.

func (*Block) Descriptor

func (*Block) Descriptor() ([]byte, []int)

func (*Block) GetData

func (m *Block) GetData() *BlockData

func (*Block) GetHeader

func (m *Block) GetHeader() *BlockHeader

func (*Block) GetMetadata

func (m *Block) GetMetadata() *BlockMetadata

func (*Block) ProtoMessage

func (*Block) ProtoMessage()

func (*Block) Reset

func (m *Block) Reset()

func (*Block) String

func (m *Block) String() string

type BlockData

type BlockData struct {
	Data [][]byte `protobuf:"bytes,1,rep,name=Data,proto3" json:"Data,omitempty"`
}

func (*BlockData) Descriptor

func (*BlockData) Descriptor() ([]byte, []int)

func (*BlockData) Hash

func (b *BlockData) Hash() []byte

Hash returns the hash of the marshaled representation of the block data.

func (*BlockData) ProtoMessage

func (*BlockData) ProtoMessage()

func (*BlockData) Reset

func (m *BlockData) Reset()

func (*BlockData) String

func (m *BlockData) String() string

type BlockDataHashingStructure

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" json:"width,omitempty"`
}

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

func (*BlockDataHashingStructure) Descriptor

func (*BlockDataHashingStructure) Descriptor() ([]byte, []int)

func (*BlockDataHashingStructure) ProtoMessage

func (*BlockDataHashingStructure) ProtoMessage()

func (*BlockDataHashingStructure) Reset

func (m *BlockDataHashingStructure) Reset()

func (*BlockDataHashingStructure) String

func (m *BlockDataHashingStructure) String() string

type BlockHeader

type BlockHeader struct {
	Number       uint64 `protobuf:"varint,1,opt,name=Number" json:"Number,omitempty"`
	PreviousHash []byte `protobuf:"bytes,2,opt,name=PreviousHash,proto3" json:"PreviousHash,omitempty"`
	DataHash     []byte `protobuf:"bytes,3,opt,name=DataHash,proto3" json:"DataHash,omitempty"`
}

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

func (*BlockHeader) Bytes

func (b *BlockHeader) Bytes() []byte

Bytes returns the ASN.1 marshaled representation of the block header.

func (*BlockHeader) Descriptor

func (*BlockHeader) Descriptor() ([]byte, []int)

func (*BlockHeader) Hash

func (b *BlockHeader) Hash() []byte

Hash returns the hash of the block header. XXX This method will be removed shortly to allow for confgurable hashing algorithms

func (*BlockHeader) ProtoMessage

func (*BlockHeader) ProtoMessage()

func (*BlockHeader) Reset

func (m *BlockHeader) Reset()

func (*BlockHeader) String

func (m *BlockHeader) String() string

type BlockMetadata

type BlockMetadata struct {
	Metadata [][]byte `protobuf:"bytes,1,rep,name=Metadata,proto3" json:"Metadata,omitempty"`
}

func (*BlockMetadata) Descriptor

func (*BlockMetadata) Descriptor() ([]byte, []int)

func (*BlockMetadata) ProtoMessage

func (*BlockMetadata) ProtoMessage()

func (*BlockMetadata) Reset

func (m *BlockMetadata) Reset()

func (*BlockMetadata) String

func (m *BlockMetadata) String() string

type BlockMetadataIndex

type BlockMetadataIndex int32

This enum enlists indexes of the block metadata array

const (
	BlockMetadataIndex_SIGNATURES          BlockMetadataIndex = 0
	BlockMetadataIndex_LAST_CONFIGURATION  BlockMetadataIndex = 1
	BlockMetadataIndex_TRANSACTIONS_FILTER BlockMetadataIndex = 2
	BlockMetadataIndex_ORDERER             BlockMetadataIndex = 3
)

func (BlockMetadataIndex) EnumDescriptor

func (BlockMetadataIndex) EnumDescriptor() ([]byte, []int)

func (BlockMetadataIndex) String

func (x BlockMetadataIndex) String() string

type ChainHeader

type ChainHeader struct {
	Type int32 `protobuf:"varint,1,opt,name=type" json:"type,omitempty"`
	// Version indicates message protocol version
	Version int32 `protobuf:"varint,2,opt,name=version" json:"version,omitempty"`
	// Timestamp is the local time when the message was created
	// by the sender
	Timestamp *google_protobuf.Timestamp `protobuf:"bytes,3,opt,name=timestamp" json:"timestamp,omitempty"`
	// Identifier of the chain this message is bound for
	ChainID string `protobuf:"bytes,4,opt,name=chainID" json:"chainID,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=txID" json:"txID,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" 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"`
}

Header is a generic replay prevention and identity message to include in a signed payload

func (*ChainHeader) Descriptor

func (*ChainHeader) Descriptor() ([]byte, []int)

func (*ChainHeader) GetTimestamp

func (m *ChainHeader) GetTimestamp() *google_protobuf.Timestamp

func (*ChainHeader) ProtoMessage

func (*ChainHeader) ProtoMessage()

func (*ChainHeader) Reset

func (m *ChainHeader) Reset()

func (*ChainHeader) String

func (m *ChainHeader) String() string

type ConfigurationEnvelope

type ConfigurationEnvelope struct {
	Items []*SignedConfigurationItem `protobuf:"bytes,1,rep,name=Items" json:"Items,omitempty"`
}

ConfigurationEnvelope 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 highest configuration sequence number, store it and increment it by one
  3. Modify desired ConfigurationItems, setting each LastModified to the stored and incremented sequence number a) Note that the ConfigurationItem has a ChainHeader header attached to it, who's type is set to CONFIGURATION_ITEM
  4. Update SignedConfigurationItem with appropriate signatures over the modified ConfigurationItem a) Each signature is of type ConfigurationSignature b) The ConfigurationSignature signature is over the concatenation of signatureHeader and the ConfigurationItem bytes (which includes a ChainHeader)
  5. Submit new Configuration for ordering in Envelope signed by submitter a) The Envelope Payload has data set to the marshaled ConfigurationEnvelope b) The Envelope Payload has a header of type Header.Type.CONFIGURATION_TRANSACTION

The configuration manager will verify:

  1. All configuration items and the envelope refer to the correct chain
  2. Some configuration item has been added or modified
  3. No existing configuration item has been ommitted
  4. All configuration changes have a LastModification of one more than the last configuration's highest LastModification number
  5. All configuration changes satisfy the corresponding modification policy

func (*ConfigurationEnvelope) Descriptor

func (*ConfigurationEnvelope) Descriptor() ([]byte, []int)

func (*ConfigurationEnvelope) GetItems

func (*ConfigurationEnvelope) ProtoMessage

func (*ConfigurationEnvelope) ProtoMessage()

func (*ConfigurationEnvelope) Reset

func (m *ConfigurationEnvelope) Reset()

func (*ConfigurationEnvelope) String

func (m *ConfigurationEnvelope) String() string

type ConfigurationItem

type ConfigurationItem struct {
	Header             *ChainHeader                        `protobuf:"bytes,1,opt,name=Header" json:"Header,omitempty"`
	Type               ConfigurationItem_ConfigurationType `protobuf:"varint,2,opt,name=Type,enum=common.ConfigurationItem_ConfigurationType" json:"Type,omitempty"`
	LastModified       uint64                              `protobuf:"varint,3,opt,name=LastModified" json:"LastModified,omitempty"`
	ModificationPolicy string                              `protobuf:"bytes,4,opt,name=ModificationPolicy" json:"ModificationPolicy,omitempty"`
	Key                string                              `protobuf:"bytes,5,opt,name=Key" json:"Key,omitempty"`
	Value              []byte                              `protobuf:"bytes,6,opt,name=Value,proto3" json:"Value,omitempty"`
}

func (*ConfigurationItem) Descriptor

func (*ConfigurationItem) Descriptor() ([]byte, []int)

func (*ConfigurationItem) GetHeader

func (m *ConfigurationItem) GetHeader() *ChainHeader

func (*ConfigurationItem) ProtoMessage

func (*ConfigurationItem) ProtoMessage()

func (*ConfigurationItem) Reset

func (m *ConfigurationItem) Reset()

func (*ConfigurationItem) String

func (m *ConfigurationItem) String() string

type ConfigurationItem_ConfigurationType

type ConfigurationItem_ConfigurationType int32
const (
	ConfigurationItem_Policy  ConfigurationItem_ConfigurationType = 0
	ConfigurationItem_Chain   ConfigurationItem_ConfigurationType = 1
	ConfigurationItem_Orderer ConfigurationItem_ConfigurationType = 2
	ConfigurationItem_Peer    ConfigurationItem_ConfigurationType = 3
	ConfigurationItem_MSP     ConfigurationItem_ConfigurationType = 4
)

func (ConfigurationItem_ConfigurationType) EnumDescriptor

func (ConfigurationItem_ConfigurationType) EnumDescriptor() ([]byte, []int)

func (ConfigurationItem_ConfigurationType) String

type ConfigurationSignature

type ConfigurationSignature struct {
	SignatureHeader []byte `protobuf:"bytes,1,opt,name=signatureHeader,proto3" json:"signatureHeader,omitempty"`
	Signature       []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
}

func (*ConfigurationSignature) Descriptor

func (*ConfigurationSignature) Descriptor() ([]byte, []int)

func (*ConfigurationSignature) ProtoMessage

func (*ConfigurationSignature) ProtoMessage()

func (*ConfigurationSignature) Reset

func (m *ConfigurationSignature) Reset()

func (*ConfigurationSignature) String

func (m *ConfigurationSignature) String() string

type ConfigurationTemplate

type ConfigurationTemplate struct {
	Items []*ConfigurationItem `protobuf:"bytes,1,rep,name=Items" json:"Items,omitempty"`
}

ConfigurationTemplate is used as a serialization format to share configuration templates The orderer supplies a configuration template to the user to use when constructing a new chain creation transaction, so this is used to facilitate that.

func (*ConfigurationTemplate) Descriptor

func (*ConfigurationTemplate) Descriptor() ([]byte, []int)

func (*ConfigurationTemplate) GetItems

func (m *ConfigurationTemplate) GetItems() []*ConfigurationItem

func (*ConfigurationTemplate) ProtoMessage

func (*ConfigurationTemplate) ProtoMessage()

func (*ConfigurationTemplate) Reset

func (m *ConfigurationTemplate) Reset()

func (*ConfigurationTemplate) String

func (m *ConfigurationTemplate) String() string

type Envelope

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"`
}

Envelope wraps a Payload with a signature so that the message may be authenticated

func (*Envelope) AsSignedData

func (env *Envelope) AsSignedData() ([]*SignedData, error)

AsSignedData returns the signatures for the Envelope as SignedData slice of length 1 or an error indicating why this was not possible

func (*Envelope) Descriptor

func (*Envelope) Descriptor() ([]byte, []int)

func (*Envelope) ProtoMessage

func (*Envelope) ProtoMessage()

func (*Envelope) Reset

func (m *Envelope) Reset()

func (*Envelope) String

func (m *Envelope) String() string

type HashingAlgorithm

type HashingAlgorithm struct {
	// Currently supported algorithms are: SHAKE256
	Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
}

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

func (*HashingAlgorithm) Descriptor

func (*HashingAlgorithm) Descriptor() ([]byte, []int)

func (*HashingAlgorithm) ProtoMessage

func (*HashingAlgorithm) ProtoMessage()

func (*HashingAlgorithm) Reset

func (m *HashingAlgorithm) Reset()

func (*HashingAlgorithm) String

func (m *HashingAlgorithm) String() string
type Header struct {
	ChainHeader     *ChainHeader     `protobuf:"bytes,1,opt,name=chainHeader" json:"chainHeader,omitempty"`
	SignatureHeader *SignatureHeader `protobuf:"bytes,2,opt,name=signatureHeader" json:"signatureHeader,omitempty"`
}

func (*Header) Descriptor

func (*Header) Descriptor() ([]byte, []int)

func (*Header) GetChainHeader

func (m *Header) GetChainHeader() *ChainHeader

func (*Header) GetSignatureHeader

func (m *Header) GetSignatureHeader() *SignatureHeader

func (*Header) ProtoMessage

func (*Header) ProtoMessage()

func (*Header) Reset

func (m *Header) Reset()

func (*Header) String

func (m *Header) String() string

type HeaderType

type HeaderType int32
const (
	HeaderType_MESSAGE                   HeaderType = 0
	HeaderType_CONFIGURATION_TRANSACTION HeaderType = 1
	HeaderType_CONFIGURATION_ITEM        HeaderType = 2
	HeaderType_ENDORSER_TRANSACTION      HeaderType = 3
	HeaderType_ORDERER_TRANSACTION       HeaderType = 4
	HeaderType_DELIVER_SEEK_INFO         HeaderType = 5
)

func (HeaderType) EnumDescriptor

func (HeaderType) EnumDescriptor() ([]byte, []int)

func (HeaderType) String

func (x HeaderType) String() string

type LastConfiguration

type LastConfiguration struct {
	Index uint64 `protobuf:"varint,1,opt,name=index" json:"index,omitempty"`
}

LastConfiguration is the encoded value for the Metadata message which is encoded in the LAST_CONFIGURATION block metadata index

func (*LastConfiguration) Descriptor

func (*LastConfiguration) Descriptor() ([]byte, []int)

func (*LastConfiguration) ProtoMessage

func (*LastConfiguration) ProtoMessage()

func (*LastConfiguration) Reset

func (m *LastConfiguration) Reset()

func (*LastConfiguration) String

func (m *LastConfiguration) String() string

type MSPPrincipal

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 `` /* 133-byte string literal not displayed */
	// 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.
	Principal []byte `protobuf:"bytes,2,opt,name=Principal,proto3" json:"Principal,omitempty"`
}

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

func (*MSPPrincipal) Descriptor

func (*MSPPrincipal) Descriptor() ([]byte, []int)

func (*MSPPrincipal) ProtoMessage

func (*MSPPrincipal) ProtoMessage()

func (*MSPPrincipal) Reset

func (m *MSPPrincipal) Reset()

func (*MSPPrincipal) String

func (m *MSPPrincipal) String() string

type MSPPrincipal_Classification

type MSPPrincipal_Classification int32
const (
	MSPPrincipal_ByMSPRole MSPPrincipal_Classification = 0
	// one of a member of MSP network, and the one of an
	// administrator of an MSP network
	MSPPrincipal_ByOrganizationUnit MSPPrincipal_Classification = 1
	// groupping of entities, per MSP affiliation
	// E.g., this can well be represented by an MSP's
	// Organization unit
	MSPPrincipal_ByIdentity MSPPrincipal_Classification = 2
)

func (MSPPrincipal_Classification) EnumDescriptor

func (MSPPrincipal_Classification) EnumDescriptor() ([]byte, []int)

func (MSPPrincipal_Classification) String

type MSPRole

type MSPRole struct {
	// MSPIdentifier represents the identifier of the MSP this principal
	// refers to
	MSPIdentifier string `protobuf:"bytes,1,opt,name=MSPIdentifier" json:"MSPIdentifier,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,enum=common.MSPRole_MSPRoleType" json:"Role,omitempty"`
}

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.

func (*MSPRole) Descriptor

func (*MSPRole) Descriptor() ([]byte, []int)

func (*MSPRole) ProtoMessage

func (*MSPRole) ProtoMessage()

func (*MSPRole) Reset

func (m *MSPRole) Reset()

func (*MSPRole) String

func (m *MSPRole) String() string

type MSPRole_MSPRoleType

type MSPRole_MSPRoleType int32
const (
	MSPRole_Member MSPRole_MSPRoleType = 0
	MSPRole_Admin  MSPRole_MSPRoleType = 1
)

func (MSPRole_MSPRoleType) EnumDescriptor

func (MSPRole_MSPRoleType) EnumDescriptor() ([]byte, []int)

func (MSPRole_MSPRoleType) String

func (x MSPRole_MSPRoleType) String() string

type Metadata

type Metadata struct {
	Value      []byte               `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	Signatures []*MetadataSignature `protobuf:"bytes,2,rep,name=signatures" json:"signatures,omitempty"`
}

Metadata is a common structure to be used to encode block metadata

func (*Metadata) Descriptor

func (*Metadata) Descriptor() ([]byte, []int)

func (*Metadata) GetSignatures

func (m *Metadata) GetSignatures() []*MetadataSignature

func (*Metadata) ProtoMessage

func (*Metadata) ProtoMessage()

func (*Metadata) Reset

func (m *Metadata) Reset()

func (*Metadata) String

func (m *Metadata) String() string

type MetadataSignature

type MetadataSignature struct {
	SignatureHeader []byte `protobuf:"bytes,1,opt,name=signatureHeader,proto3" json:"signatureHeader,omitempty"`
	Signature       []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
}

func (*MetadataSignature) Descriptor

func (*MetadataSignature) Descriptor() ([]byte, []int)

func (*MetadataSignature) ProtoMessage

func (*MetadataSignature) ProtoMessage()

func (*MetadataSignature) Reset

func (m *MetadataSignature) Reset()

func (*MetadataSignature) String

func (m *MetadataSignature) String() string

type OrdererAddresses

type OrdererAddresses struct {
	Addresses []string `protobuf:"bytes,1,rep,name=addresses" json:"addresses,omitempty"`
}

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

func (*OrdererAddresses) Descriptor

func (*OrdererAddresses) Descriptor() ([]byte, []int)

func (*OrdererAddresses) ProtoMessage

func (*OrdererAddresses) ProtoMessage()

func (*OrdererAddresses) Reset

func (m *OrdererAddresses) Reset()

func (*OrdererAddresses) String

func (m *OrdererAddresses) String() string

type OrganizationUnit

type OrganizationUnit struct {
	// MSPIdentifier represents the identifier of the MSP this organization unit
	// refers to
	MSPIdentifier string `protobuf:"bytes,1,opt,name=MSPIdentifier" json:"MSPIdentifier,omitempty"`
	// OrganizationUnitIdentifier defines the organization unit under the
	// MSP identified with MSPIdentifier
	OrganizationUnitIdentifier string `protobuf:"bytes,2,opt,name=OrganizationUnitIdentifier" json:"OrganizationUnitIdentifier,omitempty"`
}

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.

func (*OrganizationUnit) Descriptor

func (*OrganizationUnit) Descriptor() ([]byte, []int)

func (*OrganizationUnit) ProtoMessage

func (*OrganizationUnit) ProtoMessage()

func (*OrganizationUnit) Reset

func (m *OrganizationUnit) Reset()

func (*OrganizationUnit) String

func (m *OrganizationUnit) String() string

type Payload

type Payload struct {
	// Header is included to provide identity and prevent replay
	Header *Header `protobuf:"bytes,1,opt,name=header" 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"`
}

Payload is the message contents (and header to allow for signing)

func (*Payload) Descriptor

func (*Payload) Descriptor() ([]byte, []int)

func (*Payload) GetHeader

func (m *Payload) GetHeader() *Header

func (*Payload) ProtoMessage

func (*Payload) ProtoMessage()

func (*Payload) Reset

func (m *Payload) Reset()

func (*Payload) String

func (m *Payload) String() string

type Policy

type Policy struct {
	Type   int32  `protobuf:"varint,1,opt,name=type" json:"type,omitempty"`
	Policy []byte `protobuf:"bytes,2,opt,name=policy,proto3" json:"policy,omitempty"`
}

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

func (*Policy) Descriptor

func (*Policy) Descriptor() ([]byte, []int)

func (*Policy) ProtoMessage

func (*Policy) ProtoMessage()

func (*Policy) Reset

func (m *Policy) Reset()

func (*Policy) String

func (m *Policy) String() string

type Policy_PolicyType

type Policy_PolicyType int32
const (
	Policy_UNKNOWN   Policy_PolicyType = 0
	Policy_SIGNATURE Policy_PolicyType = 1
	Policy_MSP       Policy_PolicyType = 2
)

func (Policy_PolicyType) EnumDescriptor

func (Policy_PolicyType) EnumDescriptor() ([]byte, []int)

func (Policy_PolicyType) String

func (x Policy_PolicyType) String() string

type Signable

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)
}

Signable types are those which can map their contents to a set of SignedData

type SignatureHeader

type SignatureHeader struct {
	// Creator of the message, specified as a certificate chain
	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"`
}

func (*SignatureHeader) Descriptor

func (*SignatureHeader) Descriptor() ([]byte, []int)

func (*SignatureHeader) ProtoMessage

func (*SignatureHeader) ProtoMessage()

func (*SignatureHeader) Reset

func (m *SignatureHeader) Reset()

func (*SignatureHeader) String

func (m *SignatureHeader) String() string

type SignaturePolicy

type SignaturePolicy struct {
	// Types that are valid to be assigned to Type:
	//	*SignaturePolicy_SignedBy
	//	*SignaturePolicy_From
	Type isSignaturePolicy_Type `protobuf_oneof:"Type"`
}

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

func (*SignaturePolicy) Descriptor

func (*SignaturePolicy) Descriptor() ([]byte, []int)

func (*SignaturePolicy) GetFrom

func (*SignaturePolicy) GetSignedBy

func (m *SignaturePolicy) GetSignedBy() int32

func (*SignaturePolicy) GetType

func (m *SignaturePolicy) GetType() isSignaturePolicy_Type

func (*SignaturePolicy) ProtoMessage

func (*SignaturePolicy) ProtoMessage()

func (*SignaturePolicy) Reset

func (m *SignaturePolicy) Reset()

func (*SignaturePolicy) String

func (m *SignaturePolicy) String() string

func (*SignaturePolicy) XXX_OneofFuncs

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{})

XXX_OneofFuncs is for the internal use of the proto package.

type SignaturePolicyEnvelope

type SignaturePolicyEnvelope struct {
	Version    int32            `protobuf:"varint,1,opt,name=Version" json:"Version,omitempty"`
	Policy     *SignaturePolicy `protobuf:"bytes,2,opt,name=Policy" json:"Policy,omitempty"`
	Identities []*MSPPrincipal  `protobuf:"bytes,3,rep,name=Identities" json:"Identities,omitempty"`
}

SignaturePolicyEnvelope wraps a SignaturePolicy and includes a version for future enhancements

func (*SignaturePolicyEnvelope) Descriptor

func (*SignaturePolicyEnvelope) Descriptor() ([]byte, []int)

func (*SignaturePolicyEnvelope) GetIdentities

func (m *SignaturePolicyEnvelope) GetIdentities() []*MSPPrincipal

func (*SignaturePolicyEnvelope) GetPolicy

func (m *SignaturePolicyEnvelope) GetPolicy() *SignaturePolicy

func (*SignaturePolicyEnvelope) ProtoMessage

func (*SignaturePolicyEnvelope) ProtoMessage()

func (*SignaturePolicyEnvelope) Reset

func (m *SignaturePolicyEnvelope) Reset()

func (*SignaturePolicyEnvelope) String

func (m *SignaturePolicyEnvelope) String() string

type SignaturePolicy_From

type SignaturePolicy_From struct {
	From *SignaturePolicy_NOutOf `protobuf:"bytes,2,opt,name=From,oneof"`
}

type SignaturePolicy_NOutOf

type SignaturePolicy_NOutOf struct {
	N        int32              `protobuf:"varint,1,opt,name=N" json:"N,omitempty"`
	Policies []*SignaturePolicy `protobuf:"bytes,2,rep,name=Policies" json:"Policies,omitempty"`
}

func (*SignaturePolicy_NOutOf) Descriptor

func (*SignaturePolicy_NOutOf) Descriptor() ([]byte, []int)

func (*SignaturePolicy_NOutOf) GetPolicies

func (m *SignaturePolicy_NOutOf) GetPolicies() []*SignaturePolicy

func (*SignaturePolicy_NOutOf) ProtoMessage

func (*SignaturePolicy_NOutOf) ProtoMessage()

func (*SignaturePolicy_NOutOf) Reset

func (m *SignaturePolicy_NOutOf) Reset()

func (*SignaturePolicy_NOutOf) String

func (m *SignaturePolicy_NOutOf) String() string

type SignaturePolicy_SignedBy

type SignaturePolicy_SignedBy struct {
	SignedBy int32 `protobuf:"varint,1,opt,name=SignedBy,oneof"`
}

type SignedConfigurationItem

type SignedConfigurationItem struct {
	ConfigurationItem []byte                    `protobuf:"bytes,1,opt,name=ConfigurationItem,proto3" json:"ConfigurationItem,omitempty"`
	Signatures        []*ConfigurationSignature `protobuf:"bytes,2,rep,name=Signatures" json:"Signatures,omitempty"`
}

This message may change slightly depending on the finalization of signature schemes for transactions

func (*SignedConfigurationItem) AsSignedData

func (sci *SignedConfigurationItem) AsSignedData() ([]*SignedData, error)

AsSignedData returns the set of signatures for the SignedCOnfigurationItem as SignedData or an error indicating why this was not possible

func (*SignedConfigurationItem) Descriptor

func (*SignedConfigurationItem) Descriptor() ([]byte, []int)

func (*SignedConfigurationItem) GetSignatures

func (m *SignedConfigurationItem) GetSignatures() []*ConfigurationSignature

func (*SignedConfigurationItem) ProtoMessage

func (*SignedConfigurationItem) ProtoMessage()

func (*SignedConfigurationItem) Reset

func (m *SignedConfigurationItem) Reset()

func (*SignedConfigurationItem) String

func (m *SignedConfigurationItem) String() string

type SignedData

type SignedData struct {
	Data      []byte
	Identity  []byte
	Signature []byte
}

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 Status

type Status int32

These status codes are intended to resemble selected HTTP status codes

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_SERVICE_UNAVAILABLE      Status = 503
)

func (Status) EnumDescriptor

func (Status) EnumDescriptor() ([]byte, []int)

func (Status) String

func (x Status) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL