@@ -31,6 +31,7 @@ COMMANDS:
3131 wait-api Wait for lotus api to come online
3232 fetch-params Fetch proving parameters
3333 evm Commands related to the Filecoin EVM runtime
34+ index Commands related to managing the chainindex
3435 NETWORK:
3536 net Manage P2P Network
3637 sync Inspect or interact with the chain syncer
@@ -2241,6 +2242,74 @@ OPTIONS:
22412242 --help, -h show help
22422243```
22432244
2245+ ## lotus index
2246+ ```
2247+ NAME:
2248+ lotus index - Commands related to managing the chainindex
2249+
2250+ USAGE:
2251+ lotus index command [command options] [arguments...]
2252+
2253+ COMMANDS:
2254+ validate-backfill Validates and optionally backfills the chainindex for a range of epochs
2255+ help, h Shows a list of commands or help for one command
2256+
2257+ OPTIONS:
2258+ --help, -h show help
2259+ ```
2260+
2261+ ### lotus index validate-backfill
2262+ ```
2263+ NAME:
2264+ lotus index validate-backfill - Validates and optionally backfills the chainindex for a range of epochs
2265+
2266+ USAGE:
2267+ lotus index validate-backfill [command options] [arguments...]
2268+
2269+ DESCRIPTION:
2270+
2271+ lotus-shed chainindex validate-backfill --from <start_epoch> --to <end_epoch> [--backfill] [--log-good] [--quiet]
2272+
2273+ The command validates the chain index entries for each epoch in the specified range, checking for missing or
2274+ inconsistent entries (i.e. the indexed data does not match the actual chain state). If '--backfill' is enabled
2275+ (which it is by default), it will attempt to backfill any missing entries using the 'ChainValidateIndex' API.
2276+
2277+ Error conditions:
2278+ - If 'from' or 'to' are invalid (<=0 or 'to' > 'from'), an error is returned.
2279+ - If the 'ChainValidateIndex' API returns an error for an epoch, indicating an inconsistency between the index
2280+ and chain state, an error message is logged for that epoch.
2281+
2282+ Logging:
2283+ - Progress is logged every 2880 epochs (1 day worth of epochs) processed during the validation process.
2284+ - If '--log-good' is enabled, details are also logged for each epoch that has no detected problems. This includes:
2285+ - Null rounds with no messages/events.
2286+ - Epochs with a valid indexed entry.
2287+ - If --quiet is enabled, only errors are logged, unless --log-good is also enabled, in which case good tipsets
2288+ are also logged.
2289+
2290+ Example usage:
2291+
2292+ To validate and backfill the chain index for the last 5760 epochs (2 days) and log details for all epochs:
2293+
2294+ lotus-shed chainindex validate-backfill --from 1000000 --to 994240 --log-good
2295+
2296+ This command is useful for backfilling the chain index over a range of historical epochs during the migration to
2297+ the new ChainIndexer. It can also be run periodically to validate the index's integrity using system schedulers
2298+ like cron.
2299+
2300+ If there are any errors during the validation process, the command will exit with a non-zero status and log the
2301+ number of failed RPC calls. Otherwise, it will exit with a zero status.
2302+
2303+
2304+ OPTIONS:
2305+ --from value from specifies the starting tipset epoch for validation (inclusive) (default: 0)
2306+ --to value to specifies the ending tipset epoch for validation (inclusive) (default: 0)
2307+ --backfill backfill determines whether to backfill missing index entries during validation (default: true) (default: true)
2308+ --log-good log tipsets that have no detected problems (default: false)
2309+ --quiet suppress output except for errors (or good tipsets if log-good is enabled) (default: false)
2310+ --help, -h show help
2311+ ```
2312+
22442313## lotus net
22452314```
22462315NAME:
0 commit comments