Skip to content

Commit 3d3311c

Browse files
author
Andrei Ivasko
committed
make setup for profiling6
1 parent 35685e3 commit 3d3311c

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

cmd/opera/launcher/erigoncmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func writeErigon(ctx *cli.Context) error {
4949

5050
cfg := makeAllConfigs(ctx)
5151

52-
rawProducer := integration.DBProducer(path.Join(cfg.Node.DataDir, "chaindata"), cacheScaler(ctx))
52+
rawProducer := integration.DBProducer(path.Join(erigon.DefaultDataDir(), "chaindata"), cacheScaler(ctx))
5353

5454
gdb, err := makeRawGossipStore(rawProducer, cfg)
5555
if err != nil {

gossip/erigon/plain_state.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func openDatabase(logger logger.Instance, label kv.Label) (kv.RwDB, error) {
5252
}
5353
var db kv.RwDB
5454

55-
dbPath := filepath.Join(defaultDataDir(), "erigon", name)
55+
dbPath := filepath.Join(DefaultDataDir(), "erigon", name)
5656

5757
var openFunc func(exclusive bool) (kv.RwDB, error)
5858
logger.Log.Info("Opening Database", "label", name, "path", dbPath)
@@ -88,7 +88,7 @@ func openDatabase(logger logger.Instance, label kv.Label) (kv.RwDB, error) {
8888
if err != nil {
8989
return nil, err
9090
}
91-
if err = migrator.Apply(db, defaultDataDir()); err != nil {
91+
if err = migrator.Apply(db, DefaultDataDir()); err != nil {
9292
return nil, err
9393
}
9494
db.Close()

gossip/erigon/preimages.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"os"
88
"strings"
99
"time"
10+
"path/filepath"
1011

1112
"github.com/ethereum/go-ethereum/rlp"
1213

@@ -19,12 +20,13 @@ import (
1920
"github.com/ledgerwatch/erigon/crypto"
2021
)
2122

22-
// THis path denotes path to preimages in profiling6 server
23-
const defaultPreimagesPath = "/var/data/preimages/preimages.gz"
23+
2424

2525
// WritePreimagesToSenders writes preimages to erigon kv.Senders table
2626
func WritePreimagesToSenders(db kv.RwDB) error {
2727

28+
// THis path denotes path to preimages in profiling6 server
29+
defaultPreimagesPath := filepath.Join(DefaultDataDir(), "/preimages/preimages.gz")
2830
start := time.Now()
2931
log.Info("Reading preimages", "from file", defaultPreimagesPath)
3032

gossip/erigon/utils.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import (
66
"os"
77
"path/filepath"
88
"runtime"
9-
10-
"os/user"
119
)
1210

1311
func homeDir() string {
@@ -22,7 +20,7 @@ func homeDir() string {
2220
return "/var/data/"
2321
}
2422

25-
func defaultDataDir() string {
23+
func DefaultDataDir() string {
2624
// Try to place the data folder in the user's home dir
2725
home := homeDir()
2826
if home != "" {

0 commit comments

Comments
 (0)