flags

package
v0.3.1-0...-ee1233d Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 1 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,
		Value:    4102,
		EnvVars:  []string{"HTTP_PORT"},
	}
	CORSOrigins = &cli.StringFlag{
		Name:     "http.corsOrigins",
		Usage:    "Comma-delinated list of cors origins",
		Category: indexerCategory,
		Value:    "*",
		EnvVars:  []string{"HTTP_CORS_ORIGINS"},
	}
)

optional

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"},
	}
	SrcRPCUrl = &cli.StringFlag{
		Name:     "srcRpcUrl",
		Usage:    "RPC URL for the source chain",
		Required: true,
		Category: commonCategory,
		EnvVars:  []string{"SRC_RPC_URL"},
	}
	DestRPCUrl = &cli.StringFlag{
		Name:     "destRpcUrl",
		Usage:    "RPC URL for the destination chain",
		Required: true,
		Category: commonCategory,
		EnvVars:  []string{"DEST_RPC_URL"},
	}
)
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: commonCategory,
		Value:    6061,
		EnvVars:  []string{"METRICS_HTTP_PORT"},
	}
	ETHClientTimeout = &cli.Uint64Flag{
		Name:     "ethClientTimeout",
		Usage:    "Timeout for eth client and contract binding calls",
		Category: commonCategory,
		Value:    10,
		EnvVars:  []string{"ETH_CLIENT_TIMEOUT"},
	}
	SrcSignalServiceAddress = &cli.StringFlag{
		Name:     "srcSignalServiceAddress",
		Usage:    "SignalService address for the source chain",
		Category: commonCategory,
		EnvVars:  []string{"SRC_SIGNAL_SERVICE_ADDRESS"},
	}
	BackOffRetryInterval = &cli.Uint64Flag{
		Name:     "backoff.retryInterval",
		Usage:    "Retry interval in seconds when there is an error",
		Category: processorCategory,
		Value:    12,
	}
	BackOffMaxRetrys = &cli.Uint64Flag{
		Name:     "backoff.maxRetrys",
		Usage:    "Max retry times when there is an error",
		Category: processorCategory,
		Value:    3,
	}
)
View Source
var (
	SrcBridgeAddress = &cli.StringFlag{
		Name:     "srcBridgeAddress",
		Usage:    "Bridge address on the source chain",
		Required: true,
		Category: indexerCategory,
		EnvVars:  []string{"SRC_BRIDGE_ADDRESS"},
	}
	DestBridgeAddress = &cli.StringFlag{
		Name:     "destBridgeAddress",
		Usage:    "Bridge address for the destination chain",
		Required: true,
		Category: commonCategory,
		EnvVars:  []string{"DEST_BRIDGE_ADDRESS"},
	}
)
View Source
var (
	BlockBatchSize = &cli.Uint64Flag{
		Name:     "blockBatchSize",
		Usage:    "Block batch size when iterating through blocks",
		Value:    10,
		Category: indexerCategory,
		EnvVars:  []string{"BLOCK_BATCH_SIZE"},
	}
	MaxNumGoroutines = &cli.Uint64Flag{
		Name:     "maxNumGoroutines",
		Usage:    "Max number of goroutines to spawn simultaneously when indexing",
		Value:    10,
		Category: indexerCategory,
		EnvVars:  []string{"NUM_GOROUTINES"},
	}
	SubscriptionBackoff = &cli.Uint64Flag{
		Name:     "subscriptionBackoff",
		Usage:    "Subscription backoff in seconds",
		Value:    30,
		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"},
	}
	WatchMode = &cli.StringFlag{
		Name: "watchMode",
		Usage: `Mode of watching the chain. Options are:
		filter: only filter the chain, when caught up, exit
		subscribe: do not filter the chain, only subscribe to new events
		filter-and-subscribe: the default behavior, filter the chain and subscribe when caught up
		crawl-past-blocks: crawl past blocks
		`,
		Value:    "filter-and-subscribe",
		Category: indexerCategory,
		EnvVars:  []string{"WATCH_MODE"},
	}
	SrcTaikoAddress = &cli.StringFlag{
		Name:     "srcTaikoAddress",
		Usage:    "Taiko address on the source chain, required if L1=>L2, not if L2=>L1",
		Category: indexerCategory,
		EnvVars:  []string{"SRC_TAIKO_ADDRESS"},
	}
	NumLatestBlocksToIgnoreWhenCrawling = &cli.Uint64Flag{
		Name:     "numLatestBlocksToIgnoreWhenCrawling",
		Usage:    "Number of blocks to ingore when crawling chain, should be higher for L2-L1 indexing due to delay",
		Value:    1000,
		Category: indexerCategory,
		EnvVars:  []string{"NUM_LATEST_BLOCKS_TO_IGNORE_WHEN_CRAWLING"},
	}
	EventName = &cli.StringFlag{
		Name:     "event",
		Usage:    "Type of event to index, ie: MessageSent, MessageReceived",
		Category: indexerCategory,
		EnvVars:  []string{"EVENT_NAME"},
	}
	TargetBlockNumber = &cli.Uint64Flag{
		Name:     "targetBlockNumber",
		Usage:    "Specify the target block number to process transactions in",
		Required: false,
		Category: indexerCategory,
		EnvVars:  []string{"TARGET_BLOCK_NUMBER"},
	}
)

