config

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: ISC Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDataDirname = "crawler-data"
	DefaultPort        = "1024"
	DefaultRpcPort     = "2024"
	DefaultIP          = "0.0.0.0"
	DefaultDB          = DefaultDataDirname + "/db"
)

Variables

View Source
var (
	Conf = &Config{}

	HomeDir = &cli.StringFlag{
		Name:        "appdata",
		Aliases:     []string{"A"},
		Usage:       "Path to application home directory",
		Value:       defaultHomeDir,
		Destination: &Conf.HomeDir,
	}
	DataDir = &cli.StringFlag{
		Name:        "datadir",
		Aliases:     []string{"b"},
		Usage:       "Directory to store data",
		Value:       defaultDataDir,
		Destination: &Conf.DataDir,
	}

	PrivateKey = &cli.StringFlag{
		Name:        "privatekey",
		Aliases:     []string{"p"},
		Usage:       "private key",
		Destination: &Conf.PrivateKey,
	}

	ExternalIP = &cli.StringFlag{
		Name:        "externalip",
		Aliases:     []string{"i"},
		Usage:       "listen external ip",
		Destination: &Conf.ExternalIP,
	}

	Port = &cli.StringFlag{
		Name:        "port",
		Aliases:     []string{"o"},
		Usage:       "listen port",
		Value:       DefaultPort,
		Destination: &Conf.Port,
	}

	EnableNoise = &cli.BoolFlag{
		Name:        "noise",
		Aliases:     []string{"n"},
		Usage:       "noise",
		Value:       false,
		Destination: &Conf.EnableNoise,
	}

	Network = &cli.StringFlag{
		Name:        "network",
		Aliases:     []string{"e"},
		Usage:       "Network {mainnet,mixnet,privnet,testnet}",
		Value:       params.MixNetParam.Name,
		Destination: &Conf.Network,
	}

	RpcUser = &cli.StringFlag{
		Name:        "rpcuser",
		Aliases:     []string{"u"},
		Usage:       "rpc user",
		Value:       "admin",
		Destination: &Conf.RPCUser,
	}

	RpcPass = &cli.StringFlag{
		Name:        "rpcpass",
		Aliases:     []string{"s"},
		Usage:       "rpc pass",
		Value:       "123",
		Destination: &Conf.RPCPass,
	}

	RPCMaxClients = &cli.IntFlag{
		Name:        "rpcmaxclients",
		Aliases:     []string{"m"},
		Usage:       "rpc max clients",
		Value:       100,
		Destination: &Conf.RPCMaxClients,
	}

	AppFlags = []cli.Flag{
		HomeDir,
		DataDir,
		PrivateKey,
		ExternalIP,
		Port,
		EnableNoise,
		Network,
		RpcUser,
		RpcPass,
		RPCMaxClients,
	}
)

Functions

This section is empty.

Types

type Config

type Config struct {
	HomeDir           string
	DataDir           string
	PrivateKey        string
	ExternalIP        string
	Port              string
	EnableNoise       bool
	Network           string
	StaticPeers       []string
	BootstrapNodeAddr []string
	RPCUser           string
	RPCPass           string
	RPCListeners      []string
	RPCMaxClients     int
}

func (*Config) Load

func (c *Config) Load() error

Jump to

Keyboard shortcuts

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