Documentation ¶
Overview ¶
Package simplebft is a generated protocol buffer package.
It is generated from these files:
simplebft/simplebft.proto
It has these top-level messages:
Config MultiChainMsg Msg Request SeqView BatchHeader Batch Preprepare Subject ViewChange Signed NewView Checkpoint Hello
Index ¶
- type Batch
- type BatchHeader
- type Canceller
- type Checkpoint
- type Config
- type Hello
- type Msg
- func (*Msg) Descriptor() ([]byte, []int)
- func (m *Msg) GetCheckpoint() *Checkpoint
- func (m *Msg) GetCommit() *Subject
- func (m *Msg) GetHello() *Hello
- func (m *Msg) GetNewView() *NewView
- func (m *Msg) GetPrepare() *Subject
- func (m *Msg) GetPreprepare() *Preprepare
- func (m *Msg) GetRequest() *Request
- func (m *Msg) GetType() isMsg_Type
- func (m *Msg) GetViewChange() *Signed
- func (*Msg) ProtoMessage()
- func (m *Msg) Reset()
- func (m *Msg) String() string
- func (*Msg) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- type Msg_Checkpoint
- type Msg_Commit
- type Msg_Hello
- type Msg_NewView
- type Msg_Prepare
- type Msg_Preprepare
- type Msg_Request
- type Msg_ViewChange
- type MultiChainMsg
- type NewView
- type Preprepare
- type Receiver
- type Request
- type SBFT
- type SeqView
- type Signed
- type Subject
- type System
- type ViewChange
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batch ¶
type Batch struct { Header []byte `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` Payloads [][]byte `protobuf:"bytes,2,rep,name=payloads,proto3" json:"payloads,omitempty"` Signatures map[uint64][]byte `` /* 148-byte string literal not displayed */ }
func (*Batch) DecodeHeader ¶
func (b *Batch) DecodeHeader() *BatchHeader
func (*Batch) Descriptor ¶
func (*Batch) GetSignatures ¶
func (*Batch) ProtoMessage ¶
func (*Batch) ProtoMessage()
type BatchHeader ¶
type BatchHeader struct { Seq uint64 `protobuf:"varint,1,opt,name=seq" json:"seq,omitempty"` PrevHash []byte `protobuf:"bytes,2,opt,name=prev_hash,json=prevHash,proto3" json:"prev_hash,omitempty"` DataHash []byte `protobuf:"bytes,3,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"` }
func (*BatchHeader) Descriptor ¶
func (*BatchHeader) Descriptor() ([]byte, []int)
func (*BatchHeader) ProtoMessage ¶
func (*BatchHeader) ProtoMessage()
func (*BatchHeader) Reset ¶
func (m *BatchHeader) Reset()
func (*BatchHeader) String ¶
func (m *BatchHeader) String() string
type Canceller ¶
type Canceller interface {
Cancel()
}
Canceller allows cancelling of a scheduled timer event.
type Checkpoint ¶
type Checkpoint struct { Seq uint64 `protobuf:"varint,1,opt,name=seq" json:"seq,omitempty"` Digest []byte `protobuf:"bytes,2,opt,name=digest,proto3" json:"digest,omitempty"` Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` }
func (*Checkpoint) Descriptor ¶
func (*Checkpoint) Descriptor() ([]byte, []int)
func (*Checkpoint) ProtoMessage ¶
func (*Checkpoint) ProtoMessage()
func (*Checkpoint) Reset ¶
func (m *Checkpoint) Reset()
func (*Checkpoint) String ¶
func (m *Checkpoint) String() string
type Config ¶
type Config struct { N uint64 `protobuf:"varint,1,opt,name=n" json:"n,omitempty"` F uint64 `protobuf:"varint,2,opt,name=f" json:"f,omitempty"` BatchDurationNsec uint64 `protobuf:"varint,3,opt,name=batch_duration_nsec,json=batchDurationNsec" json:"batch_duration_nsec,omitempty"` BatchSizeBytes uint64 `protobuf:"varint,4,opt,name=batch_size_bytes,json=batchSizeBytes" json:"batch_size_bytes,omitempty"` RequestTimeoutNsec uint64 `protobuf:"varint,5,opt,name=request_timeout_nsec,json=requestTimeoutNsec" json:"request_timeout_nsec,omitempty"` }
func (*Config) Descriptor ¶
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
type Hello ¶
type Hello struct { Batch *Batch `protobuf:"bytes,1,opt,name=batch" json:"batch,omitempty"` NewView *NewView `protobuf:"bytes,2,opt,name=new_view,json=newView" json:"new_view,omitempty"` }
func (*Hello) Descriptor ¶
func (*Hello) GetNewView ¶
func (*Hello) ProtoMessage ¶
func (*Hello) ProtoMessage()
type Msg ¶
type Msg struct { // Types that are valid to be assigned to Type: // *Msg_Request // *Msg_Preprepare // *Msg_Prepare // *Msg_Commit // *Msg_ViewChange // *Msg_NewView // *Msg_Checkpoint // *Msg_Hello Type isMsg_Type `protobuf_oneof:"type"` }
func (*Msg) Descriptor ¶
func (*Msg) GetCheckpoint ¶
func (m *Msg) GetCheckpoint() *Checkpoint
func (*Msg) GetNewView ¶
func (*Msg) GetPrepare ¶
func (*Msg) GetPreprepare ¶
func (m *Msg) GetPreprepare() *Preprepare
func (*Msg) GetRequest ¶
func (*Msg) GetViewChange ¶
func (*Msg) ProtoMessage ¶
func (*Msg) ProtoMessage()
type Msg_Checkpoint ¶
type Msg_Checkpoint struct {
Checkpoint *Checkpoint `protobuf:"bytes,7,opt,name=checkpoint,oneof"`
}
type Msg_Commit ¶
type Msg_Commit struct {
Commit *Subject `protobuf:"bytes,4,opt,name=commit,oneof"`
}
type Msg_NewView ¶
type Msg_NewView struct {
NewView *NewView `protobuf:"bytes,6,opt,name=new_view,json=newView,oneof"`
}
type Msg_Prepare ¶
type Msg_Prepare struct {
Prepare *Subject `protobuf:"bytes,3,opt,name=prepare,oneof"`
}
type Msg_Preprepare ¶
type Msg_Preprepare struct {
Preprepare *Preprepare `protobuf:"bytes,2,opt,name=preprepare,oneof"`
}
type Msg_Request ¶
type Msg_Request struct {
Request *Request `protobuf:"bytes,1,opt,name=request,oneof"`
}
type Msg_ViewChange ¶
type Msg_ViewChange struct {
ViewChange *Signed `protobuf:"bytes,5,opt,name=view_change,json=viewChange,oneof"`
}
type MultiChainMsg ¶
type MultiChainMsg struct { ChainID string `protobuf:"bytes,1,opt,name=chainID" json:"chainID,omitempty"` Msg *Msg `protobuf:"bytes,2,opt,name=msg" json:"msg,omitempty"` }
func (*MultiChainMsg) Descriptor ¶
func (*MultiChainMsg) Descriptor() ([]byte, []int)
func (*MultiChainMsg) GetMsg ¶
func (m *MultiChainMsg) GetMsg() *Msg
func (*MultiChainMsg) ProtoMessage ¶
func (*MultiChainMsg) ProtoMessage()
func (*MultiChainMsg) Reset ¶
func (m *MultiChainMsg) Reset()
func (*MultiChainMsg) String ¶
func (m *MultiChainMsg) String() string
type NewView ¶
type NewView struct { View uint64 `protobuf:"varint,1,opt,name=view" json:"view,omitempty"` Vset map[uint64]*Signed `` /* 129-byte string literal not displayed */ Xset *Subject `protobuf:"bytes,3,opt,name=xset" json:"xset,omitempty"` Batch *Batch `protobuf:"bytes,4,opt,name=batch" json:"batch,omitempty"` }
func (*NewView) Descriptor ¶
func (*NewView) ProtoMessage ¶
func (*NewView) ProtoMessage()
type Preprepare ¶
type Preprepare struct { Seq *SeqView `protobuf:"bytes,1,opt,name=seq" json:"seq,omitempty"` Batch *Batch `protobuf:"bytes,2,opt,name=batch" json:"batch,omitempty"` }
func (*Preprepare) Descriptor ¶
func (*Preprepare) Descriptor() ([]byte, []int)
func (*Preprepare) GetBatch ¶
func (m *Preprepare) GetBatch() *Batch
func (*Preprepare) GetSeq ¶
func (m *Preprepare) GetSeq() *SeqView
func (*Preprepare) ProtoMessage ¶
func (*Preprepare) ProtoMessage()
func (*Preprepare) Reset ¶
func (m *Preprepare) Reset()
func (*Preprepare) String ¶
func (m *Preprepare) String() string
type Receiver ¶
type Receiver interface { Receive(msg *Msg, src uint64) Request(req []byte) Connection(replica uint64) GetChainId() string }
Receiver defines the API that is exposed by SBFT to the system.
type Request ¶
type Request struct {
Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
}
func (*Request) Descriptor ¶
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
type SBFT ¶
type SBFT struct {
// contains filtered or unexported fields
}
SBFT is a simplified PBFT implementation.
func (*SBFT) Connection ¶
Connection is an event from system to notify a new connection with replica. On connection, we send our latest (weak) checkpoint, and we expect to receive one from replica.
func (*SBFT) GetChainId ¶
type SeqView ¶
type SeqView struct { View uint64 `protobuf:"varint,1,opt,name=view" json:"view,omitempty"` Seq uint64 `protobuf:"varint,2,opt,name=seq" json:"seq,omitempty"` }
func (*SeqView) Descriptor ¶
func (*SeqView) ProtoMessage ¶
func (*SeqView) ProtoMessage()
type Signed ¶
type Signed struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` }
func (*Signed) Descriptor ¶
func (*Signed) ProtoMessage ¶
func (*Signed) ProtoMessage()
type Subject ¶
type Subject struct { Seq *SeqView `protobuf:"bytes,1,opt,name=seq" json:"seq,omitempty"` Digest []byte `protobuf:"bytes,2,opt,name=digest,proto3" json:"digest,omitempty"` }
func (*Subject) Descriptor ¶
func (*Subject) ProtoMessage ¶
func (*Subject) ProtoMessage()
type System ¶
type System interface { Send(chainId string, msg *Msg, dest uint64) Timer(d time.Duration, f func()) Canceller Deliver(chainId string, batch *Batch, committers []filter.Committer) AddReceiver(chainId string, receiver Receiver) Persist(chainId string, key string, data proto.Message) Restore(chainId string, key string, out proto.Message) bool LastBatch(chainId string) *Batch Sign(data []byte) []byte CheckSig(data []byte, src uint64, sig []byte) error Reconnect(chainId string, replica uint64) Validate(chainID string, req *Request) ([][]*Request, [][]filter.Committer, bool) Cut(chainID string) ([]*Request, []filter.Committer) }
System defines the API that needs to be provided for SBFT.
type ViewChange ¶
type ViewChange struct { View uint64 `protobuf:"varint,1,opt,name=view" json:"view,omitempty"` Pset []*Subject `protobuf:"bytes,2,rep,name=pset" json:"pset,omitempty"` Qset []*Subject `protobuf:"bytes,3,rep,name=qset" json:"qset,omitempty"` Checkpoint *Batch `protobuf:"bytes,4,opt,name=checkpoint" json:"checkpoint,omitempty"` }
func (*ViewChange) Descriptor ¶
func (*ViewChange) Descriptor() ([]byte, []int)
func (*ViewChange) GetCheckpoint ¶
func (m *ViewChange) GetCheckpoint() *Batch
func (*ViewChange) GetPset ¶
func (m *ViewChange) GetPset() []*Subject
func (*ViewChange) GetQset ¶
func (m *ViewChange) GetQset() []*Subject
func (*ViewChange) ProtoMessage ¶
func (*ViewChange) ProtoMessage()
func (*ViewChange) Reset ¶
func (m *ViewChange) Reset()
func (*ViewChange) String ¶
func (m *ViewChange) String() string
Click to show internal directories.
Click to hide internal directories.