cprovider

package
v0.4.11 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: ISC Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainProvider

type ChainProvider struct {
	// StartupTime is the unix timestamp for when the Server that is hosting
	// the RPC Server started.
	StartupTime int64
	ChainCtx    chainctx.IChainCtx
	ChainParams *chaincfg.Params

	DB database.DB
	// These fields allow the RPC Server to interface with the local block
	// BlockChain data and state.
	TimeSource chaindata.MedianTimeSource

	// TxMemPool defines the transaction memory pool to interact with.
	TxMemPool *mempool.TxPool

	// These fields define any optional indexes the RPC Server can make use
	// of to provide additional data when queried.
	TxIndex       *indexers.TxIndex
	AddrIndex     *indexers.AddrIndex
	CfIndex       *indexers.CfIndex
	OrphanTxIndex *indexers.OrphanTxIndex

	// The fee estimator keeps track of how long transactions are left in
	// the mempool before they are mined into blocks.
	FeeEstimator    *mempool.FeeEstimator
	MiningAddrs     []jaxutil.Address
	BannedAddresses []jaxutil.Address

	SigCache    *txscript.SigCache
	HashCache   *txscript.HashCache
	SyncManager *netsync.SyncManager
	// contains filtered or unexported fields
}

func (*ChainProvider) BestSnapshot added in v0.4.0

func (chainProvider *ChainProvider) BestSnapshot() *chaindata.BestState

func (*ChainProvider) BlkTmplGenerator

func (chainProvider *ChainProvider) BlkTmplGenerator() *mining.BlkTmplGenerator

func (*ChainProvider) BlockChain

func (chainProvider *ChainProvider) BlockChain() *blockchain.BlockChain

func (*ChainProvider) BlockTemplate

func (chainProvider *ChainProvider) BlockTemplate(useCoinbaseValue bool, burnReward int) (chaindata.BlockTemplate, error)

func (*ChainProvider) CalcKForHeight added in v0.4.0

func (chainProvider *ChainProvider) CalcKForHeight(height int32) uint32

func (*ChainProvider) Config

func (chainProvider *ChainProvider) Config() *ChainRuntimeConfig

func (*ChainProvider) DBUpdateCallback

func (chainProvider *ChainProvider) DBUpdateCallback(tx database.Tx) error

func (*ChainProvider) GbtWorkState

func (chainProvider *ChainProvider) GbtWorkState() *mining.GBTWorkState

func (*ChainProvider) InitSyncManager added in v0.4.10

func (chainProvider *ChainProvider) InitSyncManager(p2pProvider netsync.PeerNotifier) (err error)

func (*ChainProvider) Log

func (chainProvider *ChainProvider) Log() zerolog.Logger

func (*ChainProvider) MiningAddresses

func (chainProvider *ChainProvider) MiningAddresses() []jaxutil.Address

func (*ChainProvider) SetBlockchain added in v0.4.10

func (chainProvider *ChainProvider) SetBlockchain(chain *blockchain.BlockChain)

func (*ChainProvider) SetConfig added in v0.4.10

func (chainProvider *ChainProvider) SetConfig(cfg *ChainRuntimeConfig)

func (*ChainProvider) SetLog added in v0.4.10

func (chainProvider *ChainProvider) SetLog(log zerolog.Logger)

func (*ChainProvider) ShardCount

func (chainProvider *ChainProvider) ShardCount() (uint32, error)

func (*ChainProvider) Stats

func (chainProvider *ChainProvider) Stats() map[string]float64

type ChainRuntimeConfig

type ChainRuntimeConfig struct {
	SigCacheMaxSize    uint     `toml:"sig_cache_max_size"`  //The maximum number of entries in the signature verification cache
	AddCheckpoints     []string `toml:"add_checkpoints"`     //Add a custom checkpoint.  Format: '<height>:<hash>'
	AddrIndex          bool     `toml:"addr_index"`          //Maintain a full address-based transaction index which makes the searchrawtransactions RPC available
	MaxPeers           int      `toml:"max_peers"`           //Max number of inbound and outbound peers
	BlockMaxSize       uint32   `toml:"block_max_size"`      //Maximum block size in bytes to be used when creating a block
	BlockMinSize       uint32   `toml:"block_min_size"`      //Mininum block size in bytes to be used when creating a block
	BlockMaxWeight     uint32   `toml:"block_max_weight"`    //Maximum block weight to be used when creating a block
	BlockMinWeight     uint32   `toml:"block_min_weight"`    //Mininum block weight to be used when creating a block
	BlockPrioritySize  uint32   `toml:"block_priority_size"` //Size in bytes for high-priority/low-fee transactions when creating a block
	TxIndex            bool     `toml:"tx_index"`            //Maintain a full hash-based transaction index which makes all transactions available via the getrawtransaction RPC
	NoRelayPriority    bool     `toml:"no_relay_priority"`   //Do not require free or low-fee transactions to have high priority for relaying
	RejectReplacement  bool     `toml:"reject_replacement"`  //Reject transactions that attempt to replace existing transactions within the mempool through the Replace-By-Fee (RBF) signaling policy.
	RelayNonStd        bool     `toml:"relay_non_std"`       //Relay non-standard transactions regardless of the default settings for the active network.
	FreeTxRelayLimit   float64  `toml:"free_tx_relay_limit"` //Limit relay of transactions with no transaction fee to the given amount in thousands of bytes per minute
	MaxOrphanTxs       int      `toml:"max_orphan_txs"`      //Max number of orphan transactions to keep in memory
	MinRelayTxFee      int64    `toml:"min_relay_tx_fee"`    //The minimum transaction fee in satoshi/kB to be considered a non-zero fee.
	NoCFilters         bool     `toml:"no_c_filters"`        //Disable committed filtering (CF) support
	DisableCheckpoints bool     `toml:"disable_checkpoints"` //Disable built-in checkpoints.  Don't do this unless you know what you're doing.
	MiningAddresses    []string `toml:"mining_addresses"`    // TODO(mike): make them optional
	BannedAddresses    []string `toml:"banned_addresses"`
	AutoExpand         bool     `toml:"auto_expand"`
	ExpansionRule      int32    `toml:"expansion_rule"`
	ExpansionLimit     int32    `toml:"expansion_limit"`
	DBFullRescan       bool     `toml:"db_full_rescan"`
	RepairInvalidState bool     `toml:"repair_invalid_state"` // If state is corrupted, system will try to repair it.
}

func (*ChainRuntimeConfig) ParseBannedAddresses added in v0.4.11

func (cfg *ChainRuntimeConfig) ParseBannedAddresses(params *chaincfg.Params) ([]jaxutil.Address, error)

func (*ChainRuntimeConfig) ParseMiningAddresses

func (cfg *ChainRuntimeConfig) ParseMiningAddresses(params *chaincfg.Params) ([]jaxutil.Address, error)

Jump to

Keyboard shortcuts

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