single

package module
v0.0.0-...-92b7432 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2022 License: Apache-2.0 Imports: 23 Imported by: 1

README

txpool-single

介绍

hercules 链单笔交易池模块

软件架构

软件架构说明

安装教程
  1. xxxx
  2. xxxx
  3. xxxx
使用说明
  1. xxxx
  2. xxxx
  3. xxxx
参与贡献
  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request
特技
  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. Gitee 官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解 Gitee 上的优秀开源项目
  4. GVP 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
  5. Gitee 官方提供的使用手册 https://gitee.com/help
  6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 https://gitee.com/gitee-stars/

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

IsTxTimeVerify Whether transactions require validation

func MaxCommonTxPoolSize

func MaxCommonTxPoolSize() int

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,
	txFilter protocol.TxFilter,
	blockStore protocol.BlockchainStore,
	msgBus msgbus.MessageBus,
	conf protocol.ChainConf,
	ac protocol.AccessControlProvider,
	log protocol.Logger,
	monitorEnabled bool,
	poolConfig map[string]interface{}) (protocol.TxPool, error)

NewTxPoolImpl creates txPoolImpl

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