config

package
v0.0.0-...-77dcbbd Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package config provides config structure for engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadGenesisBlock

func ReadGenesisBlock(config *Config) (*blockchain.Block, error)

Types

type Config

type Config struct {
	System          *SystemConfig          `json:"system"`
	RPC             *RPCConfig             `json:"rpc"`
	TransactionPool *TransactionPoolConfig `json:"transactionPool"`
	Network         *NetworkConfig         `json:"network"`
	Genesis         *GenesisConfig         `json:"genesis"`
	Generator       *GeneratorConfig       `json:"generator"`
}

func (*Config) InsertDefault

func (c *Config) InsertDefault() error

func (*Config) Merge

func (c *Config) Merge(config *Config)

func (*Config) Validate

func (c *Config) Validate() error

type GeneratorConfig

type GeneratorConfig struct {
	Keys *KeysConfig `json:"keys"`
}

type GenesisBlockConfig

type GenesisBlockConfig struct {
	FromFile string    `json:"fromFile"`
	Blob     codec.Hex `json:"blob"`
}

type GenesisConfig

type GenesisConfig struct {
	Block               *GenesisBlockConfig `json:"block"`
	ChainID             codec.Hex           `json:"chainID"`
	BlockTime           uint32              `json:"blockTime"`
	MaxTransactionsSize uint32              `json:"maxTransactionsSize"`
	BFTBatchSize        uint32              `json:"bftBatchSize"`
}

func (*GenesisConfig) InsertDefault

func (c *GenesisConfig) InsertDefault() error

type KeysConfig

type KeysConfig struct {
	FromFile string `json:"fromFile"`
}

type NetworkConfig

type NetworkConfig struct {
	Addresses                []string `json:"addresses"`
	AllowIncomingConnections bool     `json:"allowIncomingConnections"`
	EnableNATService         bool     `json:"enableNATService,omitempty"`
	EnableUsingRelayService  bool     `json:"enableUsingRelayService"`
	EnableRelayService       bool     `json:"enableRelayService,omitempty"`
	EnableHolePunching       bool     `json:"enableHolePunching,omitempty"`
	SeedPeers                []string `json:"seedPeers"`
	FixedPeers               []string `json:"fixedPeers,omitempty"`
	BlacklistedIPs           []string `json:"blackListedIPs,omitempty"`
	MinNumOfConnections      int      `json:"minNumOfConnections"`
	MaxNumOfConnections      int      `json:"maxNumOfConnections"`
	// GossipSub configuration
	IsSeedPeer bool `json:"isSeedPeer,omitempty"`
}

Config type - a p2p configuration.

type RPCConfig

type RPCConfig struct {
	Modes []string `json:"modes"`
	Port  int      `json:"port"`
	Host  string   `json:"host"`
}

func (*RPCConfig) InsertDefault

func (c *RPCConfig) InsertDefault() error

func (*RPCConfig) Merge

func (c *RPCConfig) Merge(config *RPCConfig)

func (*RPCConfig) Validate

func (c *RPCConfig) Validate() error

type SystemConfig

type SystemConfig struct {
	Version              string `json:"version"`
	DataPath             string `json:"dataPath"`
	KeepEventsForHeights *int   `json:"keepEventsForHeights"`
	LogLevel             string `json:"logLevel"`
	MaxBlockCache        *int   `json:"maxBlockCache"`
}

func (SystemConfig) GetKeepEventsForHeights

func (c SystemConfig) GetKeepEventsForHeights() int

func (SystemConfig) GetMaxBlokckCache

func (c SystemConfig) GetMaxBlokckCache() int

func (*SystemConfig) InsertDefault

func (c *SystemConfig) InsertDefault() error

func (*SystemConfig) Merge

func (c *SystemConfig) Merge(config *SystemConfig)

func (SystemConfig) Validate

func (c SystemConfig) Validate() error

type TransactionPoolConfig

type TransactionPoolConfig struct {
	MaxTransactions             int    `json:"maxTransactions"`
	MaxTransactionsPerAccount   int    `json:"maxTransactionsPerAccount"`
	TransactionExpiryTime       int    `json:"transactionExpiryTime"`
	MinEntranceFeePriority      uint64 `json:"minEntranceFeePriority,string"`
	MinReplacementFeeDifference uint64 `json:"minReplacementFeeDifference,string"`
}

func (*TransactionPoolConfig) InsertDefault

func (c *TransactionPoolConfig) InsertDefault() error

Jump to

Keyboard shortcuts

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