Documentation
¶
Index ¶
- Variables
- func BlockFromProto(block *Block) *hotstuff.Block
- func PartialCertFromProto(cert *PartialCert) *ecdsa.PartialCert
- func QuorumCertFromProto(qc *QuorumCert) *ecdsa.QuorumCert
- func RegisterHotstuffServer(srv *gorums.Server, impl Hotstuff)
- func SignatureFromProto(sig *Signature) *ecdsa.Signature
- type Block
- func (*Block) Descriptor() ([]byte, []int)deprecated
- func (x *Block) GetCommand() []byte
- func (x *Block) GetParent() []byte
- func (x *Block) GetProposer() uint32
- func (x *Block) GetQC() *QuorumCert
- func (x *Block) GetView() uint64
- func (*Block) ProtoMessage()
- func (x *Block) ProtoReflect() protoreflect.Message
- func (x *Block) Reset()
- func (x *Block) String() string
- type BlockHash
- type Configuration
- type Hotstuff
- type Manager
- type NewViewMsg
- type Node
- type PartialCert
- func (*PartialCert) Descriptor() ([]byte, []int)deprecated
- func (x *PartialCert) GetHash() []byte
- func (x *PartialCert) GetSig() *Signature
- func (*PartialCert) ProtoMessage()
- func (x *PartialCert) ProtoReflect() protoreflect.Message
- func (x *PartialCert) Reset()
- func (x *PartialCert) String() string
- type QuorumCert
- func (*QuorumCert) Descriptor() ([]byte, []int)deprecated
- func (x *QuorumCert) GetHash() []byte
- func (x *QuorumCert) GetSigs() map[uint32]*Signature
- func (*QuorumCert) ProtoMessage()
- func (x *QuorumCert) ProtoReflect() protoreflect.Message
- func (x *QuorumCert) Reset()
- func (x *QuorumCert) String() string
- type QuorumSpec
- type Signature
- func (*Signature) Descriptor() ([]byte, []int)deprecated
- func (x *Signature) GetR() []byte
- func (x *Signature) GetReplicaID() uint32
- func (x *Signature) GetS() []byte
- func (*Signature) ProtoMessage()
- func (x *Signature) ProtoReflect() protoreflect.Message
- func (x *Signature) Reset()
- func (x *Signature) String() string
Constants ¶
This section is empty.
Variables ¶
var File_internal_proto_hotstuff_proto protoreflect.FileDescriptor
Functions ¶
func BlockFromProto ¶ added in v0.2.0
BlockFromProto converts a proto.Block to a hotstuff.Block.
func PartialCertFromProto ¶ added in v0.2.0
func PartialCertFromProto(cert *PartialCert) *ecdsa.PartialCert
PartialCertFromProto converts a proto.PartialCert to an ecdsa.PartialCert.
func QuorumCertFromProto ¶ added in v0.2.0
func QuorumCertFromProto(qc *QuorumCert) *ecdsa.QuorumCert
QuorumCertFromProto converts a proto.QuorumCert to an ecdsa.QuorumCert.
func RegisterHotstuffServer ¶ added in v0.2.0
func SignatureFromProto ¶ added in v0.2.0
SignatureFromProto converts a proto.Signature to an 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 ¶
BlockToProto converts a hotstuff.Block to a proto.Block.
func (*Block) Descriptor
deprecated
func (*Block) GetCommand ¶ added in v0.2.0
func (*Block) GetProposer ¶ added in v0.2.0
func (*Block) GetQC ¶
func (x *Block) GetQC() *QuorumCert
func (*Block) ProtoMessage ¶
func (*Block) ProtoMessage()
func (*Block) ProtoReflect ¶
func (x *Block) ProtoReflect() protoreflect.Message
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) ProtoMessage ¶ added in v0.2.0
func (*BlockHash) ProtoMessage()
func (*BlockHash) ProtoReflect ¶ added in v0.2.0
func (x *BlockHash) ProtoReflect() protoreflect.Message
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 (*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 ¶
Manager maintains a connection pool of nodes on which quorum calls can be performed.
func NewManager ¶
func NewManager(opts ...gorums.ManagerOption) (mgr *Manager)
NewManager returns a new Manager for managing connection to nodes added to the manager. This function accepts manager options used to configure various aspects of the manager.
func (*Manager) NewConfiguration ¶
func (m *Manager) NewConfiguration(qspec QuorumSpec, opts ...gorums.ConfigOption) (c *Configuration, err error)
NewConfiguration returns a configuration based on the provided list of nodes. Nodes can be supplied using WithNodeMap or WithNodeList or WithNodeIDs.
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 ¶
func (*Node) Deliver ¶ added in v0.2.0
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
PartialCertToProto converts a hotstuff.PartialCert to a proto.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
QuorumCertToProto converts a hotstuff.QuorumCert to a proto.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
SignatureToProto converts a hotstuff.Signature to a proto.Signature.
func (*Signature) Descriptor
deprecated
added in
v0.2.0
func (*Signature) GetReplicaID ¶ added in v0.2.0
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