config

package
v0.0.0-...-376a440 Latest Latest
Warning

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

Go to latest
Published: May 10, 2020 License: LGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadYamlAsViper

func LoadYamlAsViper(configfile string) *viper.Viper

LoadYamlAsViper load yaml file as viper object

Types

type ACCConfig

type ACCConfig struct {
	ID        string
	SecKey    string
	Algorithm string
}

ACCConfig account of the system

type Config

type Config struct {
	ACC         *ACCConfig
	Genesis     string
	VM          *VMConfig
	DB          *DBConfig
	Snapshot    *SnapshotConfig
	P2P         *P2PConfig
	RPC         *RPCConfig
	Log         *LogConfig
	Metrics     *MetricsConfig
	Debug       *DebugConfig
	Version     *VersionConfig
	NativeToken string
}

Config provide all configuration for the application

func NewConfig

func NewConfig(configfile string) *Config

NewConfig returns a new instance of Config

func (*Config) YamlString

func (c *Config) YamlString() string

YamlString config to string

type ConsoleLogConfig

type ConsoleLogConfig struct {
	Level  string
	Enable bool
}

ConsoleLogConfig is the config for consolewriter of ilog.

type DBConfig

type DBConfig struct {
	LdbPath string
}

DBConfig config of the database

type DebugConfig

type DebugConfig struct {
	ListenAddr string
}

DebugConfig is the config of debug.

type FileLogConfig

type FileLogConfig struct {
	Path   string
	Level  string
	Enable bool
}

FileLogConfig is the config for filewriter of ilog.

type GenesisConfig

type GenesisConfig struct {
	CreateGenesis    bool
	InitialTimestamp string
	TokenInfo        *TokenInfo
	WitnessInfo      []*Witness
	ContractPath     string
	AdminInfo        *Witness
	FoundationInfo   *Witness
}

GenesisConfig config of the genesis bloc

type LogConfig

type LogConfig struct {
	FileLog           *FileLogConfig
	ConsoleLog        *ConsoleLogConfig
	AsyncWrite        bool
	EnableContractLog bool
}

LogConfig is the config of ilog.

type MetricsConfig

type MetricsConfig struct {
	PushAddr string
	Username string
	Password string
	Enable   bool
	ID       string
}

MetricsConfig is the config of metrics.

type P2PConfig

type P2PConfig struct {
	ListenAddr   string
	SeedNodes    []string
	ChainID      uint32
	Version      uint16
	DataPath     string
	InboundConn  int
	OutboundConn int
	BlackPID     []string
	BlackIP      []string
	AdminPort    string
}

P2PConfig is the config for p2p network.

type RPCConfig

type RPCConfig struct {
	Enable       bool
	GatewayAddr  string
	GRPCAddr     string
	AllowOrigins []string
	TryTx        bool
	ExecTx       bool
}

RPCConfig is the config for RPC Server.

type SnapshotConfig

type SnapshotConfig struct {
	Enable   bool
	FilePath string
}

SnapshotConfig is the config of snapshot

type TokenInfo

type TokenInfo struct {
	FoundationAccount string
	AIOUTotalSupply   int64
	AIOUDecimal       int64
}

TokenInfo config of the genesis block

type VMConfig

type VMConfig struct {
	JsPath   string
	LogLevel string
}

VMConfig config of the v8vm

type VersionConfig

type VersionConfig struct {
	NetName         string
	ProtocolVersion string
}

VersionConfig contrains netname(mainnet / testnet etc) and protocol info

type Witness

type Witness struct {
	ID             string
	Owner          string
	Active         string
	SignatureBlock string
	Balance        int64
}

Witness config of the genesis block

Jump to

Keyboard shortcuts

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