Documentation
¶
Index ¶
- type AbciInfoResponse
- type BlockCollector
- type BlockItem
- type Bundle
- type Codebase
- type CosmosSettings
- type CosmosUpgrade
- type DataItem
- type Engine
- type Entry
- type FinalizedBundle
- type FinalizedBundlesResponse
- type Integrations
- type KSYNCIntegration
- type NetworkProperties
- type Networks
- type Pagination
- type Pool
- type PoolResponse
- type Snapshot
- type SnapshotBundle
- type SnapshotCollector
- type SnapshotDataItem
- type SourceMetadata
- type SourceRegistry
- type StatusResponse
- type SupportedChain
- type TendermintSSyncConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbciInfoResponse ¶ added in v1.9.0
type AbciInfoResponse struct { Result struct { Response struct { LastBlockHeight string `json:"last_block_height"` } `json:"response"` } `json:"result"` }
type BlockCollector ¶ added in v1.9.0
type BlockCollector interface { // GetEarliestAvailableHeight gets the earliest available block in a block pool GetEarliestAvailableHeight() int64 // GetLatestAvailableHeight gets the latest available block in a block pool GetLatestAvailableHeight() int64 // GetBlock gets the block for the given height GetBlock(height int64) ([]byte, error) // StreamBlocks takes a continuationHeight and a targetHeight and streams // all blocks in order into a given block channel. This method exits once // the target height is reached or runs indefinitely depending on the // exitOnTargetHeight value StreamBlocks(blockCh chan<- *BlockItem, errorCh chan<- error, continuationHeight, targetHeight int64) }
BlockCollector is an interface defining common behaviour for each type of collecting blocks, since blocks can be either obtained with requesting the rpc endpoint of the source chain or with downloading archived bundles from KYVE
type BlockItem ¶ added in v1.9.0
type BlockItem struct { Height int64 Block json.RawMessage }
type Codebase ¶ added in v1.6.0
type Codebase struct { GitUrl string `yaml:"git-url"` Settings CosmosSettings `yaml:"settings"` }
type CosmosSettings ¶ added in v1.6.0
type CosmosSettings struct {
Upgrades []CosmosUpgrade `yaml:"upgrades"`
}
type CosmosUpgrade ¶ added in v1.6.0
type DataItem ¶
type DataItem struct { Key string `json:"key"` Value json.RawMessage `json:"value"` }
type Engine ¶ added in v1.1.0
type Engine interface { // GetName gets the name of the engine GetName() string // LoadConfig loads and sets the config LoadConfig() error // OpenDBs opens the relevant blockstore and state DBs OpenDBs() error // CloseDBs closes the relevant blockstore and state DBs CloseDBs() error // GetRpcListenAddress gets the address the rpc endpoint is hosted GetRpcListenAddress() string // GetProxyAppAddress gets the proxy app address of the TSP connection GetProxyAppAddress() string // StartProxyApp starts the proxy app connections to the app StartProxyApp() error // StopProxyApp stops the proxy app connections to the app StopProxyApp() error // DoHandshake does a handshake with the app and needs to be called // before ApplyBlock DoHandshake() error // ApplyBlock takes a block at height n and n+1 and applies it against // the cosmos app ApplyBlock(rawBlock, nextRawBlock []byte) error // ApplyFirstBlockOverP2P applies the first block over the P2P reactor // which is necessary, if the genesis file is bigger than 100MB ApplyFirstBlockOverP2P(rawBlock, nextRawBlock []byte) error // GetHeight gets the latest height stored in the blockstore.db GetHeight() int64 // GetBaseHeight gets the earliest height stored in the blockstore.db GetBaseHeight() int64 // GetAppHeight gets over ABCI the latest block height tracked by the app GetAppHeight() (int64, error) // GetSnapshots gets the available snapshots over ABCI from the app GetSnapshots() ([]byte, error) // IsSnapshotAvailable gets available snapshots over ABCI from the app // and checks if the requested snapshot is available IsSnapshotAvailable(height int64) (bool, error) // GetSnapshotChunk gets the requested snapshot chunk over ABCI from the // app GetSnapshotChunk(height, format, chunk int64) ([]byte, error) // GetBlock loads the requested block from the blockstore.db GetBlock(height int64) ([]byte, error) // StartRPCServer spins up a basic rpc server of the engine which serves // /status, /block and /block_results StartRPCServer(port int64) // GetState rebuilds the requested state from the blockstore and state.db GetState(height int64) ([]byte, error) // GetSeenCommit loads the seen commit from the blockstore.db GetSeenCommit(height int64) ([]byte, error) // OfferSnapshot offers a snapshot over ABCI to the app OfferSnapshot(rawSnapshot, rawState []byte) error // ApplySnapshotChunk applies a snapshot chunk over ABCI to the app ApplySnapshotChunk(chunkIndex int64, chunk []byte) error // BootstrapState initializes the tendermint state BootstrapState(rawState, rawSeenCommit, rawBlock []byte) error // PruneBlocks prunes blocks from the block store and state store // from the earliest found base height to the specified height PruneBlocks(toHeight int64) error // ResetAll removes all the data and WAL, reset this node's validator // to genesis state ResetAll(keepAddrBook bool) error }
Engine is an interface defining common behaviour for each consensus engine. Currently, both tendermint-v34 and cometbft-v38 are supported
type FinalizedBundle ¶
type FinalizedBundle struct { Id string `json:"id,omitempty"` StorageId string `json:"storage_id,omitempty"` StorageProviderId string `json:"storage_provider_id,omitempty"` CompressionId string `json:"compression_id,omitempty"` FromKey string `json:"from_key,omitempty"` ToKey string `json:"to_key,omitempty"` DataHash string `json:"data_hash,omitempty"` }
type FinalizedBundlesResponse ¶ added in v1.0.0
type FinalizedBundlesResponse = struct { FinalizedBundles []FinalizedBundle `json:"finalized_bundles"` Pagination Pagination `json:"pagination"` }
type Integrations ¶ added in v1.2.3
type Integrations struct {
KSYNC *KSYNCIntegration `yaml:"ksync,omitempty"`
}
type KSYNCIntegration ¶ added in v1.2.3
type NetworkProperties ¶ added in v1.2.3
type NetworkProperties struct { LatestBlockKey *string LatestStateKey *string BlockStartKey *string StateStartKey *string Integrations *Integrations `yaml:"integrations,omitempty"` Pools *[]Pool `yaml:"pools,omitempty"` SourceMetadata *SourceMetadata `yaml:"properties,omitempty"` }
type Networks ¶ added in v1.2.3
type Networks struct { Kaon *NetworkProperties `yaml:"kaon-1,omitempty"` Kyve *NetworkProperties `yaml:"kyve-1,omitempty"` }
type Pagination ¶
type Pagination struct {
NextKey []byte `json:"next_key"`
}
type PoolResponse ¶
type PoolResponse = struct { Pool struct { Id int64 `json:"id"` Data struct { Runtime string `json:"runtime"` StartKey string `json:"start_key"` CurrentKey string `json:"current_key"` CurrentSummary string `json:"current_summary"` TotalBundles int64 `json:"total_bundles"` Config string `json:"config"` } `json:"data"` } `json:"pool"` }
type SnapshotBundle ¶ added in v1.9.0
type SnapshotBundle = []SnapshotDataItem
type SnapshotCollector ¶ added in v1.9.0
type SnapshotCollector interface { // GetEarliestAvailableHeight gets the earliest available snapshot height in // a snapshot pool GetEarliestAvailableHeight() int64 // GetLatestAvailableHeight gets the latest available snapshot height in // a snapshot pool GetLatestAvailableHeight() int64 // GetInterval gets the snapshot interval GetInterval() int64 // GetCurrentHeight gets the current height of the latest snapshot. This snapshot // is not guaranteed to be fully available and chunks can still be missing GetCurrentHeight() (int64, error) // GetSnapshotHeight gets the exact height of the nearest snapshot before the target // height GetSnapshotHeight(targetHeight int64, isServeSnapshot bool) int64 // GetSnapshotFromBundleId gets the snapshot from the given bundle GetSnapshotFromBundleId(bundleId int64) (*SnapshotDataItem, error) // DownloadChunkFromBundleId downloads the snapshot chunk from the given bundle DownloadChunkFromBundleId(bundleId int64) ([]byte, error) // FindSnapshotBundleIdForHeight searches and returns the bundle id which contains the first // snapshot chunk for the given height. // Since we do not know how many chunks a bundle has but expect that the snapshots are ordered by height // we can apply a binary search to minimize the amount of requests we have to make. This method fails // if there is no bundle which contains the snapshot at the target height FindSnapshotBundleIdForHeight(height int64) (int64, error) }
SnapshotCollector is an interface defining behaviour for collecting snapshots
type SnapshotDataItem ¶ added in v1.9.0
type SnapshotDataItem struct { Key string `json:"key"` Value struct { Snapshot json.RawMessage `json:"snapshot"` Block json.RawMessage `json:"block"` SeenCommit json.RawMessage `json:"seenCommit"` State json.RawMessage `json:"state"` ChunkIndex uint32 `json:"chunkIndex"` Chunk []byte `json:"chunk"` } `json:"value"` }
type SourceMetadata ¶ added in v1.1.0
type SourceMetadata struct {
Title string `yaml:"title"`
}
type SourceRegistry ¶ added in v1.1.0
type StatusResponse ¶ added in v1.7.0
type SupportedChain ¶ added in v1.0.0
type TendermintSSyncConfig ¶ added in v1.0.0
Click to show internal directories.
Click to hide internal directories.