proto

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_internal_proto_hotstuff_proto protoreflect.FileDescriptor

Functions

func BlockFromProto added in v0.2.0

func BlockFromProto(block *Block) *hotstuff.Block

func PartialCertFromProto added in v0.2.0

func PartialCertFromProto(cert *PartialCert) *ecdsa.PartialCert

func QuorumCertFromProto added in v0.2.0

func QuorumCertFromProto(qc *QuorumCert) *ecdsa.QuorumCert

func RegisterHotstuffServer added in v0.2.0

func RegisterHotstuffServer(srv *gorums.Server, impl Hotstuff)

func SignatureFromProto added in v0.2.0

func SignatureFromProto(sig *Signature) *ecdsa.Signature

Types

type Block

type Block struct {
	Parent   []byte      `protobuf:"bytes,1,opt,name=Parent,proto3" json:"Parent,omitempty"`
	QC       *QuorumCert `protobuf:"bytes,2,opt,name=QC,proto3" json:"QC,omitempty"`
	View     uint64      `protobuf:"varint,3,opt,name=View,proto3" json:"View,omitempty"`
	Command  []byte      `protobuf:"bytes,4,opt,name=Command,proto3" json:"Command,omitempty"`
	Proposer uint32      `protobuf:"varint,5,opt,name=Proposer,proto3" json:"Proposer,omitempty"`
	// contains filtered or unexported fields
}

func BlockToProto

func BlockToProto(block *hotstuff.Block) *Block

func (*Block) Descriptor deprecated

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

Deprecated: Use Block.ProtoReflect.Descriptor instead.

func (*Block) GetCommand added in v0.2.0

func (x *Block) GetCommand() []byte

func (*Block) GetParent added in v0.2.0

func (x *Block) GetParent() []byte

func (*Block) GetProposer added in v0.2.0

func (x *Block) GetProposer() uint32

func (*Block) GetQC

func (x *Block) GetQC() *QuorumCert

func (*Block) GetView added in v0.2.0

func (x *Block) GetView() uint64

func (*Block) ProtoMessage

func (*Block) ProtoMessage()

func (*Block) ProtoReflect

func (x *Block) ProtoReflect() protoreflect.Message

func (*Block) Reset

func (x *Block) Reset()

func (*Block) String

func (x *Block) String() string

type BlockHash added in v0.2.0

type BlockHash struct {
	Hash []byte `protobuf:"bytes,1,opt,name=Hash,proto3" json:"Hash,omitempty"`
	// contains filtered or unexported fields
}

func (*BlockHash) Descriptor deprecated added in v0.2.0

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

Deprecated: Use BlockHash.ProtoReflect.Descriptor instead.

func (*BlockHash) GetHash added in v0.2.0

func (x *BlockHash) GetHash() []byte

func (*BlockHash) ProtoMessage added in v0.2.0

func (*BlockHash) ProtoMessage()

func (*BlockHash) ProtoReflect added in v0.2.0

func (x *BlockHash) ProtoReflect() protoreflect.Message

func (*BlockHash) Reset added in v0.2.0

func (x *BlockHash) Reset()

func (*BlockHash) String added in v0.2.0

func (x *BlockHash) String() string

type Configuration

type Configuration struct {
	gorums.Configuration
	// contains filtered or unexported fields
}

A Configuration represents a static set of nodes on which quorum remote procedure calls may be invoked.

func NewConfig

func NewConfig(qspec QuorumSpec, opts ...gorums.ManagerOption) (*Configuration, func(), error)

NewConfig returns a configuration for the given node addresses and quorum spec. The returned func() must be called to close the underlying connections. This is an experimental API.

func (*Configuration) Fetch added in v0.2.0

func (c *Configuration) Fetch(ctx context.Context, in *BlockHash, opts ...gorums.CallOption)

Fetch is a quorum call invoked on all nodes in configuration c, with the same argument in, and returns a combined result.

func (*Configuration) Nodes

func (c *Configuration) Nodes() []*Node

Nodes returns a slice of each available node. IDs are returned in the same order as they were provided in the creation of the Manager.

func (*Configuration) Propose

func (c *Configuration) Propose(ctx context.Context, in *Block, opts ...gorums.CallOption)

Propose is a quorum call invoked on all nodes in configuration c, with the same argument in, and returns a combined result.

type Hotstuff

type Hotstuff interface {
	Propose(context.Context, *Block)
	Vote(context.Context, *PartialCert)
	NewView(context.Context, *NewViewMsg)
	Fetch(context.Context, *BlockHash)
	Deliver(context.Context, *Block)
}

Hotstuff is the server-side API for the Hotstuff Service

type Manager

type Manager struct {
	*gorums.Manager
}

func NewManager

func NewManager(opts ...gorums.ManagerOption) (mgr *Manager, err error)

func (*Manager) NewConfiguration

func (m *Manager) NewConfiguration(ids []uint32, qspec QuorumSpec) (c *Configuration, err error)

func (*Manager) Nodes

func (m *Manager) Nodes() []*Node

Nodes returns a slice of available nodes on this manager. IDs are returned in the order they were added at creation of the manager.

type NewViewMsg added in v0.2.0

type NewViewMsg struct {
	View uint64      `protobuf:"varint,1,opt,name=View,proto3" json:"View,omitempty"`
	QC   *QuorumCert `protobuf:"bytes,2,opt,name=QC,proto3" json:"QC,omitempty"`
	// contains filtered or unexported fields
}

