Documentation ¶
Index ¶
- Constants
- func BucketPath(bucket Hash) string
- func Categories() []string
- func CategoryCheckpointPath(cat string, chk uint32) string
- func DumpXdrAsJson(args []string) error
- func Mirror(src *Archive, dst *Archive, opts *CommandOptions) error
- func NextCheckpoint(i uint32) uint32
- func PrevCheckpoint(i uint32) uint32
- func RangePaths(r Range) []string
- func Repair(src *Archive, dst *Archive, opts *CommandOptions) error
- func SortTxsForHash(txset *xdr.TransactionSet) error
- func WriteFramedXdr(out io.Writer, in interface{}) error
- type Archive
- func (a *Archive) BucketExists(bucket Hash) (bool, error)
- func (a *Archive) CategoryCheckpointExists(cat string, chk uint32) (bool, error)
- func (arch *Archive) CheckBucketsMissing() map[Hash]bool
- func (arch *Archive) CheckCheckpointFilesMissing(opts *CommandOptions) map[string][]uint32
- func (arch *Archive) ClearCachedInfo()
- func (a *Archive) GetCheckpointHAS(chk uint32) (HistoryArchiveState, 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 (arch *Archive) NoteCheckpointFile(cat string, chk uint32, present bool)
- func (arch *Archive) NoteExistingBucket(bucket Hash)
- func (arch *Archive) NoteReferencedBucket(bucket Hash) bool
- 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) ReportBucketStats()
- func (arch *Archive) ReportCheckpointStats()
- func (arch *Archive) ReportInvalid(opts *CommandOptions) error
- func (arch *Archive) ReportMissing(opts *CommandOptions) 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 ArchiveBackend
- type ArchiveInterface
- type CommandOptions
- type ConnectOptions
- type DirPrefix
- type FsArchiveBackend
- func (b *FsArchiveBackend) CanListFiles() bool
- func (b *FsArchiveBackend) Exists(pth string) (bool, error)
- func (b *FsArchiveBackend) GetFile(pth string) (io.ReadCloser, error)
- func (b *FsArchiveBackend) ListFiles(pth string) (chan string, chan error)
- func (b *FsArchiveBackend) PutFile(pth string, in io.ReadCloser) error
- type Hash
- type HistoryArchiveState
- type HttpArchiveBackend
- func (b *HttpArchiveBackend) CanListFiles() bool
- func (b *HttpArchiveBackend) Exists(pth string) (bool, error)
- func (b *HttpArchiveBackend) GetFile(pth string) (io.ReadCloser, error)
- func (b *HttpArchiveBackend) ListFiles(pth string) (chan string, chan error)
- func (b *HttpArchiveBackend) PutFile(pth string, in io.ReadCloser) error
- type MockArchive
- func (m *MockArchive) BucketExists(bucket Hash) (bool, error)
- func (m *MockArchive) CategoryCheckpointExists(cat string, chk uint32) (bool, error)
- func (m *MockArchive) GetCheckpointHAS(chk uint32) (HistoryArchiveState, error)
- func (m *MockArchive) GetPathHAS(path string) (HistoryArchiveState, error)
- func (m *MockArchive) GetRootHAS() (HistoryArchiveState, error)
- 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
- func (b *MockArchiveBackend) CanListFiles() bool
- 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
- type Range
- type S3ArchiveBackend
- func (b *S3ArchiveBackend) CanListFiles() bool
- func (b *S3ArchiveBackend) Exists(pth string) (bool, error)
- func (b *S3ArchiveBackend) GetFile(pth string) (io.ReadCloser, error)
- func (b *S3ArchiveBackend) ListFiles(pth string) (chan string, chan error)
- func (b *S3ArchiveBackend) PutFile(pth string, in io.ReadCloser) error
- type XdrStream
Constants ¶
View Source
const CheckpointFreq = uint32(64)
View Source
const NumLevels = 11
Variables ¶
This section is empty.
Functions ¶
func BucketPath ¶
func Categories ¶
func Categories() []string
func CategoryCheckpointPath ¶
func DumpXdrAsJson ¶
func NextCheckpoint ¶
func PrevCheckpoint ¶
func RangePaths ¶
Returns an array of path prefixes to walk to enumerate all the objects in the provided range.
func SortTxsForHash ¶
func SortTxsForHash(txset *xdr.TransactionSet) error
func WriteFramedXdr ¶
Types ¶
type Archive ¶
type Archive struct {
// contains filtered or unexported fields
}
func MustConnect ¶
func MustConnect(u string, opts ConnectOptions) *Archive
func (*Archive) CategoryCheckpointExists ¶
func (*Archive) CheckBucketsMissing ¶
func (*Archive) CheckCheckpointFilesMissing ¶
func (arch *Archive) CheckCheckpointFilesMissing(opts *CommandOptions) map[string][]uint32
func (*Archive) ClearCachedInfo ¶
func (arch *Archive) ClearCachedInfo()
func (*Archive) GetCheckpointHAS ¶
func (a *Archive) GetCheckpointHAS(chk uint32) (HistoryArchiveState, error)
func (*Archive) GetPathHAS ¶
func (a *Archive) GetPathHAS(path string) (HistoryArchiveState, error)
func (*Archive) GetRootHAS ¶
func (a *Archive) GetRootHAS() (HistoryArchiveState, error)
func (*Archive) GetXdrStreamForHash ¶
func (*Archive) ListAllBucketHashes ¶
func (*Archive) ListAllBuckets ¶
func (*Archive) ListCategoryCheckpoints ¶
func (*Archive) NoteCheckpointFile ¶
func (*Archive) NoteExistingBucket ¶
func (*Archive) NoteReferencedBucket ¶
func (*Archive) PutCheckpointHAS ¶
func (a *Archive) PutCheckpointHAS(chk uint32, has HistoryArchiveState, opts *CommandOptions) error
func (*Archive) PutPathHAS ¶
func (a *Archive) PutPathHAS(path string, has HistoryArchiveState, opts *CommandOptions) error
func (*Archive) PutRootHAS ¶
func (a *Archive) PutRootHAS(has HistoryArchiveState, opts *CommandOptions) error
func (*Archive) ReportBucketStats ¶
func (arch *Archive) ReportBucketStats()
func (*Archive) ReportCheckpointStats ¶
func (arch *Archive) ReportCheckpointStats()
func (*Archive) ReportInvalid ¶
func (arch *Archive) ReportInvalid(opts *CommandOptions) error
func (*Archive) ReportMissing ¶
func (arch *Archive) ReportMissing(opts *CommandOptions) error
func (*Archive) Scan ¶
func (arch *Archive) Scan(opts *CommandOptions) error
func (*Archive) ScanAllBuckets ¶
func (*Archive) ScanBuckets ¶
func (arch *Archive) ScanBuckets(opts *CommandOptions) error
func (*Archive) ScanCheckpoints ¶
func (arch *Archive) ScanCheckpoints(opts *CommandOptions) error
func (*Archive) ScanCheckpointsFast ¶
func (arch *Archive) ScanCheckpointsFast(opts *CommandOptions) error
func (*Archive) ScanCheckpointsSlow ¶
func (arch *Archive) ScanCheckpointsSlow(opts *CommandOptions) error
func (*Archive) VerifyBucketEntries ¶
func (*Archive) VerifyBucketHash ¶
func (*Archive) VerifyCategoryCheckpoint ¶
func (*Archive) VerifyLedgerHeaderHistoryEntry ¶
func (arch *Archive) VerifyLedgerHeaderHistoryEntry(entry *xdr.LedgerHeaderHistoryEntry) error
func (*Archive) VerifyTransactionHistoryEntry ¶
func (arch *Archive) VerifyTransactionHistoryEntry(entry *xdr.TransactionHistoryEntry) error
func (*Archive) VerifyTransactionHistoryResultEntry ¶
func (arch *Archive) VerifyTransactionHistoryResultEntry(entry *xdr.TransactionHistoryResultEntry) error
type ArchiveBackend ¶
type ArchiveInterface ¶
type ArchiveInterface interface { GetPathHAS(path string) (HistoryArchiveState, error) PutPathHAS(path string, has HistoryArchiveState, opts *CommandOptions) error BucketExists(bucket Hash) (bool, error) CategoryCheckpointExists(cat string, chk uint32) (bool, error) GetRootHAS() (HistoryArchiveState, error) GetCheckpointHAS(chk uint32) (HistoryArchiveState, error) PutCheckpointHAS(chk uint32, has HistoryArchiveState, opts *CommandOptions) error PutRootHAS(has HistoryArchiveState, opts *CommandOptions) error ListBucket(dp DirPrefix) (chan string, chan error) ListAllBuckets() (chan string, chan error) ListAllBucketHashes() (chan Hash, chan error) ListCategoryCheckpoints(cat string, pth string) (chan uint32, chan error) GetXdrStreamForHash(hash Hash) (*XdrStream, error) GetXdrStream(pth string) (*XdrStream, error) }
type CommandOptions ¶
type ConnectOptions ¶
type FsArchiveBackend ¶
type FsArchiveBackend struct {
// contains filtered or unexported fields
}
func (*FsArchiveBackend) CanListFiles ¶
func (b *FsArchiveBackend) CanListFiles() bool
func (*FsArchiveBackend) GetFile ¶
func (b *FsArchiveBackend) GetFile(pth string) (io.ReadCloser, error)
func (*FsArchiveBackend) ListFiles ¶
func (b *FsArchiveBackend) ListFiles(pth string) (chan string, chan error)
func (*FsArchiveBackend) PutFile ¶
func (b *FsArchiveBackend) PutFile(pth string, in io.ReadCloser) error
type Hash ¶
func DecodeHash ¶
func EmptyXdrArrayHash ¶
func EmptyXdrArrayHash() Hash
func HashEmptyTxSet ¶
func MustDecodeHash ¶
type HistoryArchiveState ¶
type HistoryArchiveState struct { Version int `json:"version"` Server string `json:"server"` CurrentLedger uint32 `json:"currentLedger"` CurrentBuckets [NumLevels]struct { Curr string `json:"curr"` Snap string `json:"snap"` Next struct { State uint32 `json:"state"` Output string `json:"output,omitempty"` } `json:"next"` } `json:"currentBuckets"` }
func (*HistoryArchiveState) BucketListHash ¶
func (h *HistoryArchiveState) BucketListHash() (xdr.Hash, error)
BucketListHash calculates the hash of bucket list in the HistoryArchiveState. This can be later compared with LedgerHeader.BucketListHash of the checkpoint ledger to ensure data in history archive has not been changed by a malicious actor. Warning: Ledger header should be fetched from a trusted (!) diamnet-core instead of ex. history archives!
func (*HistoryArchiveState) Buckets ¶
func (h *HistoryArchiveState) Buckets() ([]Hash, error)
func (*HistoryArchiveState) LevelSummary ¶
func (h *HistoryArchiveState) LevelSummary() (string, int, error)
func (*HistoryArchiveState) Range ¶
func (h *HistoryArchiveState) Range() Range
type HttpArchiveBackend ¶
type HttpArchiveBackend struct {
// contains filtered or unexported fields
}
func (*HttpArchiveBackend) CanListFiles ¶
func (b *HttpArchiveBackend) CanListFiles() bool
func (*HttpArchiveBackend) GetFile ¶
func (b *HttpArchiveBackend) GetFile(pth string) (io.ReadCloser, error)
func (*HttpArchiveBackend) ListFiles ¶
func (b *HttpArchiveBackend) ListFiles(pth string) (chan string, chan error)
func (*HttpArchiveBackend) PutFile ¶
func (b *HttpArchiveBackend) PutFile(pth string, in io.ReadCloser) error
type MockArchive ¶
MockArchive is a mockable archive.
func (*MockArchive) BucketExists ¶
func (m *MockArchive) BucketExists(bucket Hash) (bool, error)
func (*MockArchive) CategoryCheckpointExists ¶
func (m *MockArchive) CategoryCheckpointExists(cat string, chk uint32) (bool, error)
func (*MockArchive) GetCheckpointHAS ¶
func (m *MockArchive) GetCheckpointHAS(chk uint32) (HistoryArchiveState, error)
func (*MockArchive) GetPathHAS ¶
func (m *MockArchive) GetPathHAS(path string) (HistoryArchiveState, error)
func (*MockArchive) GetRootHAS ¶
func (m *MockArchive) GetRootHAS() (HistoryArchiveState, error)
func (*MockArchive) GetXdrStream ¶
func (m *MockArchive) GetXdrStream(pth string) (*XdrStream, error)
func (*MockArchive) GetXdrStreamForHash ¶
func (m *MockArchive) GetXdrStreamForHash(hash Hash) (*XdrStream, error)
func (*MockArchive) ListAllBucketHashes ¶
func (m *MockArchive) ListAllBucketHashes() (chan Hash, chan error)
func (*MockArchive) ListAllBuckets ¶
func (m *MockArchive) ListAllBuckets() (chan string, chan error)
func (*MockArchive) ListBucket ¶
func (m *MockArchive) ListBucket(dp DirPrefix) (chan string, chan error)
func (*MockArchive) ListCategoryCheckpoints ¶
func (m *MockArchive) ListCategoryCheckpoints(cat string, pth string) (chan uint32, chan error)
func (*MockArchive) PutCheckpointHAS ¶
func (m *MockArchive) PutCheckpointHAS(chk uint32, has HistoryArchiveState, opts *CommandOptions) error
func (*MockArchive) PutPathHAS ¶
func (m *MockArchive) PutPathHAS(path string, has HistoryArchiveState, opts *CommandOptions) error
func (*MockArchive) PutRootHAS ¶
func (m *MockArchive) PutRootHAS(has HistoryArchiveState, opts *CommandOptions) error
type MockArchiveBackend ¶
type MockArchiveBackend struct {
// contains filtered or unexported fields
}
func (*MockArchiveBackend) CanListFiles ¶
func (b *MockArchiveBackend) CanListFiles() bool
func (*MockArchiveBackend) GetFile ¶
func (b *MockArchiveBackend) GetFile(pth string) (io.ReadCloser, error)
func (*MockArchiveBackend) ListFiles ¶
func (b *MockArchiveBackend) ListFiles(pth string) (chan string, chan error)
func (*MockArchiveBackend) PutFile ¶
func (b *MockArchiveBackend) PutFile(pth string, in io.ReadCloser) error
type Range ¶
func (Range) Checkpoints ¶
type S3ArchiveBackend ¶
type S3ArchiveBackend struct {
// contains filtered or unexported fields
}
func (*S3ArchiveBackend) CanListFiles ¶
func (b *S3ArchiveBackend) CanListFiles() bool
func (*S3ArchiveBackend) GetFile ¶
func (b *S3ArchiveBackend) GetFile(pth string) (io.ReadCloser, error)
func (*S3ArchiveBackend) ListFiles ¶
func (b *S3ArchiveBackend) ListFiles(pth string) (chan string, chan error)
func (*S3ArchiveBackend) PutFile ¶
func (b *S3ArchiveBackend) PutFile(pth string, in io.ReadCloser) error
type XdrStream ¶
type XdrStream struct {
// contains filtered or unexported fields
}
func NewXdrGzStream ¶
func NewXdrGzStream(in io.ReadCloser) (*XdrStream, error)
func NewXdrStream ¶
func NewXdrStream(in io.ReadCloser) *XdrStream
Click to show internal directories.
Click to hide internal directories.