utils

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: Apache-2.0 Imports: 20 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"
	RestEndpointTurboStorage = "https://arweave.net"
)
View Source
const (
	RuntimeTendermint      = "@kyvejs/tendermint"
	RuntimeTendermintBsync = "@kyvejs/tendermint-bsync"
	RuntimeTendermintSsync = "@kyvejs/tendermint-ssync"
)
View Source
const (
	EngineTendermintV34   = "TENDERMINT-V34"
	EngineCelestiaCoreV34 = "CELESTIA-CORE-V34"
	EngineCometBFTV37     = "COMETBFT-V37"
	EngineCometBFTV38     = "COMETBFT-V38"
)
View Source
const (
	DefaultChainId            = ChainIdMainnet
	DefaultRpcServerPort      = 7777
	DefaultSnapshotServerPort = 7878
)
View Source
const (
	BundlesPageLimit            = 1000
	BlockBuffer                 = 300
	PruningInterval             = 100
	SnapshotPruningAheadFactor  = 3
	SnapshotPruningWindowFactor = 6
	BackoffMaxRetries           = 10
	RequestTimeoutMS            = 100
	RequestBlocksTimeoutMS      = 250
)
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 DecompressBundleFromStorageProvider added in v1.9.0

func DecompressBundleFromStorageProvider(bundle types.FinalizedBundle, data []byte) ([]byte, error)

func DecompressGzip

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

func GetDataFromFinalizedBundle added in v1.9.0

func GetDataFromFinalizedBundle(bundle types.FinalizedBundle) ([]byte, error)

GetDataFromFinalizedBundle downloads the data from the provided bundle, verify if the checksum on the KYVE chain matches and finally decompresses it before returning

func GetFinalizedBundleById added in v1.9.0

func GetFinalizedBundleById(restEndpoint string, poolId int64, bundleId int64) (*types.FinalizedBundle, error)

func GetFinalizedBundlesPage added in v1.9.0

func GetFinalizedBundlesPage(restEndpoint string, poolId int64, paginationLimit int64, paginationKey string, reverse bool) ([]types.FinalizedBundle, string, error)

func GetFinalizedBundlesPageWithOffset added in v1.9.0

func GetFinalizedBundlesPageWithOffset(restEndpoint string, poolId int64, paginationLimit, paginationOffset int64, paginationKey string, reverse bool) ([]types.FinalizedBundle, string, error)

func GetFromUrl added in v1.0.0

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

GetFromUrl tries to fetch data from url with exponential backoff, we usually always want a request to succeed so it is implemented by default

func GetPool added in v1.9.0

func GetPool(restEndpoint string, poolId int64) (*types.PoolResponse, error)

func GetUserConfirmationInput added in v1.9.0

func GetUserConfirmationInput() (bool, error)

func GetVersion added in v1.4.0

func GetVersion() string

func IsUpgradeHeight added in v1.9.0

func IsUpgradeHeight(homePath string, height int64) bool

func ParseSnapshotFromKey added in v1.0.0

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

func RetrieveDataFromStorageProvider added in v1.9.0

func RetrieveDataFromStorageProvider(bundle types.FinalizedBundle) ([]byte, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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