flags

package
v0.3.1-0...-684a909 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HTTPPort = &cli.Uint64Flag{
		Name:     "http.port",
		Usage:    "Port to run http server on",
		Category: indexerCategory,
		Required: false,
		Value:    4102,
		EnvVars:  []string{"HTTP_PORT"},
	}
	CORSOrigins = &cli.StringFlag{
		Name:     "http.corsOrigins",
		Usage:    "Comma-delinated list of cors origins",
		Required: false,
		Value:    "*",
		Category: indexerCategory,
	}
)

optional flags

View Source
var (
	DatabaseUsername = &cli.StringFlag{
		Name:     "db.username",
		Usage:    "Database connection username",
		Required: true,
		Category: commonCategory,
		EnvVars:  []string{"DATABASE_USER"},
	}
	DatabasePassword = &cli.StringFlag{
		Name:     "db.password",
		Usage:    "Database connection password",
		Required: true,
		Category: commonCategory,
		EnvVars:  []string{"DATABASE_PASSWORD"},
	}
	DatabaseHost = &cli.StringFlag{
		Name:     "db.host",
		Usage:    "Database connection host",
		Required: true,
		Category: commonCategory,
		EnvVars:  []string{"DATABASE_HOST"},
	}
	DatabaseName = &cli.StringFlag{
		Name:     "db.name",
		Usage:    "Database connection name",
		Required: true,
		Category: commonCategory,
		EnvVars:  []string{"DATABASE_NAME"},
	}
)
View Source
var (
	DatabaseMaxIdleConns = &cli.Uint64Flag{
		Name:     "db.maxIdleConns",
		Usage:    "Database max idle connections",
		Value:    50,
		Category: commonCategory,
		EnvVars:  []string{"DATABASE_MAX_IDLE_CONNS"},
	}
	DatabaseMaxOpenConns = &cli.Uint64Flag{
		Name:     "db.maxOpenConns",
		Usage:    "Database max open connections",
		Value:    200,
		Category: commonCategory,
		EnvVars:  []string{"DATABASE_MAX_OPEN_CONNS"},
	}
	DatabaseConnMaxLifetime = &cli.Uint64Flag{
		Name:     "db.connMaxLifetime",
		Usage:    "Database connection max lifetime in seconds",
		Value:    10,
		Category: commonCategory,
		EnvVars:  []string{"DATABASE_CONN_MAX_LIFETIME"},
	}
	MetricsHTTPPort = &cli.Uint64Flag{
		Name:     "metrics.port",
		Usage:    "Port to run metrics http server on",
		Category: indexerCategory,
		Required: false,
		Value:    6061,
		EnvVars:  []string{"METRICS_HTTP_PORT"},
	}
	Layer = &cli.StringFlag{
		Name:     "layer",
		Usage:    "Which layer indexing is occurring on",
		Required: false,
		Value:    "l1",
		Category: indexerCategory,
		EnvVars:  []string{"LAYER"},
	}
)
View Source
var (
	GenesisDate = &cli.StringFlag{
		Name:     "genesisDate",
		Usage:    "Genesis date to start generating data from, YYYY-MM-DD",
		Required: true,
		Category: generatorCategory,
		EnvVars:  []string{"GENESIS_DATE"},
	}
	Regenerate = &cli.StringFlag{
		Name:     "regenerate",
		Usage:    "True to delete all existing data and regenerate from genesis, false to not",
		Required: false,
		Category: generatorCategory,
		EnvVars:  []string{"REGENERATE"},
	}
)
View Source
var (
	ETHClientTimeout = &cli.Uint64Flag{
		Name:     "ethClientTimeout",
		Usage:    "Timeout for eth client and contract binding calls",
		Category: indexerCategory,
		Required: false,
		Value:    10,
		EnvVars:  []string{"ETH_CLIENT_TIMEOUT"},
	}
	L1TaikoAddress = &cli.StringFlag{
		Name:     "l1TaikoAddress",
		Usage:    "Address of the TaikoL1 contract",
		Required: false,
		Category: indexerCategory,
		EnvVars:  []string{"L1_TAIKO_ADDRESS"},
	}
	BridgeAddress = &cli.StringFlag{
		Name:     "bridgeAddress",
		Usage:    "Address of the Bridge contract",
		Required: false,
		Category: indexerCategory,
		EnvVars:  []string{"BRIDGE_ADDRESS"},
	}
	BlockBatchSize = &cli.Uint64Flag{
		Name:     "blockBatchSize",
		Usage:    "Block batch size when iterating through blocks",
		Value:    10,
		Required: false,
		Category: indexerCategory,
		EnvVars:  []string{"BLOCK_BATCH_SIZE"},
	}
	SubscriptionBackoff = &cli.Uint64Flag{
		Name:     "subscriptionBackoff",
		Usage:    "Subscription backoff in seconds",
		Value:    30,
		Required: false,
		Category: indexerCategory,
		EnvVars:  []string{"SUBSCRIPTION_BACKOFF_IN_SECONDS"},
	}
	SyncMode = &cli.StringFlag{
		Name:     "syncMode",
		Usage:    "Mode of syncing. Pass in 'sync' to continue, and 'resync' to start from genesis again.",
		Value:    "sync",
		Category: indexerCategory,
		EnvVars:  []string{"SYNC_MODE"},
	}
	IndexNFTs = &cli.BoolFlag{
		Name:     "indexNfts",
		Usage:    "Whether to index nft transfer events or not",
		Required: false,
		Category: indexerCategory,
		EnvVars:  []string{"INDEX_NFTS"},
	}
	IndexERC20s = &cli.BoolFlag{
		Name:     "indexERC20s",
		Usage:    "Whether to index erc20 transfer events or not",
		Required: false,
		Category: indexerCategory,
		EnvVars:  []string{"INDEX_ERC20S"},
	}
)

