From 76ea60298f3c5e852f6885b99ab8b3f9843441a8 Mon Sep 17 00:00:00 2001 From: anjor Date: Mon, 19 Aug 2024 22:51:17 +0100 Subject: [PATCH] wiring --- cmd-x-index-cid2subsetoffset.go | 26 +++++++++++++------------- cmd-x-index.go | 1 + 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/cmd-x-index-cid2subsetoffset.go b/cmd-x-index-cid2subsetoffset.go index e114ffc4..a8926f10 100644 --- a/cmd-x-index-cid2subsetoffset.go +++ b/cmd-x-index-cid2subsetoffset.go @@ -90,19 +90,19 @@ func newCmd_Index_cid2subsetOffset() *cli.Command { panic(err) } klog.Info("Index created") - // if verify { - // klog.Infof("Verifying index located at %s", indexFilepath) - // startedAt := time.Now() - // defer func() { - // klog.Infof("Finished in %s", time.Since(startedAt)) - // }() - // err := VerifyIndex_cid2subsetOffset(context.TODO(), indexFilepath) - // if err != nil { - // return cli.Exit(err, 1) - // } - // klog.Info("Index verified") - // return nil - // } + if verify { + klog.Infof("Verifying index located at %s", indexFilepath) + startedAt := time.Now() + defer func() { + klog.Infof("Finished in %s", time.Since(startedAt)) + }() + err := VerifyIndex_cid2subsetOffset(context.TODO(), carPaths, indexFilepath) + if err != nil { + return cli.Exit(err, 1) + } + klog.Info("Index verified") + return nil + } } return nil }, diff --git a/cmd-x-index.go b/cmd-x-index.go index 58e58fc1..e6c30e71 100644 --- a/cmd-x-index.go +++ b/cmd-x-index.go @@ -15,6 +15,7 @@ func newCmd_Index() *cli.Command { Flags: []cli.Flag{}, Subcommands: []*cli.Command{ newCmd_Index_cid2offset(), + newCmd_Index_cid2subsetOffset(), newCmd_Index_slot2cid(), newCmd_Index_sig2cid(), newCmd_Index_all(), // NOTE: not actually all.