Documentation ¶
Index ¶
- type App
- func (a *App) AssembleProposal(metadata []byte, requests [][]byte) types.Proposal
- func (a *App) AuxiliaryData(msg []byte) []byte
- func (a *App) ClearMutateSend(target uint64)
- func (a *App) Connect()
- func (a *App) ConnectTo(target uint64)
- func (a *App) Deliver(proposal types.Proposal, signatures []types.Signature) types.Reconfig
- func (a *App) Disconnect()
- func (a *App) DisconnectFrom(target uint64)
- func (a *App) MembershipChange() bool
- func (a *App) MutateSend(target uint64, mutating func(uint64, *smartbftprotos.Message))
- func (a *App) Mute()
- func (a *App) RequestID(req []byte) types.RequestInfo
- func (a *App) RequestsFromProposal(proposal types.Proposal) []types.RequestInfo
- func (a *App) Restart()
- func (a *App) Sign([]byte) []byte
- func (a *App) SignProposal(_ types.Proposal, aux []byte) *types.Signature
- func (a *App) Submit(req Request)
- func (a *App) Sync() types.SyncResponse
- func (a *App) UnMute()
- func (a *App) VerificationSequence() uint64
- func (a *App) VerifyConsenterSig(signature types.Signature, _ types.Proposal) ([]byte, error)
- func (a *App) VerifyProposal(proposal types.Proposal) ([]types.RequestInfo, error)
- func (a *App) VerifyRequest(val []byte) (types.RequestInfo, error)
- func (a *App) VerifySignature(_ types.Signature) error
- type AppRecord
- type Configuration
- type FwdMessage
- func (*FwdMessage) Descriptor() ([]byte, []int)
- func (m *FwdMessage) GetPayload() []byte
- func (m *FwdMessage) GetSender() uint64
- func (*FwdMessage) ProtoMessage()
- func (m *FwdMessage) Reset()
- func (m *FwdMessage) String() string
- func (m *FwdMessage) XXX_DiscardUnknown()
- func (m *FwdMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *FwdMessage) XXX_Merge(src proto.Message)
- func (m *FwdMessage) XXX_Size() int
- func (m *FwdMessage) XXX_Unmarshal(b []byte) error
- type Network
- type Node
- type Reconfig
- type Request
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct { ID uint64 Delivered chan *AppRecord Consensus *consensus.Consensus Setup func() Node *Node // contains filtered or unexported fields }
App implements all interfaces required by an application using this library
func (*App) AssembleProposal ¶
AssembleProposal assembles a new proposal from the given requests
func (*App) AuxiliaryData ¶
func (*App) ClearMutateSend ¶
ClearMutateSend clears any mutating function called before sending a message to the target node
func (*App) Disconnect ¶
func (a *App) Disconnect()
Disconnect disconnects the node from the network
func (*App) DisconnectFrom ¶
DisconnectFrom disconnects the node from a specific node
func (*App) MembershipChange ¶
func (*App) MutateSend ¶
func (a *App) MutateSend(target uint64, mutating func(uint64, *smartbftprotos.Message))
MutateSend set the mutating function to be called before sending a message to the target node
func (*App) RequestID ¶
func (a *App) RequestID(req []byte) types.RequestInfo
RequestID returns info about the given request
func (*App) RequestsFromProposal ¶
func (a *App) RequestsFromProposal(proposal types.Proposal) []types.RequestInfo
RequestsFromProposal returns from the given proposal the included requests' info
func (*App) SignProposal ¶
SignProposal signs on the given proposal
func (*App) Sync ¶
func (a *App) Sync() types.SyncResponse
Sync synchronizes and returns the latest decision
func (*App) VerificationSequence ¶
VerificationSequence returns the current verification sequence
func (*App) VerifyConsenterSig ¶
VerifyConsenterSig verifies a nodes signature on the given proposal
func (*App) VerifyProposal ¶
VerifyProposal verifies the given proposal and returns the included requests
func (*App) VerifyRequest ¶
func (a *App) VerifyRequest(val []byte) (types.RequestInfo, error)
VerifyRequest verifies the given request and returns its info
type AppRecord ¶
type AppRecord struct { Batch *batch Metadata []byte }
AppRecord represents a committed batch and metadata
type Configuration ¶
type Configuration struct { // SelfID is added by the application RequestBatchMaxCount int64 RequestBatchMaxBytes int64 RequestBatchMaxInterval time.Duration IncomingMessageBufferSize int64 RequestPoolSize int64 RequestForwardTimeout time.Duration RequestComplainTimeout time.Duration RequestAutoRemoveTimeout time.Duration ViewChangeResendInterval time.Duration ViewChangeTimeout time.Duration LeaderHeartbeatTimeout time.Duration LeaderHeartbeatCount int64 NumOfTicksBehindBeforeSyncing int64 CollectTimeout time.Duration SyncOnStart bool SpeedUpViewChange bool LeaderRotation bool DecisionsPerLeader int64 }
type FwdMessage ¶
type FwdMessage struct { Sender uint64 `protobuf:"varint,1,opt,name=sender,proto3" json:"sender,omitempty"` Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*FwdMessage) Descriptor ¶
func (*FwdMessage) Descriptor() ([]byte, []int)
func (*FwdMessage) GetPayload ¶
func (m *FwdMessage) GetPayload() []byte
func (*FwdMessage) GetSender ¶
func (m *FwdMessage) GetSender() uint64
func (*FwdMessage) ProtoMessage ¶
func (*FwdMessage) ProtoMessage()
func (*FwdMessage) Reset ¶
func (m *FwdMessage) Reset()
func (*FwdMessage) String ¶
func (m *FwdMessage) String() string
func (*FwdMessage) XXX_DiscardUnknown ¶
func (m *FwdMessage) XXX_DiscardUnknown()
func (*FwdMessage) XXX_Marshal ¶
func (m *FwdMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*FwdMessage) XXX_Merge ¶
func (m *FwdMessage) XXX_Merge(src proto.Message)
func (*FwdMessage) XXX_Size ¶
func (m *FwdMessage) XXX_Size() int
func (*FwdMessage) XXX_Unmarshal ¶
func (m *FwdMessage) XXX_Unmarshal(b []byte) error
type Network ¶
Network is a map of ids and nodes
func (Network) AddOrUpdateNode ¶
AddOrUpdateNode adds or updates a node in the network
func (Network) StartServe ¶
func (n Network) StartServe()
StartServe calls serve on all nodes in the network
type Node ¶
Node represents a node in a network
func (*Node) SendConsensus ¶
func (node *Node) SendConsensus(targetID uint64, m *smartbftprotos.Message)
SendConsensus sends a consensus related message to a target node
func (*Node) SendTransaction ¶
SendTransaction sends a client's request to a target node
type Reconfig ¶
type Reconfig struct { InLatestDecision bool CurrentNodes []int64 CurrentConfig Configuration }