Versions in this module Expand all Collapse all v1 v1.11.1 Jun 10, 2024 Changes in this version + const DefaultCheckpointFrequency + const NumLevels + func BucketPath(bucket Hash) string + func Categories() []string + func CategoryCheckpointPath(cat string, chk uint32) string + func ConnectBackend(u string, opts storage.ConnectOptions) (storage.Storage, error) + func DumpXdrAsJson(args []string) error + func Mirror(src *Archive, dst *Archive, opts *CommandOptions) error + func NameLockfile(file string) string + func RangePaths(r Range) []string + func Repair(src *Archive, dst *Archive, opts *CommandOptions) error + func SortTxsForHash(txset *xdr.TransactionSet) error + type Archive struct + func Connect(u string, opts ArchiveOptions) (*Archive, error) + func MustConnect(u string, opts ArchiveOptions) *Archive + func (a *Archive) BucketExists(bucket Hash) (bool, error) + func (a *Archive) BucketSize(bucket Hash) (int64, error) + func (a *Archive) CategoryCheckpointExists(cat string, chk uint32) (bool, error) + func (a *Archive) GetBucketPathForHash(hash Hash) string + func (a *Archive) GetCheckpointHAS(chk uint32) (HistoryArchiveState, error) + func (a *Archive) GetLedgerHeader(ledger uint32) (xdr.LedgerHeaderHistoryEntry, error) + func (a *Archive) GetLedgers(start, end uint32) (map[uint32]*Ledger, error) + func (a *Archive) GetPathHAS(path string) (HistoryArchiveState, error) + func (a *Archive) GetRootHAS() (HistoryArchiveState, error) + func (a *Archive) GetXdrStream(pth string) (*XdrStream, error) + func (a *Archive) GetXdrStreamForHash(hash Hash) (*XdrStream, error) + func (a *Archive) ListAllBucketHashes() (chan Hash, chan error) + func (a *Archive) ListAllBuckets() (chan string, chan error) + func (a *Archive) ListBucket(dp DirPrefix) (chan string, chan error) + func (a *Archive) ListCategoryCheckpoints(cat string, pth string) (chan uint32, chan error) + func (a *Archive) PutCheckpointHAS(chk uint32, has HistoryArchiveState, opts *CommandOptions) error + func (a *Archive) PutPathHAS(path string, has HistoryArchiveState, opts *CommandOptions) error + func (a *Archive) PutRootHAS(has HistoryArchiveState, opts *CommandOptions) error + func (arch *Archive) CheckBucketsMissing() map[Hash]bool + func (arch *Archive) CheckCheckpointFilesMissing(opts *CommandOptions) map[string][]uint32 + func (arch *Archive) ClearCachedInfo() + func (arch *Archive) GetCheckpointManager() CheckpointManager + func (arch *Archive) GetStats() []ArchiveStats + func (arch *Archive) Log(opts *CommandOptions) error + func (arch *Archive) MustGetBucketSize(hash Hash) int64 + func (arch *Archive) MustGetLedgerHeaderHistoryEntries(chk uint32) []xdr.LedgerHeaderHistoryEntry + func (arch *Archive) MustGetTransactionHistoryEntries(chk uint32) []xdr.TransactionHistoryEntry + func (arch *Archive) NoteCheckpointFile(cat string, chk uint32, present bool) + func (arch *Archive) NoteExistingBucket(bucket Hash) + func (arch *Archive) NoteReferencedBucket(bucket Hash) bool + func (arch *Archive) ReportBucketStats() + func (arch *Archive) ReportCheckpointStats() + func (arch *Archive) ReportInvalid(opts *CommandOptions) (bool, error) + func (arch *Archive) ReportMissing(opts *CommandOptions) (bool, error) + func (arch *Archive) Scan(opts *CommandOptions) error + func (arch *Archive) ScanAllBuckets() error + func (arch *Archive) ScanBuckets(opts *CommandOptions) error + func (arch *Archive) ScanCheckpoints(opts *CommandOptions) error + func (arch *Archive) ScanCheckpointsFast(opts *CommandOptions) error + func (arch *Archive) ScanCheckpointsSlow(opts *CommandOptions) error + func (arch *Archive) VerifyBucketEntries(h Hash) error + func (arch *Archive) VerifyBucketHash(h Hash) error + func (arch *Archive) VerifyCategoryCheckpoint(cat string, chk uint32) error + func (arch *Archive) VerifyLedgerHeaderHistoryEntry(entry *xdr.LedgerHeaderHistoryEntry) error + func (arch *Archive) VerifyTransactionHistoryEntry(entry *xdr.TransactionHistoryEntry) error + func (arch *Archive) VerifyTransactionHistoryResultEntry(entry *xdr.TransactionHistoryResultEntry) error + type ArchiveBucketCache struct + func MakeArchiveBucketCache(opts CacheOptions) (*ArchiveBucketCache, error) + func (abc *ArchiveBucketCache) Close() error + func (abc *ArchiveBucketCache) Evict(filepath string) + func (abc *ArchiveBucketCache) Exists(filepath string) bool + func (abc *ArchiveBucketCache) GetFile(filepath string, upstream storage.Storage) (io.ReadCloser, bool, error) + type ArchiveInterface interface + BucketExists func(bucket Hash) (bool, error) + BucketSize func(bucket Hash) (int64, error) + CategoryCheckpointExists func(cat string, chk uint32) (bool, error) + GetCheckpointHAS func(chk uint32) (HistoryArchiveState, error) + GetCheckpointManager func() CheckpointManager + GetLedgerHeader func(chk uint32) (xdr.LedgerHeaderHistoryEntry, error) + GetLedgers func(start, end uint32) (map[uint32]*Ledger, error) + GetPathHAS func(path string) (HistoryArchiveState, error) + GetRootHAS func() (HistoryArchiveState, error) + GetStats func() []ArchiveStats + GetXdrStream func(pth string) (*XdrStream, error) + GetXdrStreamForHash func(hash Hash) (*XdrStream, error) + ListAllBucketHashes func() (chan Hash, chan error) + ListAllBuckets func() (chan string, chan error) + ListBucket func(dp DirPrefix) (chan string, chan error) + ListCategoryCheckpoints func(cat string, pth string) (chan uint32, chan error) + PutCheckpointHAS func(chk uint32, has HistoryArchiveState, opts *CommandOptions) error + PutPathHAS func(path string, has HistoryArchiveState, opts *CommandOptions) error + PutRootHAS func(has HistoryArchiveState, opts *CommandOptions) error + func NewArchivePool(archiveURLs []string, opts ArchiveOptions) (ArchiveInterface, error) + func NewArchivePoolWithBackoff(archiveURLs []string, opts ArchiveOptions, strategy backoff.BackOff) (ArchiveInterface, error) + type ArchiveOptions struct + CachePath string + CheckpointFrequency uint32 + NetworkPassphrase string + type ArchivePool struct + func (pa *ArchivePool) BucketExists(bucket Hash) (bool, error) + func (pa *ArchivePool) BucketSize(bucket Hash) (int64, error) + func (pa *ArchivePool) CategoryCheckpointExists(cat string, chk uint32) (bool, error) + func (pa *ArchivePool) GetCheckpointHAS(chk uint32) (HistoryArchiveState, error) + func (pa *ArchivePool) GetCheckpointManager() CheckpointManager + func (pa *ArchivePool) GetLedgerHeader(chk uint32) (xdr.LedgerHeaderHistoryEntry, error) + func (pa *ArchivePool) GetLedgers(start, end uint32) (map[uint32]*Ledger, error) + func (pa *ArchivePool) GetPathHAS(path string) (HistoryArchiveState, error) + func (pa *ArchivePool) GetRootHAS() (HistoryArchiveState, error) + func (pa *ArchivePool) GetStats() []ArchiveStats + func (pa *ArchivePool) GetXdrStream(pth string) (*XdrStream, error) + func (pa *ArchivePool) GetXdrStreamForHash(hash Hash) (*XdrStream, error) + func (pa *ArchivePool) ListAllBucketHashes() (chan Hash, chan error) + func (pa *ArchivePool) ListAllBuckets() (chan string, chan error) + func (pa *ArchivePool) ListBucket(dp DirPrefix) (chan string, chan error) + func (pa *ArchivePool) ListCategoryCheckpoints(cat string, pth string) (chan uint32, chan error) + func (pa *ArchivePool) PutCheckpointHAS(chk uint32, has HistoryArchiveState, opts *CommandOptions) error + func (pa *ArchivePool) PutPathHAS(path string, has HistoryArchiveState, opts *CommandOptions) error + func (pa *ArchivePool) PutRootHAS(has HistoryArchiveState, opts *CommandOptions) error + type ArchiveStats interface + GetBackendName func() string + GetCacheBandwidth func() uint64 + GetCacheHits func() uint32 + GetDownloads func() uint32 + GetRequests func() uint32 + GetUploads func() uint32 + type CacheOptions struct + Cache bool + Log *log.Entry + MaxFiles uint + Path string + type CheckpointManager struct + func NewCheckpointManager(checkpointFrequency uint32) CheckpointManager + func (c CheckpointManager) GetCheckpoint(i uint32) uint32 + func (c CheckpointManager) GetCheckpointFrequency() uint32 + func (c CheckpointManager) GetCheckpointRange(i uint32) Range + func (c CheckpointManager) IsCheckpoint(i uint32) bool + func (c CheckpointManager) MakeRange(low uint32, high uint32) Range + func (c CheckpointManager) NextCheckpoint(i uint32) uint32 + func (c CheckpointManager) PrevCheckpoint(i uint32) uint32 + type CommandOptions struct + Concurrency int + DryRun bool + Force bool + Range Range + SkipOptional bool + Thorough bool + Verify bool + type DirPrefix [3]uint8 + func CheckpointPrefix(seq uint32) DirPrefix + func HashPrefix(h Hash) DirPrefix + func (d DirPrefix) Path() string + type FailingMockArchiveBackend struct + func (b *FailingMockArchiveBackend) CanListFiles() bool + func (b *FailingMockArchiveBackend) Close() error + func (b *FailingMockArchiveBackend) Exists(pth string) (bool, error) + func (b *FailingMockArchiveBackend) GetFile(pth string) (io.ReadCloser, error) + func (b *FailingMockArchiveBackend) ListFiles(pth string) (chan string, chan error) + func (b *FailingMockArchiveBackend) PutFile(pth string, in io.ReadCloser) error + func (b *FailingMockArchiveBackend) Size(pth string) (int64, error) + type FakeReader struct + func (fr *FakeReader) Close() error + func (fr *FakeReader) Read(b []byte) (int, error) + type Hash [sha256.Size]byte + func DecodeHash(s string) (Hash, error) + func EmptyXdrArrayHash() Hash + func HashEmptyTxSet(previousLedgerHash Hash) Hash + func HashTxSet(txset *xdr.TransactionSet) (Hash, error) + func HashXdr(x interface{}) (Hash, error) + func MustDecodeHash(s string) Hash + func (h Hash) IsZero() bool + func (h Hash) String() string + type HistoryArchiveState struct + CurrentBuckets [NumLevels]struct{ ... } + CurrentLedger uint32 + NetworkPassphrase string + Server string + Version int + func (h *HistoryArchiveState) BucketListHash() (xdr.Hash, error) + func (h *HistoryArchiveState) Buckets() ([]Hash, error) + func (h *HistoryArchiveState) LevelSummary() (string, int, error) + func (h *HistoryArchiveState) Range() Range + func (has *HistoryArchiveState) GetChangedBuckets(arch *Archive, prevHas *HistoryArchiveState) (string, int, int64) + type Ledger struct + Header xdr.LedgerHeaderHistoryEntry + Transaction xdr.TransactionHistoryEntry + TransactionResult xdr.TransactionHistoryResultEntry + type MockArchive struct + func (m *MockArchive) BucketExists(bucket Hash) (bool, error) + func (m *MockArchive) BucketSize(bucket Hash) (int64, error) + func (m *MockArchive) CategoryCheckpointExists(cat string, chk uint32) (bool, error) + func (m *MockArchive) GetCheckpointHAS(chk uint32) (HistoryArchiveState, error) + func (m *MockArchive) GetCheckpointManager() CheckpointManager + func (m *MockArchive) GetLedgerHeader(chk uint32) (xdr.LedgerHeaderHistoryEntry, error) + func (m *MockArchive) GetLedgers(start, end uint32) (map[uint32]*Ledger, error) + func (m *MockArchive) GetPathHAS(path string) (HistoryArchiveState, error) + func (m *MockArchive) GetRootHAS() (HistoryArchiveState, error) + func (m *MockArchive) GetStats() []ArchiveStats + func (m *MockArchive) GetXdrStream(pth string) (*XdrStream, error) + func (m *MockArchive) GetXdrStreamForHash(hash Hash) (*XdrStream, error) + func (m *MockArchive) ListAllBucketHashes() (chan Hash, chan error) + func (m *MockArchive) ListAllBuckets() (chan string, chan error) + func (m *MockArchive) ListBucket(dp DirPrefix) (chan string, chan error) + func (m *MockArchive) ListCategoryCheckpoints(cat string, pth string) (chan uint32, chan error) + func (m *MockArchive) PutCheckpointHAS(chk uint32, has HistoryArchiveState, opts *CommandOptions) error + func (m *MockArchive) PutPathHAS(path string, has HistoryArchiveState, opts *CommandOptions) error + func (m *MockArchive) PutRootHAS(has HistoryArchiveState, opts *CommandOptions) error + type MockArchiveBackend struct + func (b *MockArchiveBackend) CanListFiles() bool + func (b *MockArchiveBackend) Close() error + func (b *MockArchiveBackend) Exists(pth string) (bool, error) + func (b *MockArchiveBackend) GetFile(pth string) (io.ReadCloser, error) + func (b *MockArchiveBackend) ListFiles(pth string) (chan string, chan error) + func (b *MockArchiveBackend) PutFile(pth string, in io.ReadCloser) error + func (b *MockArchiveBackend) Size(pth string) (int64, error) + type MockArchiveStats struct + func (m *MockArchiveStats) GetBackendName() string + func (m *MockArchiveStats) GetCacheBandwidth() uint64 + func (m *MockArchiveStats) GetCacheHits() uint32 + func (m *MockArchiveStats) GetDownloads() uint32 + func (m *MockArchiveStats) GetRequests() uint32 + func (m *MockArchiveStats) GetUploads() uint32 + type Range struct + High uint32 + Low uint32 + func (r Range) GenerateCheckpoints(cManager CheckpointManager) chan uint32 + func (r Range) InRange(sequence uint32) bool + func (r Range) Size() uint32 + func (r Range) SizeInCheckPoints(cManager CheckpointManager) int + func (r Range) String() string + type XdrStream struct + func CreateXdrStream(entries ...xdr.BucketEntry) *XdrStream + func NewXdrGzStream(in io.ReadCloser) (*XdrStream, error) + func NewXdrStream(in io.ReadCloser) *XdrStream + func (x *XdrStream) BytesRead() int64 + func (x *XdrStream) Close() error + func (x *XdrStream) Discard(n int64) (int64, error) + func (x *XdrStream) ExpectedHash() ([sha256.Size]byte, bool) + func (x *XdrStream) GzipBytesRead() int64 + func (x *XdrStream) ReadOne(in xdr.DecoderFrom) error + func (x *XdrStream) SetExpectedHash(hash [sha256.Size]byte)