erigon-pulse/cmd/state/commands/state_growth.go
Alex Sharov 33308dd5c2
State analytic less memory and checkpoints (#299)
* added prefix tree to analyses to reduce memory usage
* make new partition every day
* merge concepts of reporter and snapshot
* tests for .FirstKey() and .NextKey()
2020-01-07 09:27:19 +07:00

32 lines
679 B
Go

package commands
import (
"fmt"
"github.com/ledgerwatch/turbo-geth/cmd/state/stateless"
"github.com/spf13/cobra"
)
func init() {
stateGrowthCmd := &cobra.Command{
Use: "stateGrowth",
Short: "stateGrowth",
RunE: func(cmd *cobra.Command, args []string) error {
ctx := getContext()
db, err := connectRemoteDb(ctx, remoteDbAddress)
if err != nil {
return err
}
fmt.Println("Processing started...")
stateless.NewStateGrowth1Reporter(ctx, db).StateGrowth1(ctx)
stateless.NewStateGrowth2Reporter(ctx, db).StateGrowth2(ctx)
return nil
},
}
withChaindata(stateGrowthCmd)
withRemoteDb(stateGrowthCmd)
rootCmd.AddCommand(stateGrowthCmd)
}