mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-01 00:31:21 +00:00
d33302c2be
* added tls auth * added client side * put --tls * fixed flag * Add key/cert generation instructions, turn off Common Name verification * Add CLI arguments and Warning * Lint * Update the doc about Internal IP Co-authored-by: Alexey Akhunov <akhounov@gmail.com>
41 lines
961 B
Go
41 lines
961 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
|
|
},
|
|
}
|