Skip to content

Commit

Permalink
Added temporal db to evm cmd (#12270)
Browse files Browse the repository at this point in the history
closes #12268

---------

Co-authored-by: JkLondon <ilya@mikheev.fun>
  • Loading branch information
JkLondon and JkLondon authored Oct 10, 2024
1 parent 39b62b4 commit 6a6a737
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions cmd/evm/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/erigontech/erigon-lib/config3"
"github.com/erigontech/erigon-lib/kv/temporal"
"io"
"math/big"
"os"
Expand Down Expand Up @@ -157,7 +159,7 @@ func runCmd(ctx *cli.Context) error {
} else {
debugLogger = logger.NewStructLogger(logconfig)
}
db := memdb.New("")
db := memdb.New(os.TempDir())
defer db.Close()
if ctx.String(GenesisFlag.Name) != "" {
gen := readGenesis(ctx.String(GenesisFlag.Name))
Expand All @@ -167,7 +169,16 @@ func runCmd(ctx *cli.Context) error {
} else {
genesisConfig = new(types.Genesis)
}
tx, err := db.BeginRw(context.Background())
agg, err := state2.NewAggregator(context.Background(), datadir.New(os.TempDir()), config3.HistoryV3AggregationStep, db, log.New())
if err != nil {
return err
}
defer agg.Close()
tdb, err := temporal.New(db, agg)
if err != nil {
return err
}
tx, err := tdb.BeginRw(context.Background())
if err != nil {
return err
}
Expand Down

0 comments on commit 6a6a737

Please sign in to comment.