snaptype

package
v0.0.0-...-c80a3f0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const Erigon2MinSegmentSize = 1_000
View Source
const Erigon2SegmentSize = 500_000
View Source
const Erigon3SeedableSteps = 32

Variables

View Source
var AllSnapshotTypes = []Type{Headers, Bodies, Transactions}
View Source
var (
	ErrInvalidFileName = fmt.Errorf("invalid compressed file name")
)

Functions

func DatFileName

func DatFileName(from, to uint64, fType string) string

func FileName

func FileName(from, to uint64, fileType string) string

func IdxFileName

func IdxFileName(from, to uint64, fType string) string

func IsCorrectFileName

func IsCorrectFileName(name string) bool

func IsCorrectHistoryFileName

func IsCorrectHistoryFileName(name string) bool

func SegmentFileName

func SegmentFileName(from, to uint64, t Type) string

func TmpFiles

func TmpFiles(dir string) (res []string, err error)

Types

type FileInfo

type FileInfo struct {
	Version   uint8
	From, To  uint64
	Path, Ext string
	T         Type
}

FileInfo - parsed file metadata

func FilesWithExt

func FilesWithExt(dir, expectExt string) ([]FileInfo, error)

func FilterExt

func FilterExt(in []FileInfo, expectExt string) (out []FileInfo)

func IdxFiles

func IdxFiles(dir string) (res []FileInfo, err error)

func ParseDir

func ParseDir(dir string) (res []FileInfo, err error)

ParseDir - reading dir (

func ParseFileName

func ParseFileName(dir, fileName string) (res FileInfo, err error)

func Segments

func Segments(dir string) (res []FileInfo, err error)

func (FileInfo) NeedTorrentFile

func (f FileInfo) NeedTorrentFile() bool

func (FileInfo) Seedable

func (f FileInfo) Seedable() bool

func (FileInfo) TorrentFileExists

func (f FileInfo) TorrentFileExists() bool

type IdxType

type IdxType string
const (
	Transactions2Block IdxType = "transactions-to-block"
)

func (IdxType) String

func (it IdxType) String() string

type Type

type Type int
const (
	Headers Type = iota
	Bodies
	Transactions
	NumberOfTypes
)

func ParseFileType

func ParseFileType(s string) (Type, bool)

func (Type) String

func (ft Type) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL