vm

package
v0.0.0-...-6dcdc0e Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "landslide"
)

Variables

View Source
var (
	DefaultABCIQueryOptions = ABCIQueryOptions{Height: 0, Prove: false}
)
View Source
var (
	Version = &version.Semantic{
		Major: 0,
		Minor: 1,
		Patch: 1,
	}
)

Functions

func ABCIResponsesResultsHash

func ABCIResponsesResultsHash(ar *tmstate.ABCIResponses) []byte

func TxPostCheck

func TxPostCheck(state state.State) mempl.PostCheckFunc

TxPostCheck returns a function to filter transactions after processing. The function limits the gas wanted by a transaction to the block's maximum total gas.

func TxPreCheck

func TxPreCheck(state state.State) mempl.PreCheckFunc

TxPreCheck returns a function to filter transactions before processing. The function limits the size of a transaction to the block's maximum data size.

func WaitForHeight

func WaitForHeight(c Service, h int64, waiter client.Waiter) error

Types

type ABCIQueryArgs

type ABCIQueryArgs struct {
	Path string           `json:"path"`
	Data tmbytes.HexBytes `json:"data"`
}

type ABCIQueryOptions

type ABCIQueryOptions struct {
	Height int64 `json:"height"`
	Prove  bool  `json:"prove"`
}

type ABCIQueryWithOptionsArgs

type ABCIQueryWithOptionsArgs struct {
	Path string           `json:"path"`
	Data tmbytes.HexBytes `json:"data"`
	Opts ABCIQueryOptions `json:"opts"`
}

type ABCIService

type ABCIService interface {
	// Reading from abci app
	ABCIInfo(_ *http.Request, _ *struct{}, reply *ctypes.ResultABCIInfo) error
	ABCIQuery(_ *http.Request, args *ABCIQueryArgs, reply *ctypes.ResultABCIQuery) error
	ABCIQueryWithOptions(_ *http.Request, args *ABCIQueryWithOptionsArgs, reply *ctypes.ResultABCIQuery) error

	// Writing to abci app
	BroadcastTxCommit(_ *http.Request, args *BroadcastTxArgs, reply *ctypes.ResultBroadcastTxCommit) error
	BroadcastTxAsync(_ *http.Request, args *BroadcastTxArgs, reply *ctypes.ResultBroadcastTx) error
	BroadcastTxSync(_ *http.Request, args *BroadcastTxArgs, reply *ctypes.ResultBroadcastTx) error
}

type Batch

type Batch struct {
	database.Batch
}

func (Batch) Close

func (b Batch) Close() error

func (Batch) Delete

func (b Batch) Delete(key []byte) error

func (Batch) Set

func (b Batch) Set(key, value []byte) error

func (Batch) Write

func (b Batch) Write() error

func (Batch) WriteSync

func (b Batch) WriteSync() error

type Block

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

Block implements the snowman.Block interface

func (*Block) Accept

func (b *Block) Accept(ctx context.Context) error

func (*Block) Bytes

func (b *Block) Bytes() []byte

func (*Block) Height

func (b *Block) Height() uint64

func (*Block) ID

func (b *Block) ID() ids.ID

func (*Block) Parent

func (b *Block) Parent() ids.ID

func (*Block) Reject

func (b *Block) Reject(ctx context.Context) error

func (*Block) SetStatus

func (b *Block) SetStatus(status choices.Status)

func (*Block) Status

func (b *Block) Status() choices.Status

func (*Block) Timestamp

func (b *Block) Timestamp() time.Time

func (*Block) Verify

func (b *Block) Verify(context.Context) error

type BlockHashArgs

type BlockHashArgs struct {
	Hash []byte `json:"hash"`
}

type BlockHeightArgs

type BlockHeightArgs struct {
	Height *int64 `json:"height"`
}

type BlockSearchArgs

type BlockSearchArgs struct {
	Query   string `json:"query"`
	Page    *int   `json:"page"`
	PerPage *int   `json:"perPage"`
	OrderBy string `json:"orderBy"`
}

type BlockchainInfoArgs

type BlockchainInfoArgs struct {
	MinHeight int64 `json:"minHeight"`
	MaxHeight int64 `json:"maxHeight"`
}

type BroadcastTxArgs

type BroadcastTxArgs struct {
	Tx types.Tx `json:"tx"`
}

