Documentation ¶
Index ¶
- type ConsensusEngine
- type Engine
- type Handler
- type InmemEngine
- type InmemProxy
- func (i *InmemProxy) CommitBlock(block poset.Block) ([]byte, error)
- func (i *InmemProxy) GetSnapshot(blockIndex int64) ([]byte, error)
- func (i *InmemProxy) Restore(snapshot []byte) error
- func (i *InmemProxy) SubmitCh() chan []byte
- func (i *InmemProxy) SubmitInternalCh() chan poset.InternalTransaction
- type SocketEngine
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsensusEngine ¶
type ConsensusEngine struct {
// contains filtered or unexported fields
}
ConsensusEngine is the actor that coordinates State, Service and Consensus
func NewConsensusEngine ¶
func NewConsensusEngine(config config.Config, consensus consensus.Consensus, logger *logrus.Logger) (*ConsensusEngine, error)
NewConsensusEngine instantiates a new ConsensusEngine with coupled State, Service, and Consensus
func (*ConsensusEngine) Run ¶
func (e *ConsensusEngine) Run() error
Run starts the engine's Service asynchronously and starts the Consensus system synchronously
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Implements proxy.ProxyHandler interface
func NewHandler ¶
func (*Handler) CommitHandler ¶
Called when a new block is coming. This particular example just computes the stateHash incrementally with incoming blocks
func (*Handler) RestoreHandler ¶
Called when syncing with the network
type InmemEngine ¶
type InmemEngine struct {
// contains filtered or unexported fields
}
func NewInmemEngine ¶
func (*InmemEngine) Run ¶
func (i *InmemEngine) Run() error
type InmemProxy ¶
type InmemProxy struct {
// contains filtered or unexported fields
}
InmemProxy implements the AppProxy interface
func NewInmemProxy ¶
func NewInmemProxy(state *state.State, service *service.Service, submitCh chan []byte, logger *logrus.Logger) *InmemProxy
NewInmemProxy initializes and return a new InmemProxy
func (*InmemProxy) CommitBlock ¶
func (i *InmemProxy) CommitBlock(block poset.Block) ([]byte, error)
CommitBlock commits Block to the State and expects the resulting state hash
func (*InmemProxy) GetSnapshot ¶
func (i *InmemProxy) GetSnapshot(blockIndex int64) ([]byte, error)
TODO - Implement these two functions
func (*InmemProxy) Restore ¶
func (i *InmemProxy) Restore(snapshot []byte) error
func (*InmemProxy) SubmitCh ¶
func (i *InmemProxy) SubmitCh() chan []byte
SubmitCh is the channel through which the Service sends transactions to the node.
func (*InmemProxy) SubmitInternalCh ¶
func (i *InmemProxy) SubmitInternalCh() chan poset.InternalTransaction
type SocketEngine ¶
type SocketEngine struct {
// contains filtered or unexported fields
}
func NewSocketEngine ¶
func (*SocketEngine) Run ¶
func (s *SocketEngine) Run() error