utils

package
v0.0.0-...-8e9f79f Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2018 License: LGPL-3.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// RPC settings
	RPCEnabledFlag = cli.BoolFlag{
		Name:  "rpc",
		Usage: "Enable the HTTP-RPC server",
	}
	RPCListenAddrFlag = cli.StringFlag{
		Name:  "rpcaddr",
		Usage: "HTTP-RPC server listening interface",
		Value: node.DefaultHTTPHost,
	}
	RPCPortFlag = cli.IntFlag{
		Name:  "rpcport",
		Usage: "HTTP-RPC server listening port",
		Value: node.DefaultHTTPPort,
	}
	RPCCORSDomainFlag = cli.StringFlag{
		Name:  "rpccorsdomain",
		Usage: "Comma separated list of domains from which to accept cross origin requests (browser enforced)",
		Value: "",
	}
	RPCVirtualHostsFlag = cli.StringFlag{
		Name:  "rpcvhosts",
		Usage: "Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard.",
		Value: strings.Join(node.DefaultConfig.HTTPVirtualHosts, ","),
	}
	RPCApiFlag = cli.StringFlag{
		Name:  "rpcapi",
		Usage: "API's offered over the HTTP-RPC interface",
		Value: "",
	}

	WSEnabledFlag = cli.BoolFlag{
		Name:  "ws",
		Usage: "Enable the WS-RPC server",
	}
	WSListenAddrFlag = cli.StringFlag{
		Name:  "wsaddr",
		Usage: "WS-RPC server listening interface",
		Value: node.DefaultWSHost,
	}
	WSPortFlag = cli.IntFlag{
		Name:  "wsport",
		Usage: "WS-RPC server listening port",
		Value: node.DefaultWSPort,
	}
	WSApiFlag = cli.StringFlag{
		Name:  "wsapi",
		Usage: "API's offered over the WS-RPC interface",
		Value: "",
	}
	WSAllowedOriginsFlag = cli.StringFlag{
		Name:  "wsorigins",
		Usage: "Origins from which to accept websockets requests",
		Value: "",
	}

	IdentityFlag = cli.StringFlag{
		Name:  "identity",
		Usage: "Custom node name",
	}

	// 采集 https://ethgasstation.info/json
	Ethgasstation = cli.BoolFlag{
		Name:  "ethgasstation",
		Usage: "Enable crawling https://ethgasstation.info/json",
	}

	// NSQ
	NSQNslookupHostFlag = cli.StringFlag{
		Name:  "nsqnslookup",
		Usage: "nsq nsqlookupd host",
		Value: ews.DefaultNSQNslookupHost,
	}

	NSQNslookupIntervalFlag = cli.Int64Flag{
		Name:  "nsqnslookupinterval",
		Usage: "nsqLookupInterval x seconds",
		Value: ews.DefaultNSQNslookupInterval,
	}
)
View Source
var (
	CommandHelpTemplate = `` /* 471-byte string literal not displayed */

)

Functions

func Fatalf

func Fatalf(format string, args ...interface{})

func MigrateFlags

func MigrateFlags(action func(ctx *cli.Context) error) func(*cli.Context) error

MigrateFlags sets the global flag from a local flag when it's set. This is a temporary function used for migrating old command/flags to the new format.

e.g. geth account new --keystore /tmp/mykeystore --lightkdf

is equivalent after calling this method with:

geth --keystore /tmp/mykeystore --lightkdf account new

This allows the use of the existing configuration functionality. When all flags are migrated this function can be removed and the existing configuration functionality must be changed that is uses local flags

func NewApp

func NewApp(gitCommit, usage string) *cli.App

NewApp creates an app with sane defaults.

func RegisterEwsService

func RegisterEwsService(stack *node.Node, cfg *ews.Config)

RegisterEthService adds an Ethereum client to the stack.

func SetEwsConfig

func SetEwsConfig(ctx *cli.Context, cfg *ews.Config)

func SetNSQ

func SetNSQ(ctx *cli.Context, cfg *ews.Config)

func SetNodeConfig

func SetNodeConfig(ctx *cli.Context, cfg *node.Config)

SetNodeConfig applies node-related command line flags to the config.

func StartNode

func StartNode(stack *node.Node)

Types

This section is empty.

Jump to

Keyboard shortcuts

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