type CheckTxArgs

type CheckTxArgs struct {
	Tx []byte `json:"tx"`
}

type CommitArgs

type CommitArgs struct {
	Height *int64 `json:"height"`
}

type ConsensusParamsArgs

type ConsensusParamsArgs struct {
	Height *int64 `json:"height"`
}

type Database

type Database struct {
	database.Database
}

func (Database) DeleteSync

func (db Database) DeleteSync(key []byte) error

func (Database) Get

func (db Database) Get(key []byte) ([]byte, error)

func (Database) Iterator

func (db Database) Iterator(start, end []byte) (dbm.Iterator, error)

func (Database) NewBatch

func (db Database) NewBatch() dbm.Batch

func (Database) Print

func (db Database) Print() error

func (Database) ReverseIterator

func (db Database) ReverseIterator(start, end []byte) (dbm.Iterator, error)

func (Database) Set

func (db Database) Set(key []byte, value []byte) error

func (Database) SetSync

func (db Database) SetSync(key []byte, value []byte) error

func (Database) Stats

func (db Database) Stats() map[string]string

type GenesisChunkedArgs

type GenesisChunkedArgs struct {
	Chunk uint `json:"chunk"`
}

type HistoryService

type HistoryService interface {
	BlockchainInfo(_ *http.Request, args *BlockchainInfoArgs, reply *ctypes.ResultBlockchainInfo) error
	Genesis(_ *http.Request, _ *struct{}, reply *ctypes.ResultGenesis) error
	GenesisChunked(_ *http.Request, args *GenesisChunkedArgs, reply *ctypes.ResultGenesisChunk) error
}

type Iterator

type Iterator struct {
	database.Iterator
	// contains filtered or unexported fields
}

func (Iterator) Close

func (iter Iterator) Close() error

func (Iterator) Domain

func (iter Iterator) Domain() (start []byte, end []byte)

func (Iterator) Error

func (iter Iterator) Error() error

func (Iterator) Key

func (iter Iterator) Key() (key []byte)

func (Iterator) Next

func (iter Iterator) Next()

func (Iterator) Valid

func (iter Iterator) Valid() bool

func (Iterator) Value

func (iter Iterator) Value() (value []byte)

type LocalService

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

func (*LocalService) ABCIInfo

func (s *LocalService) ABCIInfo(_ *http.Request, _ *struct{}, reply *ctypes.ResultABCIInfo) error

func (*LocalService) ABCIQuery

func (s *LocalService) ABCIQuery(req *http.Request, args *ABCIQueryArgs, reply *ctypes.ResultABCIQuery) error

func (*LocalService) ABCIQueryWithOptions

func (s *LocalService) ABCIQueryWithOptions(
	_ *http.Request,
	args *ABCIQueryWithOptionsArgs,
	reply *ctypes.ResultABCIQuery,
) error

func (*LocalService) Block

func (s *LocalService) Block(_ *http.Request, args *BlockHeightArgs, reply *ctypes.ResultBlock) error

func (*LocalService) BlockByHash

func (s *LocalService) BlockByHash(_ *http.Request, args *BlockHashArgs, reply *ctypes.ResultBlock) error

func (*LocalService) BlockResults

func (s *LocalService) BlockResults(_ *http.Request, args *BlockHeightArgs, reply *ctypes.ResultBlockResults) error

func (*LocalService) BlockSearch

func (s *LocalService) BlockSearch(req *http.Request, args *BlockSearchArgs, reply *ctypes.ResultBlockSearch) error

func (*LocalService) BlockchainInfo

func (s *LocalService) BlockchainInfo(
	_ *http.Request,
	args *BlockchainInfoArgs,
	reply *ctypes.ResultBlockchainInfo,
) error

func (*LocalService) BroadcastTxAsync

func (s *LocalService) BroadcastTxAsync(
	_ *http.Request,
	args *BroadcastTxArgs,
	reply *ctypes.ResultBroadcastTx,
) error

func (*LocalService) BroadcastTxCommit

func (s *LocalService) BroadcastTxCommit(
	_ *http.Request,
	args *BroadcastTxArgs,
	reply *ctypes.ResultBroadcastTxCommit,
) error

func (*LocalService) BroadcastTxSync

func (s *LocalService) BroadcastTxSync(_ *http.Request, args *BroadcastTxArgs, reply *ctypes.ResultBroadcastTx) error

