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"}, } ProcessingFeeMultiplier = &cli.Float64Flag{ Name: "processingFeeMultiplier", Usage: "Processing fee multiplier", Category: indexerCategory, Value: 2.5, EnvVars: []string{"PROCESSING_FEE_MULTIPLIER"}, } )
optional
View Source
var ( BridgePrivateKey = &cli.StringFlag{ Name: "bridgePrivateKey", Usage: "Private key to send a bridge", Required: true, Category: bridgeCategory, EnvVars: []string{"BRIDGE_PRIVATE_KEY"}, } BridgeMessageValue = &cli.StringFlag{ Name: "bridgeMessageValue", Usage: "Value in the bridge message", Required: true, Category: bridgeCategory, EnvVars: []string{"BRIDGE_MESSAGE_VALUE"}, } )
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, EnvVars: []string{"BACKOFF_RETRY_INTERVAL"}, } BackOffMaxRetrys = &cli.Uint64Flag{ Name: "backoff.maxRetrys", Usage: "Max retry times when there is an error", Category: processorCategory, Value: 5, EnvVars: []string{"BACKOFF_MAX_RETRYS"}, } )
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"}, } NumLatestBlocksEndWhenCrawling = &cli.Uint64Flag{ Name: "numLatestBlocksEndWhenCrawling", Usage: `Number of blocks to ignore from the end when crawling chain, should be higher for L2-L1 indexing due to delay `, Value: 300, Category: indexerCategory, EnvVars: []string{"NUM_LATEST_BLOCKS_END_WHEN_CRAWLING"}, } NumLatestBlocksStartWhenCrawling = &cli.Uint64Flag{ Name: "numLatestBlocksStartWhenCrawling", Usage: `Number of latest blocks to index from the start when crawling chain. The default value is to cover past 7 days. `, Value: 50400, Category: indexerCategory, EnvVars: []string{"NUM_LATEST_BLOCKS_START_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"}, } MinFeeToIndex = &cli.Uint64Flag{ Name: "minFeeToIndex", Usage: "Minimum fee to index and add to the queue (will still be saved to database)", Category: indexerCategory, Value: 0, EnvVars: []string{"MIN_FEE_TO_INDEX"}, } WaitForConfirmationTimeout = &cli.DurationFlag{ Name: "waitForConfirmationTimeout", Usage: "Timeout waiting for confirmations", Value: 5 * time.Minute, Category: indexerCategory, EnvVars: []string{"WAIT_FOR_CONFIRMATION_TIMEOUT"}, } IndexingConfirmations = &cli.Uint64Flag{ Name: "confirmations", Usage: "Confirmations to wait for on source chain before indexing an event", Value: 1, Category: indexerCategory, EnvVars: []string{"CONFIRMATIONS_BEFORE_INDEXING"}, } )
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, } UnprofitableMessageQueueExpiration = &cli.StringFlag{ Name: "unprofitableMessageQueueExpiration", Usage: "Time in seconds for queue message to expire when unprofitable, which will re-route it to be checked again", Category: processorCategory, Required: false, EnvVars: []string{"UNPROFITABLE_MESSAGE_QUEUE_EXPIRATION"}, } MaxMessageRetries = &cli.Uint64Flag{ Name: "maxMessageRetries", Usage: "How many times to retry a message due to unprofitability", Category: processorCategory, Value: 5, EnvVars: []string{"MAX_MESSAGE_RETRIES"}, } DestQuotaManagerAddress = &cli.StringFlag{ Name: "destQuotaManagerAddress", Usage: "QuotaManager address for the destination chain", Category: processorCategory, Required: false, EnvVars: []string{"DEST_QUOTA_MANAGER_ADDRESS"}, } MinFeeToProcess = &cli.Uint64Flag{ Name: "minFeeToProcess", Usage: "Minimum fee to process", Category: processorCategory, Value: 0, EnvVars: []string{"MIN_FEE_TO_PROCESS"}, } )
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 ( NumConfirmations = &cli.Uint64Flag{ Name: "tx.numConfirmations", Usage: "Number of confirmations which we will wait after sending a transaction", Value: 1, Category: txmgrCategory, EnvVars: []string{"TXMGR_NUM_CONFIRMATIONS"}, } 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, EnvVars: []string{"SAFE_ABORT_NONCE_TOO_LOW_COUNT"}, } 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, EnvVars: []string{"FEE_LIMIT_MULTIPLIER"}, } 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, EnvVars: []string{"FEE_LIMIT_THRESHOLD"}, } 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, EnvVars: []string{"MIN_TIP_CAP"}, } 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, EnvVars: []string{"MIN_BASE_FEE"}, } ResubmissionTimeout = &cli.DurationFlag{ Name: "tx.resubmissionTimeout", Usage: "Duration we will wait before resubmitting a transaction to L1", Value: 48 * time.Second, Category: txmgrCategory, EnvVars: []string{"RESBUMISSION_TIMEOUT"}, } TxSendTimeout = &cli.DurationFlag{ Name: "tx.sendTimeout", Usage: "Timeout for sending transactions. If 0 it is disabled.", Value: 0, Category: txmgrCategory, EnvVars: []string{"TX_SEND_TIMEOUT"}, } 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, EnvVars: []string{"TX_NOT_IN_MEMPOOL_TIMEOUT"}, } ReceiptQueryInterval = &cli.DurationFlag{ Name: "tx.receiptQueryInterval", Usage: "Frequency to poll for receipts", Value: 12 * time.Second, Category: txmgrCategory, EnvVars: []string{"RECEIPT_QUERY_INTERVAL"}, } TxGasLimit = &cli.Uint64Flag{ Name: "tx.gasLimit", Usage: "Gas limit will be used for transactions (0 means using gas estimation)", Value: 0, Category: txmgrCategory, EnvVars: []string{"GAS_LIMIT"}, } RPCTimeout = &cli.DurationFlag{ Name: "rpc.timeout", Usage: "Timeout in seconds for RPC calls", Category: commonCategory, Value: 12 * time.Second, EnvVars: []string{"RPC_TIMEOUT"}, } )
View Source
var APIFlags = MergeFlags(CommonFlags, []cli.Flag{ HTTPPort, CORSOrigins, ProcessingFeeMultiplier, DestTaikoAddress, })
View Source
var BridgeFlags = MergeFlags(CommonFlags, QueueFlags, []cli.Flag{ BridgePrivateKey, BridgeMessageValue, SrcBridgeAddress, DestBridgeAddress, SrcTaikoAddress, })
View Source
var CommonFlags = []cli.Flag{ DatabaseUsername, DatabasePassword, DatabaseHost, DatabaseName, SrcRPCUrl, DestRPCUrl, DatabaseMaxIdleConns, DatabaseConnMaxLifetime, DatabaseMaxOpenConns, MetricsHTTPPort, ETHClientTimeout, SrcSignalServiceAddress, BackOffMaxRetrys, BackOffRetryInterval, }
All common flags.
View Source
var IndexerFlags = MergeFlags(CommonFlags, QueueFlags, []cli.Flag{ SrcBridgeAddress, DestBridgeAddress, SrcTaikoAddress, BlockBatchSize, MaxNumGoroutines, SubscriptionBackoff, SyncMode, WatchMode, NumLatestBlocksEndWhenCrawling, NumLatestBlocksStartWhenCrawling, EventName, MinFeeToIndex, TargetBlockNumber, WaitForConfirmationTimeout, IndexingConfirmations, })
View Source
var ProcessorFlags = MergeFlags(CommonFlags, QueueFlags, TxmgrFlags, []cli.Flag{ DestERC721VaultAddress, DestERC1155VaultAddress, DestERC20VaultAddress, DestTaikoAddress, ProcessorPrivateKey, HeaderSyncInterval, Confirmations, ConfirmationTimeout, ProfitableOnly, QueuePrefetchCount, EnableTaikoL2, HopRPCUrls, HopSignalServiceAddresses, HopTaikoAddresses, DestBridgeAddress, TargetTxHash, CacheOption, UnprofitableMessageQueueExpiration, MaxMessageRetries, MinFeeToProcess, DestQuotaManagerAddress, })
View Source
var QueueFlags = []cli.Flag{ QueueUsername, QueuePassword, QueueHost, QueuePort, }
View Source
var TxmgrFlags = []cli.Flag{ NumConfirmations, SafeAbortNonceTooLowCount, FeeLimitMultiplier, FeeLimitThreshold, MinTipCap, MinBaseFee, ResubmissionTimeout, TxSendTimeout, TxNotInMempoolTimeout, ReceiptQueryInterval, TxGasLimit, RPCTimeout, }
View Source
var WatchdogFlags = MergeFlags(CommonFlags, QueueFlags, TxmgrFlags, []cli.Flag{ WatchdogPrivateKey, Confirmations, ConfirmationTimeout, QueuePrefetchCount, DestBridgeAddress, SrcBridgeAddress, })
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.
Click to show internal directories.
Click to hide internal directories.