single

package module
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultChannelSize    = 10000 // The channel size to add the txs
	DefaultCacheThreshold = 1
	DefaultFlushTimeOut   = 2 * time.Second
	DefaultFlushTicker    = 2
)
View Source
const (
	DefaultMaxTxCount          = 1000         // Maximum number of transactions in a block
	DefaultMaxTxPoolSize       = 5120         // Maximum number of common transaction in the pool
	DefaultMaxConfigTxPoolSize = 100          // Maximum number of config transaction in the pool
	DefaultMaxTxTimeTimeout    = float64(600) // The unit is in seconds
)
View Source
const TxPoolType = "SINGLE"

Variables

View Source
var (
	MODULE_BRIEF = "[Brief]"
	MODULE_EVENT = "[Event]"
)
View Source
var (
	TxPoolConfig   *txPoolConfig
	MonitorEnabled bool
)

Functions

func IsMetrics

func IsMetrics() bool

IsMetrics Whether to log operation time

func IsTxTimeVerify

func IsTxTimeVerify(chainConf protocol.ChainConf) bool

===========config in the blockchain============ IsTxTimeVerify Whether transactions require validation

func MaxCommonTxPoolSize

func MaxCommonTxPoolSize() int

===========config in the local============ MaxCommonTxPoolSize Maximum number of common transaction in the pool

func MaxConfigTxPoolSize

func MaxConfigTxPoolSize() int

MaxConfigTxPoolSize The maximum number of configure transaction in the pool

func MaxTxCount

func MaxTxCount(chainConf protocol.ChainConf) int

MaxTxCount Maximum number of transactions in a block

func MaxTxTimeTimeout

func MaxTxTimeTimeout(chainConf protocol.ChainConf) float64

MaxTxTimeTimeout The maximum timeout for a transaction

func NewTxPoolImpl

func NewTxPoolImpl(
	nodeId string,
	chainId string,
	blockStore protocol.BlockchainStore,
	msgBus msgbus.MessageBus,
	conf protocol.ChainConf,
	ac protocol.AccessControlProvider,

	log protocol.Logger,
	monitorEnabled bool,
	poolConfig map[string]interface{}) (protocol.TxPool, error)

Types

type LogConfig

type LogConfig struct {
	ConfigFile string        `mapstructure:"config_file"`
	SystemLog  LogNodeConfig `mapstructure:"system"`
	BriefLog   LogNodeConfig `mapstructure:"brief"`
	EventLog   LogNodeConfig `mapstructure:"event"`
}

LogConfig the config of log module

type LogNodeConfig

type LogNodeConfig struct {
	LogLevelDefault string            `mapstructure:"log_level_default"`
	LogLevels       map[string]string `mapstructure:"log_levels"`
	FilePath        string            `mapstructure:"file_path"`
	MaxAge          int               `mapstructure:"max_age"`
	RotationTime    int               `mapstructure:"rotation_time"`
	RotationSize    int64             `mapstructure:"rotation_size"`
	LogInConsole    bool              `mapstructure:"log_in_console"`
	ShowColor       bool              `mapstructure:"show_color"`
}

LogNodeConfig the log config of node

Jump to

Keyboard shortcuts

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