utils

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChainIdMainnet  = "kyve-1"
	ChainIdKaon     = "kaon-1"
	ChainIdKorellia = "korellia-2"

	RestEndpointMainnet  = "https://api.kyve.network"
	RestEndpointKaon     = "https://api.kaon.kyve.network"
	RestEndpointKorellia = "https://api.korellia.kyve.network"

	RestEndpointArweave     = "https://arweave.net"
	RestEndpointBundlr      = "https://arweave.net"
	RestEndpointKYVEStorage = "https://storage.kyve.network"

	SegmentKey = "quSEhAvH5fqlHyop9r9mDGxgd97ro3vQ"
)
View Source
const (
	KSyncRuntimeTendermint      = "@kyvejs/tendermint"
	KSyncRuntimeTendermintBsync = "@kyvejs/tendermint-bsync"
	KSyncRuntimeTendermintSsync = "@kyvejs/tendermint-ssync"
)
View Source
const (
	EngineTendermintV34   = "tendermint-v0.34"
	EngineCometBFTV37     = "cometbft-v0.37"
	EngineCometBFTV38     = "cometbft-v0.38"
	EngineCelestiaCoreV34 = "celestia-core-v0.34"

	EngineTendermintV34Legacy   = "tendermint-v34"
	EngineCometBFTV37Legacy     = "cometbft-v37"
	EngineCometBFTV38Legacy     = "cometbft-v38"
	EngineCelestiaCoreV34Legacy = "celestia-core-v34"

	EngineTendermintLegacy   = "tendermint"
	EngineCometBFTLegacy     = "cometbft"
	EngineCelestiaCoreLegacy = "tendermint-celestiacore"
)
View Source
const (
	DefaultEngine             = EngineTendermintV34
	DefaultChainId            = ChainIdMainnet
	DefaultBackupPath         = "~/.ksync/backups"
	DefaultMetricsServerPort  = 8080
	DefaultSnapshotServerPort = 7878
)
View Source
const (
	BundlesPageLimit            = 1000
	BlockBuffer                 = 300
	PruningInterval             = 100
	SnapshotPruningAheadFactor  = 3
	SnapshotPruningWindowFactor = 6
	BackoffMaxRetries           = 10
	RequestTimeoutMS            = 250
)
View Source
const (
	SYNC_STARTED    = "SYNC_STARTED"
	SYNC_COMPLETED  = "SYNC_COMPLETED"
	BLOCK_SYNC      = "BLOCK_SYNC"
	STATE_SYNC      = "STATE_SYNC"
	HEIGHT_SYNC     = "HEIGHT_SYNC"
	SERVE_SNAPSHOTS = "SERVE_SNAPSHOTS"
	INFO            = "INFO"
	RESET           = "RESET"
	PRUNE           = "PRUNE"
	BACKUP          = "BACKUP"
	VERSION         = "VERSION"
	ENGINES         = "ENGINES"
)
View Source
const (
	DefaultRegistryURL = "https://raw.githubusercontent.com/KYVENetwork/source-registry/main/.github/registry.yml"
)

Variables

This section is empty.

Functions

func CreateSha256Checksum added in v1.0.0

func CreateSha256Checksum(input []byte) (hash string)

func DecompressGzip

func DecompressGzip(input []byte) ([]byte, error)

func FormatGenesisFile added in v1.5.0

func FormatGenesisFile(genesisPath string) error

func GetChainRest added in v1.0.0

func GetChainRest(chainId, chainRest string) string

func GetFromUrl added in v1.0.0

func GetFromUrl(url string) ([]byte, error)

GetFromUrl tries to fetch data from url with a custom User-Agent header

func GetFromUrlWithBackoff added in v1.0.0

func GetFromUrlWithBackoff(url string) (data []byte, err error)

GetFromUrlWithBackoff tries to fetch data from url with exponential backoff

func GetHomePathFromBinary added in v1.1.0

func GetHomePathFromBinary(binaryPath string) string

func GetVersion added in v1.4.0

func GetVersion() string

func IsFileGreaterThanOrEqualTo100MB added in v0.5.0

func IsFileGreaterThanOrEqualTo100MB(filePath string) (bool, error)

func KsyncLogger added in v1.1.0

func KsyncLogger(moduleName string) zerolog.Logger

func LogFormatter added in v1.1.0

func LogFormatter(keyvals ...interface{}) zerolog.Logger

func ParseBlockHeightFromKey added in v1.1.0

func ParseBlockHeightFromKey(key string) (int64, error)

func ParseSnapshotFromKey added in v1.0.0

func ParseSnapshotFromKey(key string) (height int64, chunkIndex int64, err error)

func StartBinaryProcessForDB added in v1.1.0

func StartBinaryProcessForDB(engine types.Engine, binaryPath string, debug bool, args []string) (processId int, err error)

func StartBinaryProcessForP2P added in v1.1.0

func StartBinaryProcessForP2P(engine types.Engine, binaryPath string, debug bool, args []string) (processId int, err error)

func StopProcessByProcessId added in v1.1.0

func StopProcessByProcessId(processId int) error

func TrackBackupEvent added in v1.2.1

func TrackBackupEvent(backupCompression string, backupKeepRecent int64, optOut bool)

func TrackEnginesEvent added in v1.5.0

func TrackEnginesEvent(optOut bool)

func TrackInfoEvent added in v1.2.1

func TrackInfoEvent(chainId string, optOut bool)

func TrackPruningEvent added in v1.2.1

func TrackPruningEvent(untilHeight int64, optOut bool)

func TrackResetEvent added in v1.2.1

func TrackResetEvent(optOut bool)

func TrackServeSnapshotsEvent added in v1.2.1

func TrackServeSnapshotsEvent(engine types.Engine, chainId, chainRest, storageRest string, snapshotPort int64, metrics bool, metricsPort int64, startHeight int64, pruning, keepSnapshots, debug, optOut bool)

func TrackSyncCompletedEvent added in v1.2.1

func TrackSyncCompletedEvent(stateSyncHeight, blocksSynced, targetHeight int64, elapsed float64, optOut bool)

func TrackSyncStartEvent added in v1.2.1

func TrackSyncStartEvent(engine types.Engine, syncType, chainId, chainRest, storageRest string, targetHeight int64, optOut bool)

func TrackVersionEvent added in v1.2.1

func TrackVersionEvent(optOut bool)

Types

This section is empty.

Jump to

Keyboard shortcuts

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