2019-11-25 13:46:36 +00:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
2019-12-06 07:18:26 +00:00
|
|
|
"fmt"
|
|
|
|
|
2019-11-25 13:46:36 +00:00
|
|
|
"github.com/ledgerwatch/turbo-geth/cmd/state/stateless"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
withChaindata(gasLimitsCmd)
|
2019-12-06 07:18:26 +00:00
|
|
|
withRemoteDb(gasLimitsCmd)
|
2019-11-25 13:46:36 +00:00
|
|
|
rootCmd.AddCommand(gasLimitsCmd)
|
|
|
|
}
|
|
|
|
|
|
|
|
var gasLimitsCmd = &cobra.Command{
|
|
|
|
Use: "gasLimits",
|
|
|
|
Short: "gasLimits",
|
|
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
2019-12-06 07:36:21 +00:00
|
|
|
reporter, err := stateless.NewReporter(remoteDbAddress)
|
2019-12-06 07:18:26 +00:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2019-12-06 07:36:21 +00:00
|
|
|
ctx := getContext()
|
2019-12-06 07:18:26 +00:00
|
|
|
fmt.Println("Processing started...")
|
2019-12-06 07:36:21 +00:00
|
|
|
reporter.GasLimits(ctx)
|
2019-11-25 13:46:36 +00:00
|
|
|
return nil
|
|
|
|
},
|
|
|
|
}
|