func (*NewViewMsg) Descriptor deprecated added in v0.2.0

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

Deprecated: Use NewViewMsg.ProtoReflect.Descriptor instead.

func (*NewViewMsg) GetQC added in v0.2.0

func (x *NewViewMsg) GetQC() *QuorumCert

func (*NewViewMsg) GetView added in v0.2.0

func (x *NewViewMsg) GetView() uint64

func (*NewViewMsg) ProtoMessage added in v0.2.0

func (*NewViewMsg) ProtoMessage()

func (*NewViewMsg) ProtoReflect added in v0.2.0

func (x *NewViewMsg) ProtoReflect() protoreflect.Message

func (*NewViewMsg) Reset added in v0.2.0

func (x *NewViewMsg) Reset()

func (*NewViewMsg) String added in v0.2.0

func (x *NewViewMsg) String() string

type Node

type Node struct {
	*gorums.Node
}

func (*Node) Deliver added in v0.2.0

func (n *Node) Deliver(ctx context.Context, in *Block, opts ...gorums.CallOption)

Deliver is a quorum call invoked on all nodes in configuration c, with the same argument in, and returns a combined result.

func (*Node) NewView

func (n *Node) NewView(ctx context.Context, in *NewViewMsg, opts ...gorums.CallOption)

NewView is a quorum call invoked on all nodes in configuration c, with the same argument in, and returns a combined result.

func (*Node) Vote

func (n *Node) Vote(ctx context.Context, in *PartialCert, opts ...gorums.CallOption)

Vote is a quorum call invoked on all nodes in configuration c, with the same argument in, and returns a combined result.

type PartialCert

type PartialCert struct {
	Sig  *Signature `protobuf:"bytes,1,opt,name=Sig,proto3" json:"Sig,omitempty"`
	Hash []byte     `protobuf:"bytes,2,opt,name=Hash,proto3" json:"Hash,omitempty"`
	// contains filtered or unexported fields
}

func PartialCertToProto

func PartialCertToProto(cert hotstuff.PartialCert) *PartialCert

func (*PartialCert) Descriptor deprecated

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

Deprecated: Use PartialCert.ProtoReflect.Descriptor instead.

func (*PartialCert) GetHash

func (x *PartialCert) GetHash() []byte

func (*PartialCert) GetSig

func (x *PartialCert) GetSig() *Signature

func (*PartialCert) ProtoMessage

func (*PartialCert) ProtoMessage()

func (*PartialCert) ProtoReflect

func (x *PartialCert) ProtoReflect() protoreflect.Message

func (*PartialCert) Reset

func (x *PartialCert) Reset()

func (*PartialCert) String

func (x *PartialCert) String() string

type QuorumCert

type QuorumCert struct {
	Sigs map[uint32]*Signature `` /* 150-byte string literal not displayed */
	Hash []byte                `protobuf:"bytes,2,opt,name=Hash,proto3" json:"Hash,omitempty"`
	// contains filtered or unexported fields
}

func QuorumCertToProto

func QuorumCertToProto(qc hotstuff.QuorumCert) *QuorumCert

func (*QuorumCert) Descriptor deprecated

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

Deprecated: Use QuorumCert.ProtoReflect.Descriptor instead.

func (*QuorumCert) GetHash

func (x *QuorumCert) GetHash() []byte

func (*QuorumCert) GetSigs

func (x *QuorumCert) GetSigs() map[uint32]*Signature

func (*QuorumCert) ProtoMessage

func (*QuorumCert) ProtoMessage()

func (*QuorumCert) ProtoReflect

func (x *QuorumCert) ProtoReflect() protoreflect.Message

func (*QuorumCert) Reset

func (x *QuorumCert) Reset()

func (*QuorumCert) String

func (x *QuorumCert) String() string

type QuorumSpec

type QuorumSpec interface {
}

QuorumSpec is the interface of quorum functions for Hotstuff.

type Signature added in v0.2.0

type Signature struct {
	ReplicaID uint32 `protobuf:"varint,1,opt,name=ReplicaID,proto3" json:"ReplicaID,omitempty"`
	R         []byte `protobuf:"bytes,2,opt,name=R,proto3" json:"R,omitempty"`
	S         []byte `protobuf:"bytes,3,opt,name=S,proto3" json:"S,omitempty"`
	// contains filtered or unexported fields
}

func SignatureToProto added in v0.2.0

func SignatureToProto(sig hotstuff.Signature) *Signature

func (*Signature) Descriptor deprecated added in v0.2.0

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

Deprecated: Use Signature.ProtoReflect.Descriptor instead.

func (*Signature) GetR added in v0.2.0

func (x *Signature) GetR() []byte

func (*Signature) GetReplicaID added in v0.2.0

func (x *Signature) GetReplicaID() uint32

func (*Signature) GetS added in v0.2.0

func (x *Signature) GetS() []byte

func (*Signature) ProtoMessage added in v0.2.0

func (*Signature) ProtoMessage()

func (*Signature) ProtoReflect added in v0.2.0

func (x *Signature) ProtoReflect() protoreflect.Message

func (*Signature) Reset added in v0.2.0

func (x *Signature) Reset()

func (*Signature) String added in v0.2.0

func (x *Signature) String() string

Jump to

Keyboard shortcuts

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