config

package
v0.0.0-...-f94ef0f Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package config contains neo-go-evm node configuration definition.

Index

Constants

This section is empty.

Variables

View Source
var Version string

Version the version of the node, set at build time.

Functions

This section is empty.

Types

type ApplicationConfiguration

type ApplicationConfiguration struct {
	Address           string                  `yaml:"Address"`
	AnnouncedNodePort uint16                  `yaml:"AnnouncedPort"`
	AttemptConnPeers  int                     `yaml:"AttemptConnPeers"`
	DBConfiguration   storage.DBConfiguration `yaml:"DBConfiguration"`
	DialTimeout       int64                   `yaml:"DialTimeout"`
	LogPath           string                  `yaml:"LogPath"`
	MaxPeers          int                     `yaml:"MaxPeers"`
	MinPeers          int                     `yaml:"MinPeers"`
	NodePort          uint16                  `yaml:"NodePort"`
	PingInterval      int64                   `yaml:"PingInterval"`
	PingTimeout       int64                   `yaml:"PingTimeout"`
	Pprof             metrics.Config          `yaml:"Pprof"`
	Prometheus        metrics.Config          `yaml:"Prometheus"`
	ProtoTickInterval int64                   `yaml:"ProtoTickInterval"`
	Relay             bool                    `yaml:"Relay"`
	RPC               rpc.Config              `yaml:"RPC"`
	UnlockWallet      Wallet                  `yaml:"UnlockWallet"`
	StateRoot         StateRoot               `yaml:"StateRoot"`
	// ExtensiblePoolSize is the maximum amount of the extensible payloads from a single sender.
	ExtensiblePoolSize int `yaml:"ExtensiblePoolSize"`
}

ApplicationConfiguration config specific to the node.

type Config

type Config struct {
	ProtocolConfiguration    ProtocolConfiguration    `yaml:"ProtocolConfiguration"`
	ApplicationConfiguration ApplicationConfiguration `yaml:"ApplicationConfiguration"`
}

Config top level struct representing the config for the node.

func Load

func Load(path string, chainId uint64) (Config, error)

Load attempts to load the config from the given path for the given netMode.

func LoadFile

func LoadFile(configPath string) (Config, error)

LoadFile loads config from the provided path.

func (Config) GenerateUserAgent

func (c Config) GenerateUserAgent() string

GenerateUserAgent creates user agent string based on build time environment.

type ProtocolConfiguration

type ProtocolConfiguration struct {
	// GarbageCollectionPeriod sets the number of blocks to wait before
	// starting the next MPT garbage collection cycle when RemoveUntraceableBlocks
	// option is used.
	GarbageCollectionPeriod uint32 `yaml:"GarbageCollectionPeriod"`

	ChainID     uint64 `yaml:"ChainID"`
	MemPoolSize int    `yaml:"MemPoolSize"`

	// InitialGASSupply is the amount of GAS generated in the genesis block.
	InitialGASSupply uint64 `yaml:"InitialGASSupply"`
	// KeepOnlyLatestState specifies if MPT should only store latest state.
	// If true, DB size will be smaller, but older roots won't be accessible.
	// This value should remain the same for the same database.
	KeepOnlyLatestState bool `yaml:"KeepOnlyLatestState"`
	// RemoveUntraceableBlocks specifies if old data should be removed.
	RemoveUntraceableBlocks bool `yaml:"RemoveUntraceableBlocks"`
	// MaxBlockSize is the maximum block size in bytes.
	MaxBlockSize uint32 `yaml:"MaxBlockSize"`
	// MaxBlockSystemFee is the maximum overall system fee per block.
	MaxBlockGas uint64 `yaml:"MaxBlockGas"`
	// MaxTraceableBlocks is the length of the chain accessible to smart contracts.
	MaxTraceableBlocks uint32 `yaml:"MaxTraceableBlocks"`
	// MaxTransactionsPerBlock is the maximum amount of transactions per block.
	MaxTransactionsPerBlock uint16 `yaml:"MaxTransactionsPerBlock"`
	// SaveStorageBatch enables storage batch saving before every persist.
	SaveStorageBatch     bool     `yaml:"SaveStorageBatch"`
	SecondsPerBlock      int      `yaml:"SecondsPerBlock"`
	SeedList             []string `yaml:"SeedList"`
	StandbyValidators    keys.PublicKeys
	StandbyValidatorsStr []string `yaml:"StandbyValidators"`
	// Whether to verify received blocks.
	VerifyBlocks bool `yaml:"VerifyBlocks"`
	// Whether to verify transactions in received blocks.
	VerifyTransactions bool `yaml:"VerifyTransactions"`

	MainNetwork                          uint32 `yaml:"MainNetwork"`
	MainStandbyStateValidatorsScriptHash string `yaml:"MainStandbyStateValidatorsScriptHash"`
	BridgeContractId                     int32  `yaml:"BridgeContractId"`
}

ProtocolConfiguration represents the protocol config.

func (*ProtocolConfiguration) GetNumOfCNs

func (p *ProtocolConfiguration) GetNumOfCNs(height uint32) int

GetNumOfCNs returns the number of validators for the given height. It implies valid configuration file.

func (*ProtocolConfiguration) Validate

func (p *ProtocolConfiguration) Validate() error

Validate checks ProtocolConfiguration for internal consistency and returns error if anything inappropriate found. Other methods can rely on protocol validity after this.

type StateRoot

type StateRoot struct {
	Enabled      bool   `yaml:"Enabled"`
	UnlockWallet Wallet `yaml:"UnlockWallet"`
}

StateRoot contains state root service configuration.

type Wallet

type Wallet struct {
	Path     string `yaml:"Path"`
	Password string `yaml:"Password"`
}

Wallet is a wallet info.

Directories

Path Synopsis
Package netmode contains well-known network magic numbers.
Package netmode contains well-known network magic numbers.

Jump to

Keyboard shortcuts

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