app

package
v0.0.7-alphanet Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PprofFlag = cli.BoolFlag{
		Name:  "pprof",
		Usage: "Enable the pprof HTTP server",
	}
	PprofPortFlag = cli.Uint64Flag{
		Name:  "pprof.port",
		Usage: "pprof HTTP server listening port",
		Value: 6060,
	}

	PprofAddrFlag = cli.StringFlag{
		Name:  "pprof.addr",
		Usage: "pprof HTTP server listening interface",
		Value: "127.0.0.1",
	}

	ConfigFileFlag = cli.StringFlag{
		Name:  "config",
		Usage: "Node configuration file in JSON format",
		Value: "DataPath/config.json",
	}

	DataPathFlag = cli.StringFlag{
		Name:  "data",
		Usage: "Path to the main zenon data folder. Used for store all files.",
		Value: node.DefaultDataDir(),
	}
	WalletDirFlag = cli.StringFlag{
		Name:  "wallet",
		Usage: "Directory for the wallet.",
		Value: "DataPath/wallet",
	}
	GenesisFileFlag = cli.StringFlag{
		Name:  "genesis",
		Usage: "Path to genesis file. Used to override embedded genesis from the binary source-code.",
		Value: "DataPath/genesis.json",
	}
	IdentityFlag = cli.StringFlag{
		Name:  "name",
		Usage: "Node's name. Visible in the network.",
	}

	ListenHostFlag = cli.StringFlag{
		Name:  "host",
		Usage: "Network listening host",
		Value: p2p.DefaultListenHost,
	}
	ListenPortFlag = cli.IntFlag{
		Name:  "port",
		Usage: "Network listening port",
		Value: p2p.DefaultListenPort,
	}
	MaxPeersFlag = cli.UintFlag{
		Name:  "max-peers",
		Usage: "Maximum number of network peers (network disabled if set to 0)",
		Value: p2p.DefaultMaxPeers,
	}
	MaxPendingPeersFlag = cli.UintFlag{
		Name:  "max-pending-peers",
		Usage: "Maximum number of db connection attempts (defaults used if set to 0)",
		Value: p2p.DefaultMaxPeers,
	}

	RPCEnabledFlag = cli.BoolFlag{
		Name:  "http",
		Usage: "Enable the HTTP-RPC server",
	}
	RPCListenAddrFlag = cli.StringFlag{
		Name:  "http-addr",
		Usage: "HTTP-RPC server listening interface",
	}
	RPCPortFlag = cli.IntFlag{
		Name:  "http-port",
		Usage: "HTTP-RPC server listening port",
		Value: p2p.DefaultHTTPPort,
	}
	WSEnabledFlag = cli.BoolFlag{
		Name:  "ws",
		Usage: "Enable the WS-RPC server",
	}
	WSListenAddrFlag = cli.StringFlag{
		Name:  "ws-addr",
		Usage: "WS-RPC server listening interface",
	}
	WSPortFlag = cli.IntFlag{
		Name:  "ws-port",
		Usage: "WS-RPC server listening port",
		Value: p2p.DefaultWSPort,
	}

	LogLvlFlag = cli.StringFlag{
		Name:  "loglevel",
		Usage: "log level (info,error,warn,debug)",
	}

	AllFlags = []cli.Flag{

		ConfigFileFlag,

		PprofFlag,
		PprofPortFlag,
		PprofAddrFlag,

		DataPathFlag,
		WalletDirFlag,
		GenesisFileFlag,
		IdentityFlag,

		ListenHostFlag,
		ListenPortFlag,
		MaxPeersFlag,
		MaxPendingPeersFlag,

		RPCEnabledFlag,
		RPCListenAddrFlag,
		RPCPortFlag,

		WSEnabledFlag,
		WSListenAddrFlag,
		WSPortFlag,

		LogLvlFlag,
	}
)

Functions

func MakeConfig

func MakeConfig(ctx *cli.Context) (*node.Config, error)

func Run

func Run()

func Stop

func Stop()

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewNodeManager

func NewNodeManager(ctx *cli.Context) (*Manager, error)

func (*Manager) Start

func (nodeManager *Manager) Start() error

func (*Manager) Stop

func (nodeManager *Manager) Stop() error

Jump to

Keyboard shortcuts

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