cli

package
v0.0.0-...-140c642 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package cli contains framework for building a command-line based turbo-geth node.

Index

Constants

This section is empty.

Variables

View Source
var (
	DatabaseFlag = cli.StringFlag{
		Name:  "database",
		Usage: "Which database software to use? Currently supported values: lmdb|mdbx",
		Value: "lmdb",
	}
	CacheSizeFlag = cli.StringFlag{
		Name:  "cacheSize",
		Usage: "Cache size for the execution stage",
		Value: "0",
	}
	BatchSizeFlag = cli.StringFlag{
		Name:  "batchSize",
		Usage: "Batch size for the execution stage",
		Value: "512M",
	}
	EtlBufferSizeFlag = cli.StringFlag{
		Name:  "etl.bufferSize",
		Usage: "Buffer size for ETL operations.",
		Value: etl.BufferOptimalSize.String(),
	}

	PrivateApiAddr = cli.StringFlag{
		Name:  "private.api.addr",
		Usage: "private api network address, for example: 127.0.0.1:9090, empty string means not to start the listener. do not expose to public network. serves remote database interface",
		Value: "",
	}

	StorageModeFlag = cli.StringFlag{
		Name: "storage-mode",
		Usage: `Configures the storage mode of the app:
* h - write history to the DB
* r - write receipts to the DB
* t - write tx lookup index to the DB`,
		Value: ethdb.DefaultStorageMode.ToString(),
	}
	SnapshotModeFlag = cli.StringFlag{
		Name: "snapshot.mode",
		Usage: `Configures the snapshot mode of the app:
* h - download headers snapshot
* b - download bodies snapshot
* s - download state snapshot
* r - download receipts snapshot
`,
		Value: snapshotsync.DefaultSnapshotMode.ToString(),
	}
	SeedSnapshotsFlag = cli.BoolTFlag{
		Name:  "snapshot.seed",
		Usage: `Seed snapshot seeding(default: true)`,
	}

	ExternalSnapshotDownloaderAddrFlag = cli.StringFlag{
		Name:  "snapshot.downloader.addr",
		Usage: `enable external snapshot downloader`,
	}

	// LMDB flags
	LMDBMapSizeFlag = cli.StringFlag{
		Name:  "lmdb.mapSize",
		Usage: "Sets Memory map size. Lower it if you have issues with opening the DB",
		Value: ethdb.LMDBDefaultMapSize.String(),
	}
	LMDBMaxFreelistReuseFlag = cli.UintFlag{
		Name:  "lmdb.maxFreelistReuse",
		Usage: "Find a big enough contiguous page range for large values in freelist is hard just allocate new pages and even don't try to search if value is bigger than this limit. Measured in pages.",
		Value: ethdb.LMDBDefaultMaxFreelistReuse,
	}

	// mTLS flags
	TLSFlag = cli.BoolFlag{
		Name:  "tls",
		Usage: "Enable TLS handshake",
	}
	TLSCertFlag = cli.StringFlag{
		Name:  "tls.cert",
		Usage: "Specify certificate",
		Value: "",
	}
	TLSKeyFlag = cli.StringFlag{
		Name:  "tls.key",
		Usage: "Specify key file",
		Value: "",
	}
	TLSCACertFlag = cli.StringFlag{
		Name:  "tls.cacert",
		Usage: "Specify certificate authority",
		Value: "",
	}
	SilkwormFlag = cli.StringFlag{
		Name:  "silkworm",
		Usage: "File path of libsilkworm_tg_api dynamic library (default = do not use Silkworm)",
		Value: "",
	}
)

DefaultFlags contains all flags that are used and supported by turbo-geth binary.

Functions

func ApplyFlagsForEthConfig

func ApplyFlagsForEthConfig(ctx *cli.Context, cfg *eth.Config)

func ApplyFlagsForNodeConfig

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

func MakeApp

func MakeApp(action func(*cli.Context), cliFlags []cli.Flag) *cli.App

MakeApp creates a cli application (based on `github.com/urlfave/cli` package). The application exits when `action` returns. Parameters: * action: the main function for the application. receives `*cli.Context` with parsed command-line flags. Returns no error, if some error could not be recovered from write to the log or panic. * cliFlags: the list of flags `cli.Flag` that the app should set and parse. By default, use `DefaultFlags()`. If you want to specify your own flag, use `append(DefaultFlags(), myFlag)` for this parameter.

Types

This section is empty.

Jump to

Keyboard shortcuts

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