launcher

package
v0.0.0-...-34d0e24 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: MIT Imports: 84 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultCacheSize is calculated as memory consumption in a worst case scenario with default configuration
	// Average memory consumption might be 3-5 times lower than the maximum
	DefaultCacheSize  = 3600
	ConstantCacheSize = 1024
)
View Source
const (
	DefaultP2PPort  = 5050  // Default p2p port for listening
	DefaultHTTPPort = 18545 // Default TCP port for the HTTP RPC server
	DefaultWSPort   = 18546 // Default TCP port for the websocket RPC server
)

Variables

View Source
var (

	// DataDirFlag defines directory to store Lachesis state and user's wallets
	DataDirFlag = utils.DirectoryFlag{
		Name:  "datadir",
		Usage: "Data directory for the databases and keystore",
		Value: utils.DirectoryString(DefaultDataDir()),
	}

	CacheFlag = cli.IntFlag{
		Name:  "cache",
		Usage: "Megabytes of memory allocated to internal caching",
		Value: DefaultCacheSize,
	}
	// GenesisFlag specifies network genesis configuration
	GenesisFlag = cli.StringFlag{
		Name:  "genesis",
		Usage: "'path to genesis file' - sets the network genesis configuration.",
	}
	ExperimentalGenesisFlag = cli.BoolFlag{
		Name:  "genesis.allowExperimental",
		Usage: "Allow to use experimental genesis file.",
	}

	RPCGlobalGasCapFlag = cli.Uint64Flag{
		Name:  "rpc.gascap",
		Usage: "Sets a cap on gas that can be used in volary_call/estimateGas (0=infinite)",
		Value: gossip.DefaultConfig(cachescale.Identity).RPCGasCap,
	}
	RPCGlobalTxFeeCapFlag = cli.Float64Flag{
		Name:  "rpc.txfeecap",
		Usage: "Sets a cap on transaction fee (in volary) that can be sent via the RPC APIs (0 = no cap)",
		Value: gossip.DefaultConfig(cachescale.Identity).RPCTxFeeCap,
	}

	SyncModeFlag = cli.StringFlag{
		Name:  "syncmode",
		Usage: `Blockchain sync mode ("full" or "snap")`,
		Value: "full",
	}
	ExitWhenAgeFlag = cli.DurationFlag{
		Name:  "exitwhensynced.age",
		Usage: "Exits after synchronisation reaches the required age",
	}
	ExitWhenEpochFlag = cli.Uint64Flag{
		Name:  "exitwhensynced.epoch",
		Usage: "Exits after synchronisation reaches the required epoch",
	}
)
View Source
var (
	Bootnodes = map[string][]string{
		"main": {
			"enode://be2e97ef580b4835932ad7956ff039c62ba7e92735bb62ca6c7627064ca4a03688820c643b87df8d8ff442ccb7f41313d645ed01444bebf30efd7174b173eb23@172.105.183.170:5566",
			"enode://a2248c2359b858b5698f0cb5880badaec8ef1101729a4c18f57cd485a3a541b0bc848267be3d3cbb511d66919593c35c3948cc9760b0b89c79295a6584dee0fd@139.162.161.97:5050",
			"enode://349f106b2e0083e00013c1470721613b9dcb15d94db3b01bcc1c7d69c99a332f67ac76733aa032a54ac84d551010548b741c90831afe0245b2ef58db402d25f4@85.159.211.72:5050",
			"enode://c19eb328c146a32f15125343302f70e65a2b127b1042a01ab87d5996eef034f849f720dc985d4d8710b997a22b7111323be2f2f7622366606ba621a015eb7ae9@172.105.154.248:5050",
		},
		"test": {},
	}

	AllowedOperaGenesis = []GenesisTemplate{
		{
			Name:   "Mainnet-5577 with pruned MPT",
			Header: mainnetHeader,
			Hashes: genesis.Hashes{
				genesisstore.EpochsSection: hash.HexToHash("0xfca05fe92da9cdd1d3f10a73e1b7f552e4b401601f8f2ef25faa43b249b13d4b"),
				genesisstore.BlocksSection: hash.HexToHash("0xedf38b734737152b355a4043cae3a62372dc5e3208b7ee5c1763ce232253f254"),
				genesisstore.EvmSection:    hash.HexToHash("0x512343461b1b251314500e37515a160e56d705e0ce48533f5cf311a74120351d"),
			},
		},
		{
			Name:   "Mainnet-5577 with full MPT",
			Header: mainnetHeader,
			Hashes: genesis.Hashes{
				genesisstore.EpochsSection: hash.HexToHash("0xfca05fe92da9cdd1d3f10a73e1b7f552e4b401601f8f2ef25faa43b249b13d4b"),
				genesisstore.BlocksSection: hash.HexToHash("0xedf38b734737152b355a4043cae3a62372dc5e3208b7ee5c1763ce232253f254"),
				genesisstore.EvmSection:    hash.HexToHash("0x512343461b1b251314500e37515a160e56d705e0ce48533f5cf311a74120351d"),
			},
		},
	}
)

TODO: put enodes here

View Source
var (
	PruneExactCommand = cli.BoolFlag{
		Name:  "prune.exact",
		Usage: `full pruning without usage of bloom filter (false by default)`,
	}
	PruneGenesisCommand = cli.BoolTFlag{
		Name:  "prune.genesis",
		Usage: `prune genesis state (true by default)`,
	}
)
View Source
var AppHelpFlagGroups = calcAppHelpFlagGroups()

AppHelpFlagGroups is the application flags, grouped by functionality.

View Source
var (
	EvmExportMode = cli.StringFlag{
		Name:  "export.evm.mode",
		Usage: `EVM export mode ("full" or "ext-mpt" or "mpt" or "none")`,
		Value: "mpt",
	}
)
View Source
var FakeNetFlag = cli.StringFlag{
	Name:  "fakenet",
	Usage: "'n/N' - sets coinbase as fake n-th key from genesis of N validators.",
}

FakeNetFlag enables special testnet, where validators are automatically created

View Source
var NodeDefaultConfig = node.Config{
	DataDir:             DefaultDataDir(),
	HTTPPort:            DefaultHTTPPort,
	HTTPModules:         []string{},
	HTTPVirtualHosts:    []string{"localhost"},
	HTTPTimeouts:        rpc.DefaultHTTPTimeouts,
	WSPort:              DefaultWSPort,
	WSModules:           []string{},
	GraphQLVirtualHosts: []string{"localhost"},
	P2P: p2p.Config{
		NoDiscovery: false,
		DiscoveryV5: true,
		ListenAddr:  fmt.Sprintf(":%d", DefaultP2PPort),
		MaxPeers:    50,
		NAT:         nat.Any(),
	},
}

NodeDefaultConfig contains reasonable default settings.

Functions

func DefaultDataDir

func DefaultDataDir() string

DefaultDataDir is the default data directory to use for the databases and other persistence requirements.

func FindAccountKeypath

func FindAccountKeypath(addr common.Address, keydir string) (keypath string, err error)

func Launch

func Launch(args []string) error

Types

type GenesisTemplate

type GenesisTemplate struct {
	Name   string
	Header genesis.Header
	Hashes genesis.Hashes
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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