optional flags

View Source
var (
	NumConfirmations = &cli.Uint64Flag{
		Name:     "tx.numConfirmations",
		Usage:    "Number of confirmations which we will wait after sending a transaction",
		Value:    1,
		Category: txmgrCategory,
	}
	SafeAbortNonceTooLowCount = &cli.Uint64Flag{
		Name: "tx.safeAbortNonceTooLowCount",
		Usage: "Number of ErrNonceTooLow observations required to give up on " +
			"a tx at a particular nonce without receiving confirmation",
		Value:    3,
		Category: txmgrCategory,
	}
	FeeLimitMultiplier = &cli.Uint64Flag{
		Name:     "tx.feeLimitMultiplier",
		Usage:    "The multiplier applied to fee suggestions to put a hard limit on fee increases",
		Value:    10,
		Category: txmgrCategory,
	}
	FeeLimitThreshold = &cli.Float64Flag{
		Name: "tx.feeLimitThreshold",
		Usage: "The minimum threshold (in GWei) at which fee bumping starts to be capped. " +
			"Allows arbitrary fee bumps below this threshold.",
		Value:    100.0,
		Category: txmgrCategory,
	}
	MinTipCap = &cli.Float64Flag{
		Name:     "tx.minTipCap",
		Usage:    "Enforces a minimum tip cap (in GWei) to use when determining tx fees. 1 GWei by default.",
		Value:    1.0,
		Category: txmgrCategory,
	}
	MinBaseFee = &cli.Float64Flag{
		Name:     "tx.minBaseFee",
		Usage:    "Enforces a minimum base fee (in GWei) to assume when determining tx fees. 1 GWei by default.",
		Value:    1.0,
		Category: txmgrCategory,
	}
	ResubmissionTimeout = &cli.DurationFlag{
		Name:     "tx.resubmissionTimeout",
		Usage:    "Duration we will wait before resubmitting a transaction to L1",
		Value:    48 * time.Second,
		Category: txmgrCategory,
	}
	TxSendTimeout = &cli.DurationFlag{
		Name:     "tx.sendTimeout",
		Usage:    "Timeout for sending transactions. If 0 it is disabled.",
		Value:    0,
		Category: txmgrCategory,
	}
	TxNotInMempoolTimeout = &cli.DurationFlag{
		Name:     "tx.notInMempoolTimeout",
		Usage:    "Timeout for aborting a tx send if the tx does not make it to the mempool.",
		Value:    2 * time.Minute,
		Category: txmgrCategory,
	}
	ReceiptQueryInterval = &cli.DurationFlag{
		Name:     "tx.receiptQueryInterval",
		Usage:    "Frequency to poll for receipts",
		Value:    12 * time.Second,
		Category: txmgrCategory,
	}
	TxGasLimit = &cli.Uint64Flag{
		Name:     "tx.gasLimit",
		Usage:    "Gas limit will be used for transactions (0 means using gas estimation)",
		Value:    0,
		Category: txmgrCategory,
	}
	RPCTimeout = &cli.DurationFlag{
		Name:     "rpc.timeout",
		Usage:    "Timeout in seconds for RPC calls",
		Category: commonCategory,
		Value:    12 * time.Second,
	}
)
View Source
var APIFlags = MergeFlags(CommonFlags, []cli.Flag{
	APIRPCUrl,
	HTTPPort,
	CORSOrigins,
})
View Source
var (
	APIRPCUrl = &cli.StringFlag{
		Name:     "rpcUrl",
		Usage:    "RPC URL for the source chain",
		Required: true,
		Category: commonCategory,
		EnvVars:  []string{"RPC_URL"},
	}
)

required flags

All common flags.

View Source
var GeneratorFlags = MergeFlags(CommonFlags, []cli.Flag{
	GenesisDate,
	Regenerate,
})
View Source
var (
	IndexerRPCUrl = &cli.StringFlag{
		Name:     "rpcUrl",
		Usage:    "RPC URL for the source chain",
		Required: true,
		Category: commonCategory,
		EnvVars:  []string{"RPC_URL"},
	}
)

required flags

Functions

func MergeFlags

func MergeFlags(groups ...[]cli.Flag) []cli.Flag

MergeFlags merges the given flag slices.

Types

This section is empty.

Jump to

Keyboard shortcuts

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