func (*LocalService) CheckTx

func (s *LocalService) CheckTx(_ *http.Request, args *CheckTxArgs, reply *ctypes.ResultCheckTx) error

func (*LocalService) Commit

func (s *LocalService) Commit(_ *http.Request, args *CommitArgs, reply *ctypes.ResultCommit) error

func (*LocalService) ConsensusParams

func (s *LocalService) ConsensusParams(_ *http.Request, args *ConsensusParamsArgs, reply *ctypes.ResultConsensusParams) error

func (*LocalService) ConsensusState

func (s *LocalService) ConsensusState(_ *http.Request, _ *struct{}, reply *ctypes.ResultConsensusState) error

ToDo: we doesn't have consensusState

func (*LocalService) DumpConsensusState

func (s *LocalService) DumpConsensusState(_ *http.Request, _ *struct{}, reply *ctypes.ResultDumpConsensusState) error

ToDo: we doesn't have consensusState

func (*LocalService) Genesis

func (s *LocalService) Genesis(_ *http.Request, _ *struct{}, reply *ctypes.ResultGenesis) error

func (*LocalService) GenesisChunked

func (s *LocalService) GenesisChunked(_ *http.Request, args *GenesisChunkedArgs, reply *ctypes.ResultGenesisChunk) error

func (*LocalService) Health

func (s *LocalService) Health(_ *http.Request, _ *struct{}, reply *ctypes.ResultHealth) error

func (*LocalService) NetInfo

func (s *LocalService) NetInfo(_ *http.Request, _ *struct{}, reply *ctypes.ResultNetInfo) error

ToDo: no peers, because it's vm

func (*LocalService) NumUnconfirmedTxs

func (s *LocalService) NumUnconfirmedTxs(_ *http.Request, _ *struct{}, reply *ctypes.ResultUnconfirmedTxs) error

func (*LocalService) Status

func (s *LocalService) Status(_ *http.Request, _ *struct{}, reply *ctypes.ResultStatus) error

func (*LocalService) Tx

func (s *LocalService) Tx(_ *http.Request, args *TxArgs, reply *ctypes.ResultTx) error

func (*LocalService) TxSearch

func (s *LocalService) TxSearch(req *http.Request, args *TxSearchArgs, reply *ctypes.ResultTxSearch) error

func (*LocalService) UnconfirmedTxs

func (s *LocalService) UnconfirmedTxs(_ *http.Request, args *UnconfirmedTxsArgs, reply *ctypes.ResultUnconfirmedTxs) error

func (*LocalService) Validators

func (s *LocalService) Validators(_ *http.Request, args *ValidatorsArgs, reply *ctypes.ResultValidators) error

type MempoolService

type MempoolService interface {
	UnconfirmedTxs(_ *http.Request, args *UnconfirmedTxsArgs, reply *ctypes.ResultUnconfirmedTxs) error
	NumUnconfirmedTxs(_ *http.Request, _ *struct{}, reply *ctypes.ResultUnconfirmedTxs) error
	CheckTx(_ *http.Request, args *CheckTxArgs, reply *ctypes.ResultCheckTx) error
}

type NetworkService

type NetworkService interface {
	NetInfo(_ *http.Request, _ *struct{}, reply *ctypes.ResultNetInfo) error
	DumpConsensusState(_ *http.Request, _ *struct{}, reply *ctypes.ResultDumpConsensusState) error
	ConsensusState(_ *http.Request, _ *struct{}, reply *ctypes.ResultConsensusState) error
	ConsensusParams(_ *http.Request, args *ConsensusParamsArgs, reply *ctypes.ResultConsensusParams) error
	Health(_ *http.Request, _ *struct{}, reply *ctypes.ResultHealth) error
}

type SignService

type SignService interface {
	Block(_ *http.Request, args *BlockHeightArgs, reply *ctypes.ResultBlock) error
	BlockByHash(_ *http.Request, args *BlockHashArgs, reply *ctypes.ResultBlock) error
	BlockResults(_ *http.Request, args *BlockHeightArgs, reply *ctypes.ResultBlockResults) error
	Commit(_ *http.Request, args *CommitArgs, reply *ctypes.ResultCommit) error
	Validators(_ *http.Request, args *ValidatorsArgs, reply *ctypes.ResultValidators) error
	Tx(_ *http.Request, args *TxArgs, reply *ctypes.ResultTx) error
	TxSearch(_ *http.Request, args *TxSearchArgs, reply *ctypes.ResultTxSearch) error
	BlockSearch(_ *http.Request, args *BlockSearchArgs, reply *ctypes.ResultBlockSearch) error
}

