config

package
v0.0.0-...-acf744c Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommandImportWallet      = "importwallet"
	CommandExportWallet      = "exportwallet"
	CommandDumpBlockchain    = "dumpblockchain"
	CommandRestoreBlockchain = "restoreblockchain"
)
View Source
const Daemonprocesscommandline = "daemonnode"

other internal constant

View Source
const MinimumBlockBuildingTime = 3 // seconds

========================================================== Testing mode constants we need this for testing purposes. can be set to 0 on production system

View Source
const PidFileName = "server.pid"

File names

Variables

This section is empty.

Functions

This section is empty.

Types

type AllPossibleArgs

type AllPossibleArgs struct {
	AppName             string
	Address             string
	From                string
	To                  string
	Port                int
	Host                string
	NodePort            int
	NodeHost            string
	NodeAddress         string
	DefaultAddresses    string
	Genesis             string
	Amount              float64
	LogDest             string
	LogDestDefault      bool // to know if logs destination was specified or not
	Transaction         string
	View                string
	Clean               bool
	MySQLHost           string
	MySQLPort           int
	MySQLSocket         string
	MySQLUser           string
	MySQLPassword       string
	MySQLDBName         string
	DBTablesPrefix      string
	DumpFile            string
	DestinationFile     string
	SQL                 string
	ConsensusFileToCopy string
	FilePath            string
	AllowNonEmpty       bool
	Trace               bool
}

Thi is the struct with all possible command line arguments

type AppConfig

type AppConfig struct {
	Minter          string
	ProxyKey        string
	Port            int
	Host            string
	LocalPort       int
	Nodes           []net.NodeAddr
	Logs            []string
	LogsDestination string
	Database        database.DatabaseConfig
	DBProxyAddress  string
}

type AppInput

type AppInput struct {
	Command                    string
	MinterAddress              string
	ProxyKey                   string
	Logs                       string
	Port                       int
	LocalPort                  int
	Host                       string
	ConfigDir                  string
	Nodes                      []net.NodeAddr
	Args                       AllPossibleArgs
	Database                   database.DatabaseConfig
	DBProxyAddress             string
	ConseususConfigFile        string
	ConseususConfigFilePresent bool
}

Input summary

func GetAppInput

func GetAppInput() (AppInput, error)

Parses input and config file. Command line arguments ovverride config file options

func GetAppInputFromDir

func GetAppInputFromDir(dirpath string) (AppInput, error)

func (AppInput) CheckConfigUpdateNeeded

func (c AppInput) CheckConfigUpdateNeeded() bool

func (AppInput) CheckNeedsHelp

func (c AppInput) CheckNeedsHelp() bool

func (AppInput) CommandNeedsConfig

func (c AppInput) CommandNeedsConfig() bool

check if this commands really needs a config file

func (AppInput) GetConfig

func (c AppInput) GetConfig() (*AppConfig, error)

func (AppInput) PrintUsage

func (c AppInput) PrintUsage()

func (AppInput) UpdateConfig

func (c AppInput) UpdateConfig() error

Jump to

Keyboard shortcuts

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