2019-11-25 13:46:36 +00:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import "github.com/spf13/cobra"
|
|
|
|
|
|
|
|
var (
|
2019-12-03 09:55:15 +00:00
|
|
|
chaindata string
|
|
|
|
statsfile string
|
|
|
|
block uint64
|
|
|
|
remoteDbAdddress string
|
2019-11-25 13:46:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func withBlock(cmd *cobra.Command) {
|
|
|
|
cmd.Flags().Uint64Var(&block, "block", 1, "specifies a block number for operation")
|
|
|
|
}
|
|
|
|
|
|
|
|
func withChaindata(cmd *cobra.Command) {
|
|
|
|
cmd.Flags().StringVar(&chaindata, "chaindata", "chaindata", "path to the chaindata file used as input to analysis")
|
2019-11-26 13:29:41 +00:00
|
|
|
if err := cmd.MarkFlagFilename("chaindata", ""); err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
2019-11-25 13:46:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func withStatsfile(cmd *cobra.Command) {
|
|
|
|
cmd.Flags().StringVar(&statsfile, "statsfile", "stateless.csv", "path where to write the stats file")
|
2019-11-26 13:29:41 +00:00
|
|
|
if err := cmd.MarkFlagFilename("statsfile", "csv"); err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
2019-11-25 13:46:36 +00:00
|
|
|
}
|
2019-12-03 09:55:15 +00:00
|
|
|
|
|
|
|
func withRemoteDb(cmd *cobra.Command) {
|
|
|
|
cmd.Flags().StringVar(&remoteDbAdddress, "remote-db-addr", "", "remote db rpc address")
|
|
|
|
}
|