types

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupConfig added in v1.0.0

type BackupConfig = struct {
	Interval    int64
	KeepRecent  int64
	Src         string
	Dest        string
	Compression string
}

type Bundle

type Bundle = []DataItem

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 CosmosUpgrade struct {
	Name               string `yaml:"name"`
	Height             string `yaml:"height"`
	RecommendedVersion string `yaml:"recommended-version"`
	Engine             string `yaml:"ksync-engine"`
}

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 engine name
	GetName() string

	// OpenDBs opens the relevant blockstore and state DBs
	OpenDBs(homePath string) error

	// CloseDBs closes the relevant blockstore and state DBs
	CloseDBs() error

	// GetHomePath gets the home path of the config and data folder
	GetHomePath() 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

	// GetChainId gets the chain id of the app
	GetChainId() (string, error)

	// GetMetrics gets already encoded metric information
	// for the metrics server
	GetMetrics() ([]byte, error)

	// GetContinuationHeight gets the block height from the app at which
	// KSYNC should proceed block-syncing
	GetContinuationHeight() (int64, error)

	// DoHandshake does a handshake with the app and needs to be called
	// before ApplyBlock
	DoHandshake() error

	// ApplyBlock takes the block in the raw format and applies it against
	// the app
	ApplyBlock(runtime string, value []byte) error

	// ApplyFirstBlockOverP2P applies the first block over the P2P reactor
	// which is necessary, if the genesis file is bigger than 100MB
	ApplyFirstBlockOverP2P(runtime string, value, nextValue []byte) error

	// GetGenesisPath gets the file path to the genesis file
	GetGenesisPath() string

	// GetGenesisHeight gets the initial height defined by the genesis file
	GetGenesisHeight() (int64, 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)

	// 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(value []byte) (string, uint32, error)

	// ApplySnapshotChunk applies a snapshot chunk over ABCI to the app
	ApplySnapshotChunk(chunkIndex uint32, value []byte) (string, error)

	// BootstrapState initializes the tendermint state
	BootstrapState(value []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(homePath string, keepAddrBook bool) error
}

Engine is an interface defining common behaviour for each consensus engine. Currently, both tendermint-v34 and cometbft-v38 are supported

type Entry added in v1.1.0

type Entry struct {
	ConfigVersion *int     `yaml:"config-version"`
	Networks      Networks `yaml:"networks"`
	SourceID      string   `yaml:"source-id"`
	Codebase      Codebase `yaml:"codebase"`
}

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 FinalizedBundleResponse

type FinalizedBundleResponse = struct {
	FinalizedBundle FinalizedBundle `json:"finalized_bundle"`
}

type FinalizedBundlesResponse added in v1.0.0

type FinalizedBundlesResponse = struct {
	FinalizedBundles []FinalizedBundle `json:"finalized_bundles"`
	Pagination       Pagination        `json:"pagination"`
}

type HeightResponse added in v0.5.0

type HeightResponse struct {
	Result struct {
		Response struct {
			LastBlockHeight string `json:"last_block_height"`
		} `json:"response"`
	} `json:"result"`
}

type Integrations added in v1.2.3

type Integrations struct {
	KSYNC *KSYNCIntegration `yaml:"ksync,omitempty"`
}

type KSYNCIntegration added in v1.2.3

type KSYNCIntegration struct {
	BlockSyncPool *int `yaml:"block-sync-pool"`
	StateSyncPool *int `yaml:"state-sync-pool"`
}

type Metrics added in v1.1.0

type Metrics struct {
	LatestBlockHash     string    `json:"latest_block_hash"`
	LatestAppHash       string    `json:"latest_app_hash"`
	LatestBlockHeight   int64     `json:"latest_block_height"`
	LatestBlockTime     time.Time `json:"latest_block_time"`
	EarliestBlockHash   string    `json:"earliest_block_hash"`
	EarliestAppHash     string    `json:"earliest_app_hash"`
	EarliestBlockHeight int64     `json:"earliest_block_height"`
	EarliestBlockTime   time.Time `json:"earliest_block_time"`
	CatchingUp          bool      `json:"catching_up"`
}

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 Pool added in v1.2.3

type Pool struct {
	Id      *int   `yaml:"id"`
	Runtime string `yaml:"runtime"`
}

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"`
			TotalBundles int64  `json:"total_bundles"`
			Config       string `json:"config"`
		} `json:"data"`
	} `json:"pool"`
}

type SourceMetadata added in v1.1.0

type SourceMetadata struct {
	Title string `yaml:"title"`
}

type SourceRegistry added in v1.1.0

type SourceRegistry struct {
	Entries map[string]Entry `yaml:",inline"`
}

type SupportedChain added in v1.0.0

type SupportedChain = struct {
	BlockPoolId    string `json:"block_pool_id"`
	ChainId        string `json:"chain-id"`
	LatestBlockKey string `json:"latest_block_key"`
	LatestStateKey string `json:"latest_state_key"`
	Name           string `json:"name"`
	StatePoolId    string `json:"state_pool_id"`
}

type SupportedChains added in v1.0.0

type SupportedChains = struct {
	Mainnet []SupportedChain `json:"kyve-1"`
	Kaon    []SupportedChain `json:"kaon-1"`
}

type TendermintSSyncConfig added in v1.0.0

type TendermintSSyncConfig = struct {
	Api      string `json:"api"`
	Interval int64  `json:"interval"`
}

Jump to

Keyboard shortcuts

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