snaptype

package
v0.0.0-...-ff78b6e Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const Erigon2MergeLimit = 500_000
View Source
const Erigon2MinSegmentSize = 1_000
View Source
const Erigon2RecentMergeLimit = 100_000 //nolint

Use-cases:

  • produce and seed snapshots earlier on chain tip. reduce depnedency on "good peers with history" at p2p-network. Some networks have no much archive peers, also ConsensusLayer clients are not-good(not-incentivised) at serving history.
  • avoiding having too much files: more files(shards) - means "more metadata", "more lookups for non-indexed queries", "more dictionaries", "more bittorrent connections", ... less files - means small files will be removed after merge (no peers for this files).
View Source
const Erigon3SeedableSteps = 32

Variables

View Source
var BlockSnapshotTypes = []Type{Headers, Bodies, Transactions}
View Source
var BorSnapshotTypes = []Type{BorEvents, BorSpans}
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 TorrentUrls

type TorrentUrls map[string][]*url.URL

type Type

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

func ParseFileType

func ParseFileType(s string) (Type, bool)

func (Type) String

func (ft Type) String() string

type WebSeedUrls

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

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