diff --git a/exp/lighthorizon/main.go b/exp/lighthorizon/main.go index 009249585c..b50ac82a3a 100644 --- a/exp/lighthorizon/main.go +++ b/exp/lighthorizon/main.go @@ -2,29 +2,19 @@ package main import ( "flag" - "fmt" "net/http" - "os" "github.com/go-chi/chi" "github.com/stellar/go/exp/lighthorizon/actions" "github.com/stellar/go/exp/lighthorizon/archive" "github.com/stellar/go/exp/lighthorizon/index" "github.com/stellar/go/exp/lighthorizon/services" - "github.com/stellar/go/toid" "github.com/stellar/go/network" "github.com/stellar/go/support/log" ) func main() { - - os.Args = append(os.Args, "-source=file:///Users/sreuland/workspace/txmeta-live-archive") - os.Args = append(os.Args, "-indexes=file:///Users/sreuland/workspace/txmeta-live-archive") - - cursor := toid.New(1586111, 1, 1).ToInt64() - fmt.Printf("\nthe cursor %v\n", cursor) - sourceUrl := flag.String("source", "gcs://horizon-archive-poc", "history archive url to read txmeta files") indexesUrl := flag.String("indexes", "file://indexes", "url of the indexes") networkPassphrase := flag.String("network-passphrase", network.TestNetworkPassphrase, "network passphrase") diff --git a/exp/lighthorizon/services/main.go b/exp/lighthorizon/services/main.go index b5a5758167..fa8160f69a 100644 --- a/exp/lighthorizon/services/main.go +++ b/exp/lighthorizon/services/main.go @@ -37,9 +37,9 @@ func (lh *LightHorizon) GetOperationsByAccount(ctx context.Context, cursor int64 ledgerSequence := startingCheckPointLedger for (ledgerSequence - startingCheckPointLedger) < 64 { - ledger, findErr := lh.Archive.GetLedger(ctx, ledgerSequence) - if findErr != nil { - return nil, errors.Wrap(findErr, "indexing state is invalid, missing ledgers from checkpoint") + ledger, ledgerErr := lh.Archive.GetLedger(ctx, ledgerSequence) + if ledgerErr != nil { + return nil, errors.Wrapf(ledgerErr, "ledger export state is out of sync, missing ledger %v from checkpoint %v", ledgerSequence, ledgerSequence/64) } reader, readerErr := lh.Archive.NewLedgerTransactionReaderFromLedgerCloseMeta(lh.Passphrase, ledger) @@ -120,7 +120,7 @@ func (lh *LightHorizon) GetTransactionsByAccount(ctx context.Context, cursor int for (ledgerSequence - startingCheckPointLedger) < 64 { ledger, ledgerErr := lh.Archive.GetLedger(ctx, ledgerSequence) if ledgerErr != nil { - return nil, errors.Wrap(ledgerErr, "indexing state is invalid, missing ledgers from checkpoint") + return nil, errors.Wrapf(ledgerErr, "ledger export state is out of sync, missing ledger %v from checkpoint %v", ledgerSequence, ledgerSequence/64) } reader, readerErr := lh.Archive.NewLedgerTransactionReaderFromLedgerCloseMeta(lh.Passphrase, ledger)