This commit is contained in:
zenground0 2023-06-28 09:15:38 -06:00
parent 0cfdc9b5b6
commit 3897bf14d1
3 changed files with 4 additions and 70 deletions

View File

@ -1,39 +0,0 @@
package main
import (
"github.com/urfave/cli/v2"
)
var snapshotCmd = &cli.Command{
Name: "snapshot",
Description: "interact with filecoin chain snapshots",
Subcommands: []*cli.Command{
snapshotStatCmd,
},
}
var snapshotStatCmd = &cli.Command{
Name: "stat-actor",
Usage: "display number of snapshot bytes held by provided actor",
ArgsUsage: "[datastore path] [head] [actor address]",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "field", // specify top level actor field to stat
},
},
Action: func(cctx *cli.Context) error {
// Initialize in memory graph counter
// Get root tskey
// Walk headers back
// Count header bytes
// open state,
// if no field set graph count actor HEAD
// if field is set, parse actor head, look for field
// if field not found or not a cid error, otherwise do graph count on the cid
// Print out stats
return nil
},
}

View File

@ -104,34 +104,6 @@ type statItem struct {
Stat api.ObjStat
}
// var snapShotStatCmd = &cli.Command{
// Name: "snapshot-stat",
// Usage: "print statistics of the snapshot rooted at given block",
// Flags: []cli.Flag{
// &cli.StringFlag{
// Name: "tipset",
// Usage: "specify tipset to start from",
// },
// },
// Action: func(cctx *cli.Context) error {
// api, closer, err := lcli.GetFullNodeAPI(cctx)
// if err != nil {
// return err
// }
// defer closer()
// ctx := lcli.ReqContext(cctx)
// ts, err := lcli.LoadTipSet(ctx, cctx, api)
// if err != nil {
// return err
// }
// api.ChainStatSnapshot(ctx, ts.Key())
// },
// }
var staterootStatCmd = &cli.Command{
Name: "stat",
Usage: "print statistics for the stateroot of a given block",

View File

@ -4,9 +4,10 @@ import pathlib
snapshot_data = json.load(sys.stdin)
# XXX: parameterize to use block count as value instead of byte size
# XXX: parameterize on different types of px chart types
# XXX: parameterize on output port so we can serve this from infra
# Possible extensions:
# 1. parameterize to use block count as value instead of byte size
# 2. parameterize on different types of px chart types
# 3. parameterize on output port so we can serve this from infra
parents = []
names = []