snaptype

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: Apache-2.0 Imports: 10 Imported by: 4

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 Hex2InfoHash

func Hex2InfoHash(in string) (infoHash metainfo.Hash)

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, ok bool)

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
	BorEvents
	BorSpans
	NumberOfTypes
)

func ParseFileType

func ParseFileType(s string) (Type, bool)

func (Type) String

func (ft Type) String() string

type WebSeeds

type WebSeeds map[string]metainfo.UrlList // fileName -> []Url, can be Http/Ftp

func NewWebSeeds

func NewWebSeeds(list []WebSeedsFromProvider) WebSeeds

type WebSeedsFromProvider

type WebSeedsFromProvider map[string]string // fileName -> Url, can be Http/Ftp

Each provider can provide only 1 WebSeed url per file but overall BitTorrent protocol allowing multiple

Jump to

Keyboard shortcuts

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