localconf

package module
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2022 License: Apache-2.0 Imports: 13 Imported by: 16

Documentation

Overview

Package localconf record all the values of the local config options.

Index

Constants

View Source
const (
	DefaultRpcMaxSendMsgSize = 10 * 1024 * 1024 // 10 MiB
	DefaultRpcMaxRecvMsgSize = 10 * 1024 * 1024 // 10 MiB
)

Variables

View Source
var (

	// FindNewBlockChainNotifyC is the chan for finding new block chain configs.
	FindNewBlockChainNotifyC = make(chan string)
	// ChainMakerConfig is the CMConfig instance for global.
	ChainMakerConfig = &CMConfig{StorageConfig: map[string]interface{}{}}
)
View Source
var (
	//ConfigFilepath 配置文件的路径,默认为当前文件夹的chainmaker.yml文件
	ConfigFilepath = "./chainmaker.yml"
)

Functions

func CheckNewCmBlockChainConfig

func CheckNewCmBlockChainConfig() error

func InitLocalConfig

func InitLocalConfig(cmd *cobra.Command) error

InitLocalConfig init local config.

func RefreshLogLevelsConfig

func RefreshLogLevelsConfig() error

RefreshLogLevelsConfig refresh the levels of the loggers with the logger config file.

func UpdateDebugConfig

func UpdateDebugConfig(pairs []*config.ConfigKeyValue) error

UpdateDebugConfig refresh the switches of the debug mode.

Types

type BlockchainConfig

type BlockchainConfig struct {
	ChainId string
	Genesis string
}

type CMConfig

type CMConfig struct {
	AuthType         string                 `mapstructure:"auth_type"`
	LogConfig        logger.LogConfig       `mapstructure:"log"`
	NetConfig        netConfig              `mapstructure:"net"`
	NodeConfig       nodeConfig             `mapstructure:"node"`
	RpcConfig        rpcConfig              `mapstructure:"rpc"`
	BlockChainConfig []BlockchainConfig     `mapstructure:"blockchain"`
	ConsensusConfig  ConsensusConfig        `mapstructure:"consensus"`
	StorageConfig    map[string]interface{} `mapstructure:"storage"`
	TxPoolConfig     map[string]interface{} `mapstructure:"txpool"`
	SyncConfig       syncConfig             `mapstructure:"sync"`
	VMConfig         map[string]interface{} `mapstructure:"vm"`
	CryptoEngine     string                 `mapstructure:"crypto_engine"`

	// 开发调试使用
	DebugConfig     debugConfig     `mapstructure:"debug"`
	PProfConfig     pprofConfig     `mapstructure:"pprof"`
	MonitorConfig   monitorConfig   `mapstructure:"monitor"`
	CoreConfig      coreConfig      `mapstructure:"core"`
	SchedulerConfig schedulerConfig `mapstructure:"scheduler"`
	// contains filtered or unexported fields
}

CMConfig - Local config struct

func (*CMConfig) Deal added in v2.2.0

func (c *CMConfig) Deal()

Deal deal and set the default configuration parameters

func (*CMConfig) GetBlockChains

func (c *CMConfig) GetBlockChains() []BlockchainConfig

GetBlockChains - get blockchain config list

func (*CMConfig) GetP11Handle

func (c *CMConfig) GetP11Handle() (*pkcs11.P11Handle, error)

func (*CMConfig) GetStorePath

func (c *CMConfig) GetStorePath() string

func (*CMConfig) PrettyJson

func (c *CMConfig) PrettyJson() (string, error)

PrettyJson print with json.

func (*CMConfig) SetNodeId

func (c *CMConfig) SetNodeId(nodeId string)

SetNodeId - 设置NodeId

type ConsensusConfig

type ConsensusConfig struct {
	RaftConfig raftConfig `mapstructure:"raft"`
}

Jump to

Keyboard shortcuts

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