consensus

package
v1.2.10 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: MIT Imports: 19 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 {
	Context  context.Context
	Envelope *messaging.Envelope
	New      bool
	Pretend  bool
}

type CheckResponse

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

type CommitConsensusError added in v1.2.10

type CommitConsensusError [][]byte

func (CommitConsensusError) Error added in v1.2.10

func (CommitConsensusError) Error() string

type ExecuteHookFunc added in v1.2.10

type ExecuteHookFunc = func(*Node, execute.BlockParams, []*messaging.Envelope) (_ []*messaging.Envelope, keepHook bool)

type ExecuteRequest added in v1.2.10

type ExecuteRequest struct {
	Context context.Context
}

type ExecuteResponse added in v1.2.10

type ExecuteResponse struct {
}

type ExecutorApp

type ExecutorApp struct {
	Executor execute.Executor
	Restore  RestoreFunc
	EventBus *events.Bus
}

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 Gossip added in v1.2.10

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

type InfoRequest

type InfoRequest struct{}

type InfoResponse

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

type InitRequest

type InitRequest struct {
	Snapshot   ioutil.SectionReader
	Validators []*execute.ValidatorUpdate
}

type InitResponse

type InitResponse struct {
	Hash       []byte
	Validators []*execute.ValidatorUpdate
}

type Node

type Node struct {

	// SkipProposalCheck skips checking the proposed block.
	SkipProposalCheck bool

	// IgnoreDeliverResults ignores inconsistencies in the result of DeliverTx
	// (the results of transactions and signatures).
	IgnoreDeliverResults bool

	// IgnoreCommitResults ignores inconsistencies in the result of Commit (the
	// root hash of the BPT).
	IgnoreCommitResults bool
	// contains filtered or unexported fields
}

func NewNode

func NewNode(key ed25519.PrivateKey, app App, gossip *Gossip, logger log.Logger) *Node

func (*Node) Check

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

func (*Node) Execute added in v1.2.10

func (n *Node) Execute(req *ExecuteRequest) (*ExecuteResponse, error)

func (*Node) Info

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

func (*Node) Init

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

func (*Node) SetExecuteHook added in v1.2.10

func (n *Node) SetExecuteHook(hook ExecuteHookFunc)

func (*Node) SetRecorder added in v1.2.10

func (n *Node) SetRecorder(rec Recorder)

func (*Node) Status added in v1.2.10

func (n *Node) Status(*StatusRequest) (*StatusResponse, error)

type Recorder

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

type RestoreFunc added in v1.2.10

type RestoreFunc func(ioutil.SectionReader) error

type StatusRequest added in v1.2.10

type StatusRequest struct{}

type StatusResponse added in v1.2.10

type StatusResponse struct {
	BlockIndex uint64
	BlockTime  time.Time
}

Jump to

Keyboard shortcuts

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