cmdmodel

package
v29.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunNode

func RunNode(nodeIdx int, start bool, m MultiNode) tea.Cmd

RunNode runs or stops the node based on its status.

func SwitchFocus

func SwitchFocus(nodeIdx int) tea.Cmd

SwitchFocus changes the focus to a specific node.

func ToggleNode

func ToggleNode(nodeIdx int) tea.Cmd

ToggleNode toggles the state of a node.

func UpdateDeemon

func UpdateDeemon() tea.Cmd

UpdateDeemon returns a command that sends an UpdateLogsMsg. This command is intended to continuously refresh the logs displayed in the user interface.

Types

type ChainDebug

type ChainDebug struct {
	// contains filtered or unexported fields
}

ChainDebug defines a UI model for the chain debug command.

func NewChainDebug

func NewChainDebug(mCtx Context, bus events.Provider, cmd tea.Cmd) ChainDebug

NewChainDebug returns a new UI model for the chain debug command.

func (ChainDebug) Init

func (m ChainDebug) Init() tea.Cmd

Init is the first function that will be called. It returns a batch command that listen events and also runs the debug server.

func (ChainDebug) Update

func (m ChainDebug) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update is called when a message is received. It handles messages and executes the logic that updates the model.

func (ChainDebug) View

func (m ChainDebug) View() string

View renders the UI after every update.

type ChainServe

type ChainServe struct {
	// contains filtered or unexported fields
}

ChainServe defines a UI model for the chain serve command.

func NewChainServe

func NewChainServe(mCtx Context, bus events.Provider, cmd tea.Cmd) ChainServe

NewChainServe returns a new UI model for the chain serve command.

func (ChainServe) Init

func (m ChainServe) Init() tea.Cmd

Init is the first function that will be called. It returns a batch command that listen events and also runs the blockchain app.

func (ChainServe) Update

func (m ChainServe) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update is called when a message is received. It handles messages and executes the logic that updates the model.

func (ChainServe) View

func (m ChainServe) View() string

View renders the UI after every update.

type Context

type Context interface {
	// Context returns the current context.
	Context() context.Context

	// SetContext updates the context with a new one.
	SetContext(context.Context)
}

type MultiNode

type MultiNode struct {
	// contains filtered or unexported fields
}

MultiNode represents a set of nodes, managing state and information related to them.

func NewModel

func NewModel(ctx context.Context, chainname string, args chain.MultiNodeArgs) (MultiNode, error)

NewModel initializes the model.

func (MultiNode) Init

func (m MultiNode) Init() tea.Cmd

Init implements the Init method of the tea.Model interface.

func (*MultiNode) StartAllNodes

func (m *MultiNode) StartAllNodes() tea.Cmd

StartAllNodes starts all nodes that are currently stopped.

func (*MultiNode) StopAllNodes

func (m *MultiNode) StopAllNodes()

StopAllNodes stops all nodes.

func (MultiNode) Update

func (m MultiNode) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages and updates the model.

func (MultiNode) View

func (m MultiNode) View() string

View renders the interface.

type NodeStatus

type NodeStatus int

NodeStatus is an integer data type that represents the status of a node.

const (
	// Stopped indicates that the node is currently stopped.
	Stopped NodeStatus = iota

	// Running indicates that the node is currently running.
	Running
)

type SwitchFocusMsg

type SwitchFocusMsg struct {
	// contains filtered or unexported fields
}

SwitchFocusMsg indicates a switch in focus to another node.

type ToggleNodeMsg

type ToggleNodeMsg struct {
	// contains filtered or unexported fields
}

ToggleNodeMsg is a structure used to pass messages to enable or disable a node based on the node index.

type UpdateLogsMsg

type UpdateLogsMsg struct{}

UpdateLogsMsg is for continuously updating the chain logs in the View.

type UpdateStatusMsg

type UpdateStatusMsg struct {
	// contains filtered or unexported fields
}

UpdateStatusMsg defines a message that updates the status of a node by index.

Jump to

Keyboard shortcuts

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