tools

package
v1.19.8 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrActionNoMatch      = errors.New("action no match")
	ErrReceiptNoMatch     = errors.New("receipt no match")
	ErrTransactionNoMatch = errors.New("transaction no match")
)
View Source
var BackfillAuthorization = &cli.Command{
	Name:  "backfill-authorization",
	Usage: "Backfill authorization table from existing action_type.auth_list (type-4 txs)",
	Flags: []cli.Flag{
		&cli.IntFlag{Name: "batch", Value: 100, Usage: "rows to process per batch"},
		&cli.BoolFlag{Name: "recompute-validity", Usage: "Recompute the Valid column for existing authorization rows instead of inserting from action_type"},
		&cli.BoolFlag{Name: "force", Usage: "With --recompute-validity, also recompute rows that already have a Valid value (default: only NULL rows)"},
	},
	Action: backfillAuthorization,
}
View Source
var BackfillHermesRewards = &cli.Command{
	Name:  "backfill-hermes-rewards",
	Usage: "Rebuild hermes_account_rewards for a closed epoch range",
	Flags: []cli.Flag{
		&cli.Uint64Flag{Name: "start", Required: true, Usage: "first epoch to rebuild (inclusive)"},
		&cli.Uint64Flag{Name: "end", Required: true, Usage: "last epoch to rebuild (inclusive)"},
		&cli.BoolFlag{Name: "dry-run", Usage: "compute each epoch in a transaction and roll it back, reporting what would be written"},
		&cli.BoolFlag{Name: "only-missing", Usage: "leave epochs that already have rows untouched"},
		&cli.BoolFlag{Name: "show-rows", Usage: "print every delegate row instead of a per-epoch summary"},
	},
	Action: backfillHermesRewards,
}

BackfillHermesRewards re-runs the hermes_account_rewards rollup for a range of already-indexed epochs.

The plugin only rebuilds an epoch as the indexer crosses its boundary, and the indexer never revisits a block, so an epoch skipped at that moment stays empty forever -- and Hermes refuses to distribute a batch containing one ("bookkeeping info doesn't exist for Epoch N"). This is the way to fill such a hole after the fact.

View Source
var VerifyDB = &cli.Command{
	Name:        "verify_db",
	Usage:       "verify_db --start=<startBlkNum> --end=<endBlkNum> --worker <workerSize>",
	Description: "verify_db will verify the db by blkNum",
	Flags: []cli.Flag{
		&cli.Uint64Flag{
			Name:  "start",
			Usage: "start block number",
			Value: 1,
		},
		&cli.Uint64Flag{
			Name:  "end",
			Usage: "end block number",
			Value: 1,
		},
		&cli.IntFlag{
			Name:  "worker",
			Usage: "worker thread num",
			Value: runtime.NumCPU(),
		},
	},
	Action: verifyDB,
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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