tiasync

package
v0.0.0-...-4ef5390 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagAddrBookPath    = "tiasync.addr-book-path"
	FlagChainID         = "tiasync.chain-id"
	FlagEnable          = "tiasync.enable"
	FlagLocalhostPort   = "tiasync.localhost-port"
	FlagNodeKeyPath     = "tiasync.node-key-path"
	FlagTiaPollInterval = "tiasync.tia-poll-interval"

	DefaultConfigDir    = "config"
	DefaultNodeKeyName  = "tiasync_node_key.json"
	DefaultAddrBookName = "tiasync_addrbook.json"

	DefaultConfigTemplate = `` /* 630-byte string literal not displayed */

)

Variables

View Source
var DefaultTiasyncConfig = TiasyncConfig{
	AddrBookPath:    defaultAddrBookPath,
	ChainID:         "",
	Enable:          false,
	LocalhostPort:   "26777",
	NodeKeyPath:     defaultNodeKeyPath,
	TiaPollInterval: time.Second * 5,
}

Functions

func LoadStateFromDBOrGenesisDocProvider

func LoadStateFromDBOrGenesisDocProvider(
	stateDB dbm.DB,
	genesisDocProvider GenesisDocProvider,
) (sm.State, *types.GenesisDoc, error)

LoadStateFromDBOrGenesisDocProvider attempts to load the state from the database, or creates one using the given genesisDocProvider. On success this also returns the genesis doc loaded through the given provider.

func TiasyncPrerunRoutine

func TiasyncPrerunRoutine(appName string, cmd *cobra.Command, srvCtx *server.Context) error

func TiasyncRoutine

func TiasyncRoutine(svrCtx *server.Context, clientCtx client.Context, celestiaNamespace string)

Types

type GenesisDocProvider

type GenesisDocProvider func() (*types.GenesisDoc, error)

GenesisDocProvider returns a GenesisDoc. It allows the GenesisDoc to be pulled from sources other than the filesystem, for instance from a distributed key-value store cluster.

type Tiasync

type Tiasync struct {
	Logger log.Logger
	// contains filtered or unexported fields
}

func NewTiasync

func NewTiasync(
	cmtConfig *cfg.Config,
	tiasyncCfg *TiasyncConfig,
	celestiaCfg *relayer.CelestiaConfig,
	logger log.Logger,
	clientCtx client.Context,
	celestiaNamespace string,
) (*Tiasync, error)

func (*Tiasync) Start

func (t *Tiasync) Start()

type TiasyncConfig

type TiasyncConfig struct {
	// Path to tiasync's address book
	AddrBookPath string `mapstructure:"addr-book-path"`

	// Optionally provide the chain-id to filter out blocks from our namespace with a different chain-id
	ChainID string `mapstructure:"chain-id"`

	// Switch to enable/disable tiasync
	Enable bool `mapstructure:"enable"`

	// Port that cometbft will listen on
	LocalhostPort string `mapstructure:"localhost-port"`

	// Path to the JSON file containing the private key to use for node authentication in the p2p protocol
	// Tiasync must have a different key than the full node's cometbft instance
	NodeKeyPath string `mapstructure:"node-key-path"`

	// Cadence to query celestia for new blocks
	TiaPollInterval time.Duration `mapstructure:"tia-poll-interval"`
}

TiasyncConfig defines the configuration for the in-process tiasync.

func TiasyncConfigFromAppOpts

func TiasyncConfigFromAppOpts(appOpts servertypes.AppOptions) TiasyncConfig

func (TiasyncConfig) AddrBookFile

func (t TiasyncConfig) AddrBookFile(cometCfg cfg.BaseConfig) string

func (TiasyncConfig) NodeKeyFile

func (t TiasyncConfig) NodeKeyFile(cometCfg cfg.BaseConfig) string

type TiasyncInternalConfig

type TiasyncInternalConfig struct {
	P2P cfg.P2PConfig
}
var TiasyncInternalCfg TiasyncInternalConfig

type TiasyncPrerun

type TiasyncPrerun struct {
	Logger log.Logger
	// contains filtered or unexported fields
}

func NewTiasyncPrerun

func NewTiasyncPrerun(
	cmtConfig *cfg.Config,
	tiasyncCfg *TiasyncConfig,
	logger log.Logger,
	blockStoreDB dbm.DB,
	state sm.State,
	genDoc *types.GenesisDoc,
	height int64,
) (*TiasyncPrerun, error)

func (*TiasyncPrerun) Start

func (t *TiasyncPrerun) Start()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