optional

View Source
var (
	ProcessorPrivateKey = &cli.StringFlag{
		Name:     "processorPrivateKey",
		Usage:    "Private key to process messages on the destination chain",
		Required: true,
		Category: processorCategory,
		EnvVars:  []string{"PROCESSOR_PRIVATE_KEY"},
	}
	DestTaikoAddress = &cli.StringFlag{
		Name:     "destTaikoAddress",
		Usage:    "Taiko address for the destination chain",
		Required: true,
		Category: processorCategory,
		EnvVars:  []string{"DEST_TAIKO_ADDRESS"},
	}
	DestERC20VaultAddress = &cli.StringFlag{
		Name:     "destERC20VaultAddress",
		Usage:    "ERC20Vault address for the destination chain, only required if you want to process NFTs",
		Category: processorCategory,
		Required: true,
		EnvVars:  []string{"DEST_ERC20_VAULT_ADDRESS"},
	}
	DestERC1155VaultAddress = &cli.StringFlag{
		Name:     "destERC1155Address",
		Usage:    "ERC1155Vault address for the destination chain",
		Category: processorCategory,
		Required: true,
		EnvVars:  []string{"DEST_ERC1155_VAULT_ADDRESS"},
	}
	DestERC721VaultAddress = &cli.StringFlag{
		Name:     "destERC721Address",
		Usage:    "ERC721Vault address for the destination chain",
		Category: processorCategory,
		Required: true,
		EnvVars:  []string{"DEST_ERC721_VAULT_ADDRESS"},
	}
)
View Source
var (
	HeaderSyncInterval = &cli.Uint64Flag{
		Name:     "headerSyncInterval",
		Usage:    "Interval to poll to see if header is synced yet, in seconds",
		Value:    10,
		Category: processorCategory,
		EnvVars:  []string{"HEADER_SYNC_INTERVAL_IN_SECONDS"},
	}
	Confirmations = &cli.Uint64Flag{
		Name:     "confirmations",
		Usage:    "Confirmations to wait for on source chain before processing on destination chain",
		Value:    3,
		Category: processorCategory,
		EnvVars:  []string{"CONFIRMATIONS_BEFORE_PROCESSING"},
	}
	ConfirmationTimeout = &cli.Uint64Flag{
		Name:     "confirmationTimeout",
		Usage:    "Timeout when waiting for a processed message receipt in seconds",
		Value:    360,
		Category: processorCategory,
		EnvVars:  []string{"CONFIRMATIONS_TIMEOUT_IN_SECONDS"},
	}
	ProfitableOnly = &cli.BoolFlag{
		Name:     "profitableOnly",
		Usage:    "Whether to only process transactions that are estimated to be profitable",
		Value:    false,
		Category: processorCategory,
		EnvVars:  []string{"PROFITABLE_ONLY"},
	}
	QueuePrefetchCount = &cli.Uint64Flag{
		Name:     "queue.prefetch",
		Usage:    "How many messages to prefetch",
		Category: processorCategory,
		Value:    1,
		EnvVars:  []string{"QUEUE_PREFETCH_COUNT"},
	}
	EnableTaikoL2 = &cli.BoolFlag{
		Name:     "enableTaikoL2",
		Usage:    "Whether to instantiate a taikoL2 contract based off the config.DestTaikoAddress",
		Value:    false,
		Category: processorCategory,
		EnvVars:  []string{"ENABLE_TAIKO_L2"},
	}
	HopSignalServiceAddresses = &cli.StringSliceFlag{
		Name:     "hopSignalServiceAddresses",
		Usage:    "SignalService addresses for the intermediary chains",
		Required: false,
		Category: processorCategory,
		EnvVars:  []string{"HOP_SIGNAL_SERVICE_ADDRESSES"},
	}
	HopTaikoAddresses = &cli.StringSliceFlag{
		Name:     "hopTaikoAddresses",
		Usage:    "Taiko addresses for the intermediary chains",
		Required: false,
		Category: processorCategory,
		EnvVars:  []string{"HOP_TAIKO_ADDRESSES"},
	}
	HopRPCUrls = &cli.StringSliceFlag{
		Name:     "hopRpcUrls",
		Usage:    "RPC URL for the intermediary chains",
		Required: false,
		Category: processorCategory,
		EnvVars:  []string{"HOP_RPC_URLS"},
	}
	TargetTxHash = &cli.StringFlag{
		Name:     "targetTxHash",
		Usage:    "Target transaction hash, set to ignore processing from queue and only process this individual transaction",
		Category: processorCategory,
		Required: false,
		EnvVars:  []string{"TARGET_TX_HASH"},
	}
	CacheOption = &cli.IntFlag{
		Name:     "cacheOption",
		Usage:    "Cache option. Options: 0 - cache nothing, 1 - cache signal root, 2 - cache state root, 3 - cache both",
		Category: processorCategory,
		Required: false,
		EnvVars:  []string{"CACHE_OPTION"},
		Value:    3,
	}
)

