etcdraft

package
v1.4.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const TypeKey = "etcdraft"

TypeKey is the string with which this consensus implementation is identified across Fabric.

Variables

This section is empty.

Functions

func Marshal

func Marshal(md *Metadata) ([]byte, error)

Marshal serializes this implementation's proto messages. It is called by the encoder package during the creation of the Orderer ConfigGroup.

Types

type ConsensusTypeMetadataFactory

type ConsensusTypeMetadataFactory struct{}

ConsensusTypeMetadataFactory allows this implementation's proto messages to register their type with the orderer's proto messages. This is needed for protolator to work.

func (ConsensusTypeMetadataFactory) NewMessage

func (dogf ConsensusTypeMetadataFactory) NewMessage() proto.Message

NewMessage implements the Orderer.ConsensusTypeMetadataFactory interface.

type Consenter

type Consenter struct {
	Host                 string   `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
	Port                 uint32   `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"`
	ClientTlsCert        []byte   `protobuf:"bytes,3,opt,name=client_tls_cert,json=clientTlsCert,proto3" json:"client_tls_cert,omitempty"`
	ServerTlsCert        []byte   `protobuf:"bytes,4,opt,name=server_tls_cert,json=serverTlsCert,proto3" json:"server_tls_cert,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Consenter represents a consenting node (i.e. replica).

func (*Consenter) Descriptor

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

func (*Consenter) GetClientTlsCert

func (m *Consenter) GetClientTlsCert() []byte

func (*Consenter) GetHost

func (m *Consenter) GetHost() string

func (*Consenter) GetPort

func (m *Consenter) GetPort() uint32

func (*Consenter) GetServerTlsCert

func (m *Consenter) GetServerTlsCert() []byte

func (*Consenter) ProtoMessage

func (*Consenter) ProtoMessage()

func (*Consenter) Reset

func (m *Consenter) Reset()

func (*Consenter) String

func (m *Consenter) String() string

func (*Consenter) XXX_DiscardUnknown

func (m *Consenter) XXX_DiscardUnknown()

func (*Consenter) XXX_Marshal

func (m *Consenter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Consenter) XXX_Merge

func (dst *Consenter) XXX_Merge(src proto.Message)

func (*Consenter) XXX_Size

func (m *Consenter) XXX_Size() int

func (*Consenter) XXX_Unmarshal

func (m *Consenter) XXX_Unmarshal(b []byte) error

type Metadata

type Metadata struct {
	Consenters           []*Consenter `protobuf:"bytes,1,rep,name=consenters,proto3" json:"consenters,omitempty"`
	Options              *Options     `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

Metadata is serialized and set as the value of ConsensusType.Metadata in a channel configuration when the ConsensusType.Type is set "etcdraft".

func (*Metadata) Descriptor

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

func (*Metadata) GetConsenters

func (m *Metadata) GetConsenters() []*Consenter

func (*Metadata) GetOptions

func (m *Metadata) GetOptions() *Options

func (*Metadata) ProtoMessage

func (*Metadata) ProtoMessage()

func (*Metadata) Reset

func (m *Metadata) Reset()

func (*Metadata) String

func (m *Metadata) String() string

func (*Metadata) XXX_DiscardUnknown

func (m *Metadata) XXX_DiscardUnknown()

func (*Metadata) XXX_Marshal

func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Metadata) XXX_Merge

func (dst *Metadata) XXX_Merge(src proto.Message)

func (*Metadata) XXX_Size

func (m *Metadata) XXX_Size() int

func (*Metadata) XXX_Unmarshal

func (m *Metadata) XXX_Unmarshal(b []byte) error

type Options added in v1.4.1

