local

package
v5.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: CC0-1.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseConfig

func ParseConfig() (*cfg.Config, error)

Types

type Details

type Details struct {
	Home string `yaml:"home"`
}

Details represents the nodeconfig.Details implementation for a local node

func DefaultDetails

func DefaultDetails() *Details

func NewDetails

func NewDetails(home string) *Details

func (*Details) Validate

func (d *Details) Validate() error

Validate implements nodeconfig.Details

type Node

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

Node represents the node implementation that uses a local node

func NewNode

func NewNode(config *Details, txConfig client.TxConfig, codec codec.Codec) (*Node, error)

NewNode returns a new Node instance

func (*Node) Block

func (cp *Node) Block(height int64) (*tmctypes.ResultBlock, error)

Block implements node.Node

func (*Node) BlockResults

func (cp *Node) BlockResults(height int64) (*tmctypes.ResultBlockResults, error)

BlockResults implements node.Node

func (*Node) ChainID

func (cp *Node) ChainID() (string, error)

ChainID implements node.Node

func (*Node) ConsensusState

func (cp *Node) ConsensusState() (*constypes.RoundStateSimple, error)

ConsensusState implements node.Node

func (*Node) Genesis

func (cp *Node) Genesis() (*tmctypes.ResultGenesis, error)

Genesis implements node.Node

func (*Node) LatestHeight

func (cp *Node) LatestHeight() (int64, error)

LatestHeight implements node.Node

func (*Node) Stop

func (cp *Node) Stop()

Stop implements node.Node

func (*Node) SubscribeEvents

func (cp *Node) SubscribeEvents(subscriber, query string) (<-chan tmctypes.ResultEvent, context.CancelFunc, error)

SubscribeEvents implements node.Node

func (*Node) SubscribeNewBlocks

func (cp *Node) SubscribeNewBlocks(subscriber string) (<-chan tmctypes.ResultEvent, context.CancelFunc, error)

SubscribeNewBlocks implements node.Node

func (*Node) Tx

func (cp *Node) Tx(hash string) (*types.Tx, error)

Tx implements node.Node

func (*Node) TxSearch

func (cp *Node) TxSearch(query string, pagePtr *int, perPagePtr *int, orderBy string) (*tmctypes.ResultTxSearch, error)

TxSearch implements node.Node

func (*Node) Txs

func (cp *Node) Txs(block *tmctypes.ResultBlock) ([]*types.Tx, error)

Txs implements node.Node

func (*Node) Validators

func (cp *Node) Validators(height int64) (*tmctypes.ResultValidators, error)

Validators implements node.Node

type Source

type Source struct {
	Initialized bool

	StoreDB db.DB

	Codec       codec.Codec
	LegacyAmino *codec.LegacyAmino

	BlockStore *tmstore.BlockStore
	Logger     log.Logger
	Cms        sdk.CommitMultiStore
}

Source represents the Source interface implementation that reads the data from a local node

func NewSource

func NewSource(home string, encodingConfig *params.EncodingConfig) (*Source, error)

NewSource returns a new Source instance

func (Source) InitStores

func (k Source) InitStores() error

InitStores initializes the stores by mounting the various keys that have been specified. This method MUST be called before using any method that relies on the local storage somehow.

func (Source) LoadHeight

func (k Source) LoadHeight(height int64) (sdk.Context, error)

LoadHeight loads the given height from the store. It returns a new Context that can be used to query the data, or an error if something wrong happens.

func (Source) MountKVStores

func (k Source) MountKVStores(app interface{}, fieldName string) error

MountKVStores allows to register the KV stores using the same KVStoreKey instances that are used inside the given app. To do so, this method uses the reflection to access the field with the specified name inside the given app. Such field must be of type map[string]*sdk.KVStoreKey and is commonly named something similar to "keys"

func (Source) MountMemoryStores

func (k Source) MountMemoryStores(app interface{}, fieldName string) error

MountMemoryStores allows to register the Memory stores using the same MemoryStoreKey instances that are used inside the given app. To do so, this method uses the reflection to access the field with the specified name inside the given app. Such field must be of type map[string]*sdk.MemoryStoreKey and is commonly named something similar to "memkeys"

func (Source) MountTransientStores

func (k Source) MountTransientStores(app interface{}, fieldName string) error

MountTransientStores allows to register the Transient stores using the same TransientStoreKey instances that are used inside the given app. To do so, this method uses the reflection to access the field with the specified name inside the given app. Such field must be of type map[string]*sdk.TransientStoreKey and is commonly named something similar to "tkeys"

func (Source) Type

func (k Source) Type() string

Type implements keeper.Source

Jump to

Keyboard shortcuts

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