Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov committed Nov 20, 2024
2 parents 8dd289e + 54b38d7 commit a2462c6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmd/caplin/caplin1/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,12 @@ func OpenCaplinDatabase(ctx context.Context,
os.MkdirAll(dbPath, 0700)
os.MkdirAll(dataDirIndexer, 0700)

db := mdbx.MustOpen(dataDirIndexer)
blobDB := mdbx.MustOpen(blobDbPath)
db := mdbx.NewMDBX(log.New()).Path(dbPath).Label(kv.CaplinDB).WithTableCfg(func(defaultBuckets kv.TableCfg) kv.TableCfg {
return kv.ChaindataTablesCfg
}).MustOpen()
blobDB := mdbx.NewMDBX(log.New()).Path(blobDbPath).Label(kv.CaplinDB).WithTableCfg(func(defaultBuckets kv.TableCfg) kv.TableCfg {
return kv.ChaindataTablesCfg
}).MustOpen()

tx, err := db.BeginRw(ctx)
if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions erigon-lib/kv/kv_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ const (
HeimdallDB
DiagnosticsDB
PolygonBridgeDB
CaplinDB
)

func (l Label) String() string {
Expand All @@ -175,6 +176,8 @@ func (l Label) String() string {
return "diagnostics"
case PolygonBridgeDB:
return "polygon-bridge"
case CaplinDB:
return "caplin"
default:
return "unknown"
}
Expand All @@ -197,6 +200,8 @@ func UnmarshalLabel(s string) Label {
return DiagnosticsDB
case "polygon-bridge":
return PolygonBridgeDB
case "caplin":
return CaplinDB
case "unknown":
return Unknown
default:
Expand Down

0 comments on commit a2462c6

Please sign in to comment.