mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-01 00:31:21 +00:00
73b897b2b5
* verify_snapshot stuff * remove unused parameter * remove unused argument * make blocksource required
38 lines
767 B
Go
38 lines
767 B
Go
package commands
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/ledgerwatch/bolt"
|
|
"github.com/ledgerwatch/turbo-geth/cmd/state/stateless"
|
|
"github.com/ledgerwatch/turbo-geth/ethdb"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func init() {
|
|
withRemoteDb(gasLimitsCmd)
|
|
rootCmd.AddCommand(gasLimitsCmd)
|
|
}
|
|
|
|
var gasLimitsCmd = &cobra.Command{
|
|
Use: "gasLimits",
|
|
Short: "gasLimits",
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
ctx := cmd.Context()
|
|
|
|
localDB, err := bolt.Open(file()+"_gl", 0600, &bolt.Options{})
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
remoteDB, err := ethdb.NewRemote().Path(remoteDbAddress).Open(ctx)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
fmt.Println("Processing started...")
|
|
stateless.NewGasLimitReporter(ctx, remoteDB, localDB).GasLimits(ctx)
|
|
return nil
|
|
},
|
|
}
|