Skip to content

Commit

Permalink
Use a sqliteDB to store ledger entries
Browse files Browse the repository at this point in the history
  • Loading branch information
2opremio committed Jan 12, 2023
1 parent 36b6588 commit 7d04e28
Show file tree
Hide file tree
Showing 10 changed files with 856 additions and 256 deletions.
1 change: 1 addition & 0 deletions cmd/soroban-rpc/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ type LocalConfig struct {
LogLevel logrus.Level
TxConcurrency int
TxQueueSize int
SQLiteDBPath string
}
8 changes: 7 additions & 1 deletion cmd/soroban-rpc/internal/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

"github.com/stellar/soroban-tools/cmd/soroban-rpc/internal"
"github.com/stellar/soroban-tools/cmd/soroban-rpc/internal/config"
"github.com/stellar/soroban-tools/cmd/soroban-rpc/internal/ledgerentry_storage"
"github.com/stellar/soroban-tools/cmd/soroban-rpc/internal/methods"
)

Expand Down Expand Up @@ -59,7 +60,12 @@ func Start(cfg config.LocalConfig) (exitCode int) {
logger.Fatalf("could not connect to history archive: %v", err)
}

storage, err := internal.NewLedgerEntryStorage(cfg.NetworkPassphrase, historyArchive, core)
db, err := ledgerentry_storage.OpenSQLiteDB(cfg.SQLiteDBPath)
if err != nil {
logger.Fatalf("could not open database: %v", err)
}

storage, err := ledgerentry_storage.NewLedgerEntryStorage(logger, db, cfg.NetworkPassphrase, historyArchive, core)
if err != nil {
logger.Fatalf("could not initialize ledger entry storage: %v", err)
}
Expand Down
210 changes: 0 additions & 210 deletions cmd/soroban-rpc/internal/ledgerentry_storage.go

This file was deleted.

Loading

0 comments on commit 7d04e28

Please sign in to comment.