consensus

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App interface {
	Info(*InfoRequest) (*InfoResponse, error)
	Check(*CheckRequest) (*CheckResponse, error)
	Init(*InitRequest) (*InitResponse, error)
	Begin(*BeginRequest) (*BeginResponse, error)
}

type BeginRequest

type BeginRequest struct {
	Params execute.BlockParams
}

type BeginResponse

type BeginResponse struct {
	Block execute.Block
}

type CheckRequest

type CheckRequest struct {
	Envelope *messaging.Envelope
	New      bool
}

type CheckResponse

type CheckResponse struct {
	Results []*protocol.TransactionStatus
}

type ExecutorApp

type ExecutorApp struct {
	Executor execute.Executor
	Database database.Beginner
	EventBus *events.Bus
	Describe *config.Describe
}

func (*ExecutorApp) Begin

func (a *ExecutorApp) Begin(req *BeginRequest) (*BeginResponse, error)

func (*ExecutorApp) Check

func (a *ExecutorApp) Check(req *CheckRequest) (*CheckResponse, error)

func (*ExecutorApp) Info

func (a *ExecutorApp) Info(*InfoRequest) (*InfoResponse, error)

func (*ExecutorApp) Init

func (a *ExecutorApp) Init(req *InitRequest) (*InitResponse, error)

type ExecutorBlock

type ExecutorBlock struct {
	execute.Block
	// contains filtered or unexported fields
}

func (*ExecutorBlock) Close

func (b *ExecutorBlock) Close() (execute.BlockState, error)

func (*ExecutorBlock) Process

func (b *ExecutorBlock) Process(envelope *messaging.Envelope) ([]*protocol.TransactionStatus, error)

type ExecutorBlockState

type ExecutorBlockState struct {
	execute.BlockState
	// contains filtered or unexported fields
}

func (*ExecutorBlockState) Commit

func (s *ExecutorBlockState) Commit() error

type InfoRequest

type InfoRequest struct{}

type InfoResponse

type InfoResponse struct {
	LastBlock *execute.BlockParams
	LastHash  [32]byte
}

type InitRequest

type InitRequest struct {
	Snapshot ioutil2.SectionReader
}

type InitResponse

type InitResponse struct {
	Hash []byte
}

type Node

type Node struct {
	// contains filtered or unexported fields
}

func NewNode

func NewNode(app App, recorder Recorder) *Node

func (*Node) Begin

func (n *Node) Begin(req *BeginRequest) (*BeginResponse, error)

func (*Node) Check

func (n *Node) Check(req *CheckRequest) (*CheckResponse, error)

func (*Node) Commit

func (n *Node) Commit(state execute.BlockState) ([]byte, error)

func (*Node) Deliver

func (n *Node) Deliver(block execute.Block, envelopes []*messaging.Envelope) ([]*protocol.TransactionStatus, error)

func (*Node) EndBlock

func (n *Node) EndBlock(block execute.Block) (execute.BlockState, error)

func (*Node) Info

func (n *Node) Info(req *InfoRequest) (*InfoResponse, error)

func (*Node) Init

func (n *Node) Init(req *InitRequest) (*InitResponse, error)

type Recorder

type Recorder interface {
	DidInit(snapshot ioutil.SectionReader) error
	DidExecuteBlock(state execute.BlockState, submissions []*messaging.Envelope) error
}

Jump to

Keyboard shortcuts

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