core

package
v0.0.0-...-8430543 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExplorerExecutionCallback

func ExplorerExecutionCallback() *block.ExecutionCallback

Types

type ChainGlobalConfig

type ChainGlobalConfig struct {
	ChainId               uint16                    `json:"chain_id"`
	GenesisBlock          *block.Block              `json:"genesis_block"`
	GenesisConsensusState *consensus.ConsensusState `json:"genesis_consensus_state"`
	GenesisBlockReward    uint64                    `json:"genesis_block_reward"`
	BlockReward           uint64                    `json:"block_reward"`
	SeedNodes             []string                  `json:"seed_nodes"`
	Tip1EnableHeight      int                       `json:"tip1_enable_height"`
}

type ChainNode

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

func NewChainNode

func NewChainNode(config ChainNodeConfig, gConfig ChainGlobalConfig, execCallback *block.ExecutionCallback) (*ChainNode, error)

func (*ChainNode) EstimateGas

func (cn *ChainNode) EstimateGas(origin block.AddressType, code []byte) (int, error)

func (*ChainNode) ExplorerGetAccountTransactions

func (cn *ChainNode) ExplorerGetAccountTransactions(addr block.AddressType, l int, r int) ([]ExplorerTransaction, int)

func (*ChainNode) ExplorerGetBlockByHash

func (cn *ChainNode) ExplorerGetBlockByHash(hash block.HashType) (*block.Block, *consensus.ConsensusState, error)

func (*ChainNode) ExplorerGetTransaction

func (cn *ChainNode) ExplorerGetTransaction(txh block.HashType) (*block.Transaction, int, error)

func (*ChainNode) GetAccountInfo

func (cn *ChainNode) GetAccountInfo(addr block.AddressType) block.AccountInfo

func (*ChainNode) GetBlock

func (cn *ChainNode) GetBlock(height int) (*block.Block, *consensus.ConsensusState, error)

func (*ChainNode) GetBlockCandidate

func (cn *ChainNode) GetBlockCandidate(miner block.AddressType) *block.Block

func (*ChainNode) GetContractElf

func (cn *ChainNode) GetContractElf(addr block.AddressType) ([]byte, error)

func (*ChainNode) GetHighest

func (cn *ChainNode) GetHighest() (*block.Block, *consensus.ConsensusState, error)

func (*ChainNode) GetStorageAt

func (cn *ChainNode) GetStorageAt(addr block.AddressType, pos block.HashType) storage.DataType

func (*ChainNode) Run

func (cn *ChainNode) Run()

func (*ChainNode) RunViewRawCode

func (cn *ChainNode) RunViewRawCode(origin block.AddressType, code []byte) ([]byte, error)

func (*ChainNode) Stop

func (cn *ChainNode) Stop()

func (*ChainNode) SubmitBlock

func (cn *ChainNode) SubmitBlock(b *block.Block) error

func (*ChainNode) SubmitTx

func (cn *ChainNode) SubmitTx(tx *block.Transaction) error

type ChainNodeConfig

type ChainNodeConfig struct {
	StoragePath          string  `json:"storage_path"`
	StorageFinalizeDepth int     `json:"storage_finalize_depth"`
	StorageDumpDiskRatio float64 `json:"storage_dump_disk_ratio"`
	ListenPort           int     `json:"listen_port"`
	MaxConnections       int     `json:"max_connections"`
}

type ExplorerTransaction

type ExplorerTransaction struct {
	From    string `json:"from"`
	To      string `json:"to"`
	Hash    string `json:"hash"`
	Value   uint64 `json:"value"`
	BlockId int    `json:"blockid"`
	Time    int    `json:"time"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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