nodeconfig

package
v2.11.3-rc2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultNodeConfig = Config{
	IPCPath:     "gvite.ipc",
	DataDir:     DefaultDataDir(),
	KeyStoreDir: DefaultDataDir(),
	HttpPort:    common.DefaultHTTPPort,
	WSPort:      common.DefaultWSPort,

	LogLevel:      "info",
	HTTPCors:      []string{"*"},
	WSOrigins:     []string{"*"},
	WSExposeAll:   true,
	HttpExposeAll: true,

	Single:          config.DefaultSingle,
	Identity:        config.DefaultNodeName,
	NetID:           config.DefaultNetID,
	ListenInterface: config.DefaultListenInterface,
	Port:            config.DefaultPort,
	FilePort:        config.DefaultFilePort,
	Discover:        config.DefaultDiscover,
	MaxPeers:        config.DefaultMaxPeers,
	MaxInboundRatio: config.DefaultMaxInboundRatio,
	MinPeers:        config.DefaultMinPeers,
	MaxPendingPeers: config.DefaultMaxPendingPeers,
	ForwardStrategy: config.DefaultForwardStrategy,
	AccessControl:   config.DefaultAccessControl,
}

Functions

func DefaultDataDir

func DefaultDataDir() string

DefaultDataDir is the default data directory to use for the databases and other persistence requirements.

Types

type Config

type Config struct {
	NetSelect string

	DataDir string `json:"DataDir"`

	KeyStoreDir string `json:"KeyStoreDir"`

	// chain
	LedgerGcRetain uint64          `json:"LedgerGcRetain"`
	LedgerGc       *bool           `json:"LedgerGc"`
	OpenPlugins    *bool           `json:"OpenPlugins"`
	VmLogWhiteList []types.Address `json:"vmLogWhiteList"` // contract address white list which save VM logs
	VmLogAll       *bool           `json:"vmLogAll"`       // save all VM logs, it will cost more disk space

	// genesis
	GenesisFile string `json:"GenesisFile"`

	// net
	Single             bool
	ListenInterface    string
	Port               int
	FilePort           int
	PublicAddress      string
	FilePublicAddress  string
	Identity           string
	NetID              int
	PeerKey            string `json:"PrivateKey"`
	Discover           bool
	MaxPeers           int
	MinPeers           int
	MaxInboundRatio    int
	MaxPendingPeers    int
	BootNodes          []string
	BootSeeds          []string
	StaticNodes        []string
	AccessControl      string
	AccessAllowKeys    []string
	AccessDenyKeys     []string
	BlackBlockHashList []string // from high to low, like: "xxxxxx-11111"
	WhiteBlockList     []string // from high to low, like: "xxxxxx-10001"
	ForwardStrategy    string

	//producer
	EntropyStorePath     string `json:"EntropyStorePath"`
	EntropyStorePassword string `json:"EntropyStorePassword"`
	CoinBase             string `json:"CoinBase"`
	MinerEnabled         bool   `json:"Miner"`

	//rpc
	RPCEnabled  bool  `json:"RPCEnabled"`
	IPCEnabled  bool  `json:"IPCEnabled"`
	WSEnabled   bool  `json:"WSEnabled"`
	TxDexEnable *bool `json:"TxDexEnable"`

	IPCPath          string   `json:"IPCPath"`
	HttpHost         string   `json:"HttpHost"`
	HttpPort         int      `json:"HttpPort"`
	HttpVirtualHosts []string `json:"HttpVirtualHosts"`
	WSHost           string   `json:"WSHost"`
	WSPort           int      `json:"WSPort"`

	HTTPCors            []string `json:"HTTPCors"`
	WSOrigins           []string `json:"WSOrigins"`
	PublicModules       []string `json:"PublicModules"`
	WSExposeAll         bool     `json:"WSExposeAll"`
	HttpExposeAll       bool     `json:"HttpExposeAll"`
	TestTokenHexPrivKey string   `json:"TestTokenHexPrivKey"`
	TestTokenTti        string   `json:"TestTokenTti"`

	PowServerUrl string `json:"PowServerUrl"`

	//Log level
	LogLevel    string `json:"LogLevel"`
	ErrorLogDir string `json:"ErrorLogDir"`

	//VM
	VMTestEnabled         bool `json:"VMTestEnabled"`
	VMTestParamEnabled    bool `json:"VMTestParamEnabled"`
	QuotaTestParamEnabled bool `json:"QuotaTestParamEnabled"`
	VMDebug               bool `json:"VMDebug"`

	// subscribe
	SubscribeEnabled bool `json:"SubscribeEnabled"`

	// dashboard
	DashboardTargetURL string

	// reward
	RewardAddr string `json:"RewardAddr"`

	//metrics
	MetricsEnable    *bool   `json:"MetricsEnable"`
	InfluxDBEnable   *bool   `json:"InfluxDBEnable"`
	InfluxDBEndpoint *string `json:"InfluxDBEndpoint"`
	InfluxDBDatabase *string `json:"InfluxDBDatabase"`
	InfluxDBUsername *string `json:"InfluxDBUsername"`
	InfluxDBPassword *string `json:"InfluxDBPassword"`
	InfluxDBHostTag  *string `json:"InfluxDBHostTag"`
}

func (*Config) DataDirPathAbs

func (c *Config) DataDirPathAbs() error

resolve the dataDir so future changes to the current working directory don't affect the node

func (*Config) GetPrivateKey

func (c *Config) GetPrivateKey() ed25519.PrivateKey

func (*Config) HTTPEndpoint

func (c *Config) HTTPEndpoint() string

func (*Config) IPCEndpoint

func (c *Config) IPCEndpoint() string

func (*Config) MakeChainConfig

func (c *Config) MakeChainConfig() *config.Chain

func (*Config) MakeMinerConfig

func (c *Config) MakeMinerConfig() *config.Producer

func (*Config) MakeNetConfig

func (c *Config) MakeNetConfig() *config.Net

func (*Config) MakeRewardConfig

func (c *Config) MakeRewardConfig() *config.NodeReward

func (*Config) MakeSubscribeConfig

func (c *Config) MakeSubscribeConfig() *config.Subscribe

func (*Config) MakeViteConfig

func (c *Config) MakeViteConfig() *config.Config

func (*Config) MakeVmConfig

func (c *Config) MakeVmConfig() *config.Vm

func (*Config) MakeWalletConfig

func (c *Config) MakeWalletConfig() *config.Wallet

func (*Config) ParseFromFile

func (c *Config) ParseFromFile(filename string) error

func (*Config) RunLogDir

func (c *Config) RunLogDir() string

func (*Config) SetPrivateKey

func (c *Config) SetPrivateKey(privateKey string)

func (*Config) WSEndpoint

func (c *Config) WSEndpoint() string

Jump to

Keyboard shortcuts

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