type StatusService

type StatusService interface {
	Status(_ *http.Request, _ *struct{}, reply *ctypes.ResultStatus) error
}

type TxArgs

type TxArgs struct {
	Hash  []byte `json:"hash"`
	Prove bool   `json:"prove"`
}

type TxSearchArgs

type TxSearchArgs struct {
	Query   string `json:"query"`
	Prove   bool   `json:"prove"`
	Page    *int   `json:"page"`
	PerPage *int   `json:"perPage"`
	OrderBy string `json:"orderBy"`
}

type UnconfirmedTxsArgs

type UnconfirmedTxsArgs struct {
	Limit *int `json:"limit"`
}

type VM

type VM struct {

	// *chain.State helps to implement the VM interface by wrapping blocks
	// with an efficient caching layer.
	*chain.State
	// contains filtered or unexported fields
}

func NewVM

func NewVM(app abciTypes.Application) *VM

func (*VM) AppGossip

func (vm *VM) AppGossip(_ context.Context, nodeID ids.NodeID, msg []byte) error

func (*VM) AppRequest

func (vm *VM) AppRequest(_ context.Context, nodeID ids.NodeID, requestID uint32, time time.Time, request []byte) error

func (*VM) AppRequestFailed

func (vm *VM) AppRequestFailed(_ context.Context, nodeID ids.NodeID, requestID uint32) error

This VM doesn't (currently) have any app-specific messages

func (*VM) AppResponse

func (vm *VM) AppResponse(_ context.Context, nodeID ids.NodeID, requestID uint32, response []byte) error

This VM doesn't (currently) have any app-specific messages

func (*VM) Connected

func (vm *VM) Connected(_ context.Context, id ids.NodeID, nodeVersion *version.Application) error

func (*VM) CreateHandlers

func (vm *VM) CreateHandlers(_ context.Context) (map[string]*common.HTTPHandler, error)

func (*VM) CreateStaticHandlers

func (vm *VM) CreateStaticHandlers(ctx context.Context) (map[string]*common.HTTPHandler, error)

func (*VM) CrossChainAppRequest

func (vm *VM) CrossChainAppRequest(_ context.Context, _ ids.ID, _ uint32, deadline time.Time, request []byte) error

func (*VM) CrossChainAppRequestFailed

func (vm *VM) CrossChainAppRequestFailed(_ context.Context, _ ids.ID, _ uint32) error

func (*VM) CrossChainAppResponse

func (vm *VM) CrossChainAppResponse(_ context.Context, _ ids.ID, _ uint32, response []byte) error

func (*VM) Disconnected

func (vm *VM) Disconnected(_ context.Context, id ids.NodeID) error

func (*VM) HealthCheck

func (vm *VM) HealthCheck(ctx context.Context) (interface{}, error)

func (*VM) Initialize

func (vm *VM) Initialize(
	_ context.Context,
	chainCtx *snow.Context,
	dbManager manager.Manager,
	genesisBytes []byte,
	upgradeBytes []byte,
	configBytes []byte,
	toEngine chan<- common.Message,
	fxs []*common.Fx,
	appSender common.AppSender,
) error

func (*VM) NotifyBlockReady

func (vm *VM) NotifyBlockReady()

NotifyBlockReady tells the consensus engine that a new block is ready to be created

func (*VM) ProxyApp

func (vm *VM) ProxyApp() proxy.AppConns

func (*VM) SetPreference

func (vm *VM) SetPreference(ctx context.Context, blkID ids.ID) error

func (*VM) SetState

func (vm *VM) SetState(ctx context.Context, state snow.State) error

func (*VM) Shutdown

func (vm *VM) Shutdown(ctx context.Context) error

func (*VM) Version

func (vm *VM) Version(ctx context.Context) (string, error)

type ValidatorsArgs

type ValidatorsArgs struct {
	Height  *int64 `json:"height"`
	Page    *int   `json:"page"`
	PerPage *int   `json:"perPage"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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