Documentation
¶
Index ¶
- Constants
- Variables
- func EnsureOPInitBotsBinary(ctx context.Context) tea.Cmd
- func GenerateMnemonicKeyfile(rawConfig []byte, botName string) (weaveio.KeyFile, error)
- func GetBinaryPath(userHome, version string) string
- func InitializeChallengerWithConfig(config ChallengerConfig, keyFile io.KeyFile, opInitHome, userHome string) error
- func InitializeExecutorWithConfig(config ExecutorConfig, keyFile io.KeyFile, opInitHome, userHome string) error
- func NewEnsureOPInitBotsBinaryLoadingModel(ctx context.Context, ...) tea.Model
- func NewFetchL1StartHeightLoading(ctx context.Context) (tea.Model, error)
- func NewOPInitBotInitSelector(ctx context.Context) (tea.Model, error)
- func NewSetDALayer(ctx context.Context) (tea.Model, error)
- func NewSetupBotCheckbox(ctx context.Context) (tea.Model, error)
- func NewStartingInitBot(ctx context.Context) (tea.Model, error)
- func NextUpdateOpinitBotKey(ctx context.Context) (tea.Model, tea.Cmd)
- func OPInitBotInitSelectChallenger(ctx context.Context) (tea.Model, error)
- func OPInitBotInitSelectExecutor(ctx context.Context) (tea.Model, error)
- func PrepareChallengerBotKey(ctx context.Context) (tea.Model, error)
- func PrepareExecutorBotKey(ctx context.Context) (tea.Model, error)
- func PrepareKey(ctx context.Context, isExecutor bool) (tea.Model, error)
- func ProcessMinitiaConfig(ctx context.Context, ...) (tea.Model, error)
- func WaitSetupOPInitBots(ctx context.Context) tea.Cmd
- func WaitSetupOPInitBotsMissingKey(ctx context.Context) tea.Cmd
- func WaitStartingInitBot(ctx context.Context) tea.Cmd
- type AddMinitiaKeyOption
- type BotConfigChainId
- type BotInfo
- type BotKeyName
- type BotName
- type ChallengerConfig
- type DALayerNetwork
- type DALayerOption
- type DALayerSelector
- type DeleteDBOption
- type DeleteDBSelector
- type EnsureOPInitBotsBinaryLoadingModel
- type ExecutorConfig
- type FetchL1StartHeightLoading
- type Field
- type FieldInputModel
- type FieldType
- type L1PrefillOption
- type L1PrefillSelector
- type L1StartHeightInput
- type NodeConfig
- type NodeSettings
- type OPInitBotInitOption
- type OPInitBotInitSelector
- type OPInitBotsState
- type OPinitBotSuccessful
- type PrefillMinitiaConfig
- type PrefillMinitiaConfigOption
- type ProcessingMinitiaConfig
- type RecoverFromMnemonic
- type RecoverKeySelector
- type ServerConfig
- type SetDALayer
- type SetupBotCheckbox
- type SetupOPInitBots
- type SetupOPInitBotsMissingKey
- type StartingInitBot
- type SubModel
- func (m *SubModel) Init() tea.Cmd
- func (m *SubModel) Update(_ tea.Msg) (tea.Model, tea.Cmd)
- func (m *SubModel) UpdateWithContext(ctx context.Context, parent weavecontext.BaseModelInterface, msg tea.Msg) (context.Context, *SubModel, tea.Cmd)
- func (m *SubModel) View() string
- func (m *SubModel) ViewWithContext(ctx context.Context) string
- type TerminalState
- type UseCurrentConfigSelector
Constants ¶
const ( BridgeExecutorKeyName = "weave_bridge_executor" OutputSubmitterKeyName = "weave_output_submitter" BatchSubmitterKeyName = "weave_batch_submitter" ChallengerKeyName = "weave_challenger" OracleBridgeExecutorKeyName = "weave_oracle_bridge_executor" )
Create constants for the bot key names
const ( AppName string = "opinitd" DefaultInitiaGasDenom string = "uinit" DefaultCelestiaGasDenom string = "utia" DefaultCelestiaGasPrices = "0.04" + DefaultCelestiaGasDenom )
const ( DeleteDBOptionNo = "No" DeleteDBOptionYes = "Yes, reset" )
const ( PrefillMinitiaConfigYes = "Yes, prefill" PrefillMinitiaConfigNo = "No, skip" )
Variables ¶
var BotInfos = []BotInfo{ { BotName: BridgeExecutor, IsSetup: false, KeyName: BridgeExecutorKeyName, Mnemonic: "", IsNotExist: false, }, { BotName: OutputSubmitter, IsSetup: false, KeyName: OutputSubmitterKeyName, Mnemonic: "", IsNotExist: false, }, { BotName: BatchSubmitter, IsSetup: false, KeyName: BatchSubmitterKeyName, Mnemonic: "", IsNotExist: false, }, { BotName: Challenger, IsSetup: false, KeyName: ChallengerKeyName, Mnemonic: "", IsNotExist: false, }, { BotName: OracleBridgeExecutor, IsSetup: false, KeyName: OracleBridgeExecutorKeyName, Mnemonic: "", IsNotExist: false, }, }
BotInfos for all bots with key names filled in
var BotNameToKeyName = map[BotName]BotKeyName{ BridgeExecutor: BridgeExecutorKeyName, OutputSubmitter: OutputSubmitterKeyName, BatchSubmitter: BatchSubmitterKeyName, Challenger: ChallengerKeyName, OracleBridgeExecutor: OracleBridgeExecutorKeyName, }
var BotNames = []BotName{ BridgeExecutor, OutputSubmitter, BatchSubmitter, Challenger, OracleBridgeExecutor, }
BotNames to hold all bot names
Functions ¶
func GenerateMnemonicKeyfile ¶
func GetBinaryPath ¶
func InitializeChallengerWithConfig ¶
func InitializeChallengerWithConfig(config ChallengerConfig, keyFile io.KeyFile, opInitHome, userHome string) error
func InitializeExecutorWithConfig ¶
func InitializeExecutorWithConfig(config ExecutorConfig, keyFile io.KeyFile, opInitHome, userHome string) error
func ProcessMinitiaConfig ¶
Types ¶
type AddMinitiaKeyOption ¶
type AddMinitiaKeyOption string
const ( YesAddMinitiaKeyOption AddMinitiaKeyOption = "Yes, use detected keys" NoAddMinitiaKeyOption AddMinitiaKeyOption = "No, skip" )
type BotConfigChainId ¶
type BotInfo ¶
type BotInfo struct {
BotName BotName
IsSetup bool
KeyName string
Mnemonic string
IsNotExist bool // Indicates if the key doesn't exist in the `initiad keys list` output
IsGenerateKey bool
DALayer string
}
BotInfo struct to hold all relevant bot information
func CheckIfKeysExist ¶
CheckIfKeysExist checks the output of `initiad keys list` and sets IsNotExist for missing keys
func GetBotInfo ¶
type ChallengerConfig ¶
type ChallengerConfig struct {
Version int `json:"version"`
Server ServerConfig `json:"server"`
L1Node NodeConfig `json:"l1_node"`
L2Node NodeConfig `json:"l2_node"`
L1StartHeight int `json:"l1_start_height"`
L2StartHeight int `json:"l2_start_height"`
DisableAutoSetL1Height bool `json:"disable_auto_set_l1_height"`
}
type DALayerNetwork ¶
type DALayerNetwork string
const ( Initia DALayerNetwork = "Initia" Celestia DALayerNetwork = "Celestia" )
type DALayerOption ¶
type DALayerOption string
DALayerOption defines options for Data Availability Layers
const ( InitiaLayerOption DALayerOption = "Initia" CelestiaLayerOption DALayerOption = "Celestia" )
type DALayerSelector ¶
type DALayerSelector struct {
weavecontext.BaseModel
ui.Selector[DALayerOption]
// contains filtered or unexported fields
}
DALayerSelector handles the selection of the DA Layer for a specific bot
func NewDALayerSelector ¶
func NewDALayerSelector(ctx context.Context, idx int) *DALayerSelector
NewDALayerSelector initializes a new DALayerSelector with context
func (*DALayerSelector) GetQuestion ¶
func (m *DALayerSelector) GetQuestion() string
func (*DALayerSelector) Init ¶
func (m *DALayerSelector) Init() tea.Cmd
func (*DALayerSelector) View ¶
func (m *DALayerSelector) View() string
type DeleteDBOption ¶
type DeleteDBOption string
type DeleteDBSelector ¶
type DeleteDBSelector struct {
ui.Selector[DeleteDBOption]
weavecontext.BaseModel
// contains filtered or unexported fields
}
func NewDeleteDBSelector ¶
func NewDeleteDBSelector(ctx context.Context, bot string) *DeleteDBSelector
func (*DeleteDBSelector) GetQuestion ¶
func (m *DeleteDBSelector) GetQuestion() string
func (*DeleteDBSelector) Init ¶
func (m *DeleteDBSelector) Init() tea.Cmd
func (*DeleteDBSelector) View ¶
func (m *DeleteDBSelector) View() string
type EnsureOPInitBotsBinaryLoadingModel ¶
type EnsureOPInitBotsBinaryLoadingModel struct {
weavecontext.BaseModel
ui.Loading
// contains filtered or unexported fields
}
func (*EnsureOPInitBotsBinaryLoadingModel) Init ¶
func (m *EnsureOPInitBotsBinaryLoadingModel) Init() tea.Cmd
func (*EnsureOPInitBotsBinaryLoadingModel) View ¶
func (m *EnsureOPInitBotsBinaryLoadingModel) View() string
type ExecutorConfig ¶
type ExecutorConfig struct {
Version int `json:"version"`
Server ServerConfig `json:"server"`
L1Node NodeSettings `json:"l1_node"`
L2Node NodeSettings `json:"l2_node"`
DANode NodeSettings `json:"da_node"`
BridgeExecutor string `json:"bridge_executor"`
OracleBridgeExecutor string `json:"oracle_bridge_executor"`
DisableOutputSubmitter bool `json:"disable_output_submitter"`
DisableBatchSubmitter bool `json:"disable_batch_submitter"`
MaxChunks int `json:"max_chunks"`
MaxChunkSize int `json:"max_chunk_size"`
MaxSubmissionTime int `json:"max_submission_time"`
DisableAutoSetL1Height bool `json:"disable_auto_set_l1_height"`
L1StartHeight int `json:"l1_start_height"`
L2StartHeight int `json:"l2_start_height"`
BatchStartHeight int `json:"batch_start_height"`
DisableDeleteFutureWithdrawal bool `json:"disable_delete_future_withdrawal"`
}
type FetchL1StartHeightLoading ¶
type FetchL1StartHeightLoading struct {
weavecontext.BaseModel
ui.Loading
}
func (*FetchL1StartHeightLoading) Init ¶
func (m *FetchL1StartHeightLoading) Init() tea.Cmd
func (*FetchL1StartHeightLoading) View ¶
func (m *FetchL1StartHeightLoading) View() string
type FieldInputModel ¶
type FieldInputModel struct {
weavecontext.BaseModel
// contains filtered or unexported fields
}
func NewFieldInputModel ¶
func NewFieldInputModel(ctx context.Context, fields []*Field, newTerminalModel func(context.Context) (tea.Model, error)) *FieldInputModel
NewFieldInputModel initializes the parent model with the submodels
func (*FieldInputModel) Init ¶
func (m *FieldInputModel) Init() tea.Cmd
func (*FieldInputModel) View ¶
func (m *FieldInputModel) View() string
View delegates the view logic to the current active submodel
type L1PrefillOption ¶
type L1PrefillOption string
var ( L1PrefillOptionTestnet L1PrefillOption = "" L1PrefillOptionMainnet L1PrefillOption = "" )
type L1PrefillSelector ¶
type L1PrefillSelector struct {
ui.Selector[L1PrefillOption]
weavecontext.BaseModel
// contains filtered or unexported fields
}
func NewL1PrefillSelector ¶
func NewL1PrefillSelector(ctx context.Context) (*L1PrefillSelector, error)
func (*L1PrefillSelector) GetQuestion ¶
func (m *L1PrefillSelector) GetQuestion() string
func (*L1PrefillSelector) Init ¶
func (m *L1PrefillSelector) Init() tea.Cmd
func (*L1PrefillSelector) View ¶
func (m *L1PrefillSelector) View() string
type L1StartHeightInput ¶
type L1StartHeightInput struct {
ui.TextInput
weavecontext.BaseModel
// contains filtered or unexported fields
}
func NewL1StartHeightInput ¶
func NewL1StartHeightInput(ctx context.Context) *L1StartHeightInput
func (*L1StartHeightInput) GetQuestion ¶
func (m *L1StartHeightInput) GetQuestion() string
func (*L1StartHeightInput) Init ¶
func (m *L1StartHeightInput) Init() tea.Cmd
func (*L1StartHeightInput) View ¶
func (m *L1StartHeightInput) View() string
type NodeConfig ¶
type NodeSettings ¶
type OPInitBotInitOption ¶
type OPInitBotInitOption string
const ( ExecutorOPInitBotInitOption OPInitBotInitOption = "Executor" ChallengerOPInitBotInitOption OPInitBotInitOption = "Challenger" )
type OPInitBotInitSelector ¶
type OPInitBotInitSelector struct {
weavecontext.BaseModel
ui.Selector[OPInitBotInitOption]
// contains filtered or unexported fields
}
func (*OPInitBotInitSelector) GetQuestion ¶
func (m *OPInitBotInitSelector) GetQuestion() string
func (*OPInitBotInitSelector) Init ¶
func (m *OPInitBotInitSelector) Init() tea.Cmd
func (*OPInitBotInitSelector) View ¶
func (m *OPInitBotInitSelector) View() string
type OPInitBotsState ¶
type OPInitBotsState struct {
BotInfos []BotInfo
SetupOpinitResponses map[BotName]string
OPInitBotVersion string
OPInitBotEndpoint string
MinitiaConfig *types.MinitiaConfig
InitExecutorBot bool
InitChallengerBot bool
ReplaceBotConfig bool
Version string
ListenAddress string
L1ChainId string
L1RPCAddress string
L1GasPrice string
AddMinitiaConfig bool
UsePrefilledMinitia bool
L1StartHeight int
// contains filtered or unexported fields
}
OPInitBotsState is the structure holding the bot state and related configurations
func NewOPInitBotsState ¶
func NewOPInitBotsState() OPInitBotsState
NewOPInitBotsState initializes OPInitBotsState with default values
func (OPInitBotsState) Clone ¶
func (state OPInitBotsState) Clone() OPInitBotsState
Clone creates a deep copy of the OPInitBotsState to ensure state independence
type OPinitBotSuccessful ¶
type OPinitBotSuccessful struct {
weavecontext.BaseModel
}
func NewOPinitBotSuccessful ¶
func NewOPinitBotSuccessful(ctx context.Context) *OPinitBotSuccessful
func (*OPinitBotSuccessful) Init ¶
func (m *OPinitBotSuccessful) Init() tea.Cmd
func (*OPinitBotSuccessful) View ¶
func (m *OPinitBotSuccessful) View() string
type PrefillMinitiaConfig ¶
type PrefillMinitiaConfig struct {
ui.Selector[PrefillMinitiaConfigOption]
weavecontext.BaseModel
// contains filtered or unexported fields
}
func NewPrefillMinitiaConfig ¶
func NewPrefillMinitiaConfig(ctx context.Context) (*PrefillMinitiaConfig, error)
func (*PrefillMinitiaConfig) GetQuestion ¶
func (m *PrefillMinitiaConfig) GetQuestion() string
func (*PrefillMinitiaConfig) Init ¶
func (m *PrefillMinitiaConfig) Init() tea.Cmd
func (*PrefillMinitiaConfig) View ¶
func (m *PrefillMinitiaConfig) View() string
type PrefillMinitiaConfigOption ¶
type PrefillMinitiaConfigOption string
type ProcessingMinitiaConfig ¶
type ProcessingMinitiaConfig struct {
weavecontext.BaseModel
ui.Selector[AddMinitiaKeyOption]
// contains filtered or unexported fields
}
func (*ProcessingMinitiaConfig) GetQuestion ¶
func (m *ProcessingMinitiaConfig) GetQuestion() string
func (*ProcessingMinitiaConfig) Init ¶
func (m *ProcessingMinitiaConfig) Init() tea.Cmd
func (*ProcessingMinitiaConfig) View ¶
func (m *ProcessingMinitiaConfig) View() string
type RecoverFromMnemonic ¶
type RecoverFromMnemonic struct {
weavecontext.BaseModel
ui.TextInput
// contains filtered or unexported fields
}
func NewRecoverFromMnemonic ¶
func NewRecoverFromMnemonic(ctx context.Context, idx int) *RecoverFromMnemonic
func (*RecoverFromMnemonic) GetQuestion ¶
func (m *RecoverFromMnemonic) GetQuestion() string
func (*RecoverFromMnemonic) Init ¶
func (m *RecoverFromMnemonic) Init() tea.Cmd
func (*RecoverFromMnemonic) View ¶
func (m *RecoverFromMnemonic) View() string
type RecoverKeySelector ¶
type RecoverKeySelector struct {
weavecontext.BaseModel
ui.Selector[string]
// contains filtered or unexported fields
}
func NewRecoverKeySelector ¶
func NewRecoverKeySelector(ctx context.Context, idx int) *RecoverKeySelector
func (*RecoverKeySelector) GetQuestion ¶
func (m *RecoverKeySelector) GetQuestion() string
func (*RecoverKeySelector) Init ¶
func (m *RecoverKeySelector) Init() tea.Cmd
func (*RecoverKeySelector) View ¶
func (m *RecoverKeySelector) View() string
type ServerConfig ¶
type SetDALayer ¶
type SetDALayer struct {
ui.Selector[DALayerNetwork]
weavecontext.BaseModel
// contains filtered or unexported fields
}
func (*SetDALayer) GetQuestion ¶
func (m *SetDALayer) GetQuestion() string
func (*SetDALayer) Init ¶
func (m *SetDALayer) Init() tea.Cmd
func (*SetDALayer) View ¶
func (m *SetDALayer) View() string
type SetupBotCheckbox ¶
type SetupBotCheckbox struct {
weavecontext.BaseModel
ui.CheckBox[string]
// contains filtered or unexported fields
}
func (*SetupBotCheckbox) GetQuestion ¶
func (m *SetupBotCheckbox) GetQuestion() string
func (*SetupBotCheckbox) Init ¶
func (m *SetupBotCheckbox) Init() tea.Cmd
func (*SetupBotCheckbox) View ¶
func (m *SetupBotCheckbox) View() string
View renders the current prompt and selection options
type SetupOPInitBots ¶
type SetupOPInitBots struct {
weavecontext.BaseModel
ui.Loading
}
SetupOPInitBots handles the loading and setup of OPInit bots
func NewSetupOPInitBots ¶
func NewSetupOPInitBots(ctx context.Context) *SetupOPInitBots
NewSetupOPInitBots initializes a new SetupOPInitBots with context
func (*SetupOPInitBots) Init ¶
func (m *SetupOPInitBots) Init() tea.Cmd
func (*SetupOPInitBots) View ¶
func (m *SetupOPInitBots) View() string
type SetupOPInitBotsMissingKey ¶
type SetupOPInitBotsMissingKey struct {
weavecontext.BaseModel
ui.Loading
}
SetupOPInitBotsMissingKey handles the loading and setup of OPInit bots
func NewSetupOPInitBotsMissingKey ¶
func NewSetupOPInitBotsMissingKey(ctx context.Context) *SetupOPInitBotsMissingKey
NewSetupOPInitBotsMissingKey initializes a new SetupOPInitBots with context
func (*SetupOPInitBotsMissingKey) Init ¶
func (m *SetupOPInitBotsMissingKey) Init() tea.Cmd
func (*SetupOPInitBotsMissingKey) View ¶
func (m *SetupOPInitBotsMissingKey) View() string
type StartingInitBot ¶
type StartingInitBot struct {
weavecontext.BaseModel
ui.Loading
}
func (*StartingInitBot) Init ¶
func (m *StartingInitBot) Init() tea.Cmd
func (*StartingInitBot) View ¶
func (m *StartingInitBot) View() string
type SubModel ¶
type SubModel struct {
weavecontext.BaseModel
ui.TextInput
CannotBack bool
// contains filtered or unexported fields
}
func NewSubModel ¶
func (*SubModel) UpdateWithContext ¶
type TerminalState ¶
type TerminalState struct {
weavecontext.BaseModel
}
func NewTerminalState ¶
func NewTerminalState(ctx context.Context) *TerminalState
func (*TerminalState) Init ¶
func (m *TerminalState) Init() tea.Cmd
func (*TerminalState) View ¶
func (m *TerminalState) View() string
type UseCurrentConfigSelector ¶
type UseCurrentConfigSelector struct {
ui.Selector[string]
weavecontext.BaseModel
// contains filtered or unexported fields
}
func NewUseCurrentConfigSelector ¶
func NewUseCurrentConfigSelector(ctx context.Context, bot string) (*UseCurrentConfigSelector, error)
func (*UseCurrentConfigSelector) GetQuestion ¶
func (m *UseCurrentConfigSelector) GetQuestion() string
func (*UseCurrentConfigSelector) Init ¶
func (m *UseCurrentConfigSelector) Init() tea.Cmd
func (*UseCurrentConfigSelector) View ¶
func (m *UseCurrentConfigSelector) View() string