type Options struct {
	TickInterval         uint64   `protobuf:"varint,1,opt,name=tick_interval,json=tickInterval,proto3" json:"tick_interval,omitempty"`
	ElectionTick         uint32   `protobuf:"varint,2,opt,name=election_tick,json=electionTick,proto3" json:"election_tick,omitempty"`
	HeartbeatTick        uint32   `protobuf:"varint,3,opt,name=heartbeat_tick,json=heartbeatTick,proto3" json:"heartbeat_tick,omitempty"`
	MaxInflightMsgs      uint32   `protobuf:"varint,4,opt,name=max_inflight_msgs,json=maxInflightMsgs,proto3" json:"max_inflight_msgs,omitempty"`
	MaxSizePerMsg        uint64   `protobuf:"varint,5,opt,name=max_size_per_msg,json=maxSizePerMsg,proto3" json:"max_size_per_msg,omitempty"`
	SnapshotInterval     uint64   `protobuf:"varint,6,opt,name=snapshot_interval,json=snapshotInterval,proto3" json:"snapshot_interval,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Options to be specified for all the etcd/raft nodes. These can be modified on a per-channel basis.

func (*Options) Descriptor added in v1.4.1

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

func (*Options) GetElectionTick added in v1.4.1

func (m *Options) GetElectionTick() uint32

func (*Options) GetHeartbeatTick added in v1.4.1

func (m *Options) GetHeartbeatTick() uint32

func (*Options) GetMaxInflightMsgs

func (m *Options) GetMaxInflightMsgs() uint32

func (*Options) GetMaxSizePerMsg

func (m *Options) GetMaxSizePerMsg() uint64

func (*Options) GetSnapshotInterval

func (m *Options) GetSnapshotInterval() uint64

func (*Options) GetTickInterval added in v1.4.1

func (m *Options) GetTickInterval() uint64

func (*Options) ProtoMessage added in v1.4.1

func (*Options) ProtoMessage()

func (*Options) Reset added in v1.4.1

func (m *Options) Reset()

func (*Options) String added in v1.4.1

func (m *Options) String() string

func (*Options) XXX_DiscardUnknown added in v1.4.1

func (m *Options) XXX_DiscardUnknown()

func (*Options) XXX_Marshal added in v1.4.1

func (m *Options) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Options) XXX_Merge added in v1.4.1

func (dst *Options) XXX_Merge(src proto.Message)

func (*Options) XXX_Size added in v1.4.1

func (m *Options) XXX_Size() int

func (*Options) XXX_Unmarshal added in v1.4.1

func (m *Options) XXX_Unmarshal(b []byte) error

type RaftMetadata

type RaftMetadata struct {
	// Maintains a mapping between the cluster's OSNs
	// and their Raft IDs.
	Consenters map[uint64]*Consenter `` /* 162-byte string literal not displayed */
	// Carries the Raft ID value that will be assigned
	// to the next OSN that will join this cluster.
	NextConsenterId uint64 `protobuf:"varint,2,opt,name=next_consenter_id,json=nextConsenterId,proto3" json:"next_consenter_id,omitempty"`
	// Raft cluster configurations count
	ConfChangeCounts uint64 `protobuf:"varint,3,opt,name=conf_change_counts,json=confChangeCounts,proto3" json:"conf_change_counts,omitempty"`
	// Index of etcd/raft entry for current block.
	RaftIndex            uint64   `protobuf:"varint,4,opt,name=raft_index,json=raftIndex,proto3" json:"raft_index,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

RaftMetadata stores data used by the Raft OSNs when coordinating with each other, to be serialized into block meta dta field and used after failres and restarts.

func (*RaftMetadata) Descriptor

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

func (*RaftMetadata) GetConfChangeCounts

func (m *RaftMetadata) GetConfChangeCounts() uint64

func (*RaftMetadata) GetConsenters

func (m *RaftMetadata) GetConsenters() map[uint64]*Consenter

func (*RaftMetadata) GetNextConsenterId

func (m *RaftMetadata) GetNextConsenterId() uint64

func (*RaftMetadata) GetRaftIndex

func (m *RaftMetadata) GetRaftIndex() uint64

func (*RaftMetadata) ProtoMessage

func (*RaftMetadata) ProtoMessage()

func (*RaftMetadata) Reset

func (m *RaftMetadata) Reset()

func (*RaftMetadata) String

func (m *RaftMetadata) String() string

func (*RaftMetadata) XXX_DiscardUnknown

func (m *RaftMetadata) XXX_DiscardUnknown()

func (*RaftMetadata) XXX_Marshal

func (m *RaftMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RaftMetadata) XXX_Merge

func (dst *RaftMetadata) XXX_Merge(src proto.Message)

func (*RaftMetadata) XXX_Size

func (m *RaftMetadata) XXX_Size() int

func (*RaftMetadata) XXX_Unmarshal

func (m *RaftMetadata) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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