optional

View Source
var (
	QueueUsername = &cli.StringFlag{
		Name:     "queue.username",
		Usage:    "Queue connection username",
		Required: true,
		Category: commonCategory,
		EnvVars:  []string{"QUEUE_USER"},
	}
	QueuePassword = &cli.StringFlag{
		Name:     "queue.password",
		Usage:    "Queue connection password",
		Required: true,
		Category: commonCategory,
		EnvVars:  []string{"QUEUE_PASSWORD"},
	}
	QueueHost = &cli.StringFlag{
		Name:     "queue.host",
		Usage:    "Queue connection host",
		Required: true,
		Category: commonCategory,
		EnvVars:  []string{"QUEUE_HOST"},
	}
	QueuePort = &cli.Uint64Flag{
		Name:     "queue.port",
		Usage:    "Queue connection port",
		Required: true,
		Category: commonCategory,
		EnvVars:  []string{"QUEUE_PORT"},
	}
)
View Source
var APIFlags = MergeFlags(CommonFlags, []cli.Flag{

	HTTPPort,
	CORSOrigins,
})

All common flags.

View Source
var QueueFlags = []cli.Flag{
	QueueUsername,
	QueuePassword,
	QueueHost,
	QueuePort,
}
View Source
var (
	WatchdogPrivateKey = &cli.StringFlag{
		Name:     "watchdogPrivateKey",
		Usage:    "Private key to suspend bridge transactions, should correspond with the address set on chain as watchdog",
		Required: true,
		Category: watchdogCategory,
		EnvVars:  []string{"WATCHDOG_PRIVATE_KEY"},
	}
)

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