Documentation
¶
Index ¶
- Constants
- Variables
- func BytesToHex(bytes *[][32]byte) []string
- func CalculateSHA256Hash(obj interface{}) [32]byte
- func CreateSha256Checksum(input []byte) (hash string)
- func DecodeProof(encodedProofString string) (*types.Proof, error)
- func DecompressGzip(input []byte) ([]byte, error)
- func EncodeProof(poolId, bundleId int64, chainId string, dataItemKey, dataItemValueKey string, ...) string
- func GetChainRest(chainId, chainRest string) string
- func GetFromUrl(url string) ([]byte, error)
- func GetFromUrlWithBackoff(url string) (data []byte, err error)
- func GetUniqueDataitemName(item *types.TrustlessDataItem) string
- func GetVersion() string
- func StartPrometheus(port string)
- func TrustlessApiLogger(moduleName string) zerolog.Logger
- func WrapIntoJsonRpcErrorResponse(errorMessage string, data any) any
- func WrapIntoJsonRpcResponse(result interface{}) ([]byte, error)
Constants ¶
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" RestEndpointTurbo = "https://arweave.net" )
const ( IndexBlockHeight = 0 IndexSlotNumber = 1 IndexBlobByNamespace = 2 IndexTendermintBlock = 4 IndexTendermintBlockResults = 5 IndexTendermintBlockByHash = 6 IndexAllBlobsByNamespace = 7 IndexEVMValue = 8 IndexEVMBlock = 9 IndexEVMTransaction = 10 IndexEVMReceipt = 11 IndexEVMLog = 12 )
const ( BundlesPageLimit = 100 BackoffMaxRetries = 10 )
const ( DefaultChainId = ChainIdMainnet DefaultRegistryURL = "https://raw.githubusercontent.com/KYVENetwork/source-registry/main/.github/registry.yml" )
Variables ¶
var ( PrometheusSyncStarted *prometheus.CounterVec PrometheusSyncFinished *prometheus.CounterVec PrometheusBundlesSynced *prometheus.CounterVec PrometheusSyncStepFailedRetry *prometheus.CounterVec PrometheusProcessDuration *prometheus.GaugeVec PrometheusBundleSize *prometheus.GaugeVec PrometheusBundleHeight *prometheus.GaugeVec )
Functions ¶
func BytesToHex ¶
func CalculateSHA256Hash ¶
func CalculateSHA256Hash(obj interface{}) [32]byte
func CreateSha256Checksum ¶
func DecodeProof ¶
DecodeProof decodes the proof of a data item from a byte array encodedProofString is the base64 string of the proof see EncodeProof for more information returns the proof as a struct
func DecompressGzip ¶
func EncodeProof ¶
func EncodeProof(poolId, bundleId int64, chainId string, dataItemKey, dataItemValueKey string, proof []types.MerkleNode) string
EncodeProof encodes the proof of a data item into a byte array encoded in big endian Structure: - 1 bytes: version (uint8) - 2 bytes: poolId (uint16) - 8 bytes: bundleId (uint64) - chainId (string, null terminated) - dataItemKey (string, null terminated) - dataItemValueKey (string, null terminated) - Array of merkle nodes:
- 1 byte: left (true/false)
- 32 bytes: hash (sha256)
returns the proof as Base64
func GetChainRest ¶
func GetFromUrl ¶
GetFromUrl tries to fetch data from url with a custom User-Agent header
func GetFromUrlWithBackoff ¶
GetFromUrlWithBackoff tries to fetch data from url with exponential backoff
func GetUniqueDataitemName ¶
func GetUniqueDataitemName(item *types.TrustlessDataItem) string
func GetVersion ¶
func GetVersion() string
func StartPrometheus ¶
func StartPrometheus(port string)
func TrustlessApiLogger ¶
func WrapIntoJsonRpcResponse ¶
Types ¶
This section is empty.