erigon-pulse/cmd/state/commands/gas_limits.go
Giulio rebuffo 23d89c0941
Added TLS handshake to RPCDaemon (#1089)
* added eth_getStorageAt

* used uint32

* now its 256

* incarnation

* added TLS handshake

* code minified

* lint

* minified client

* Update flags.go

Co-authored-by: Alexey Akhunov <akhounov@gmail.com>
2020-09-11 21:17:37 +01:00

41 lines
953 B
Go

package commands
import (
"fmt"
"github.com/ledgerwatch/turbo-geth/common/dbutils"
"github.com/ledgerwatch/turbo-geth/cmd/state/stateless"
"github.com/ledgerwatch/turbo-geth/ethdb"
"github.com/spf13/cobra"
)
func init() {
withPrivateApi(gasLimitsCmd)
rootCmd.AddCommand(gasLimitsCmd)
}
var gasLimitsCmd = &cobra.Command{
Use: "gasLimits",
Short: "gasLimits",
RunE: func(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()
localDB := ethdb.NewLMDB().Path(file() + "_gl").WithBucketsConfig(func(defaultBuckets dbutils.BucketsCfg) dbutils.BucketsCfg {
return dbutils.BucketsCfg{
stateless.MainHashesBucket: {},
stateless.ReportsProgressBucket: {},
}
}).MustOpen()
remoteDB, _, err := ethdb.NewRemote().Path(privateApiAddr).Open("")
if err != nil {
return err
}
fmt.Println("Processing started...")
stateless.NewGasLimitReporter(ctx, remoteDB, localDB).GasLimits(ctx)
return nil
},
}