devcmd

package
v1.99.14 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Overview

Package devcmd provides development-related commands for local testing.

Index

Constants

This section is empty.

Variables

View Source
var ErrPortOverflow = fmt.Errorf("stack: port base + chain offset exceeds TCP port range")

ErrPortOverflow is returned when port arithmetic would produce a number outside the valid TCP port range (e.g. --chains 1000 with a base of 9650 lands at 99,650 > 65535).

Functions

func NewCmd

func NewCmd(_ *application.Lux) *cobra.Command

NewCmd creates the dev command for local development

func PortForApp added in v1.99.12

func PortForApp(portBase, chainIndex int) int

PortForApp returns the port for an app instance. Exported for testing. Callers should prefer PortForAppChecked when the chain index is user-controlled.

func PortForAppChecked added in v1.99.12

func PortForAppChecked(portBase, chainIndex int) (int, error)

PortForAppChecked returns an error if the resulting port falls outside [1, 65535]. This is the sanctioned path for user-supplied --chains values.

Types

type AppEntry added in v1.99.12

type AppEntry struct {
	Name     string `yaml:"name"`
	PortBase int    `yaml:"port_base"`
	Enabled  bool   `yaml:"enabled"`
	Binary   string `yaml:"binary,omitempty"` // image ref or binary name
}

AppEntry describes one application in the stack.

type ChainInfo added in v1.99.12

type ChainInfo struct {
	Index    int    `json:"index"`
	RPCHTTP  string `json:"rpc_http"`
	RPCWS    string `json:"rpc_ws"`
	StakingP int    `json:"staking_port"`
	PID      int    `json:"pid,omitempty"`
}

ChainInfo is written to chains.json for peer discovery.

type ChainsManifest added in v1.99.12

type ChainsManifest struct {
	UpdatedAt string      `json:"updated_at"`
	Chains    []ChainInfo `json:"chains"`
}

ChainsManifest is the top-level chains.json structure.

type StackConfig added in v1.99.12

type StackConfig struct {
	Chains  int        `yaml:"chains"`
	Apps    []AppEntry `yaml:"apps"`
	DataDir string     `yaml:"data_dir"`
	LogDir  string     `yaml:"log_dir"`
}

StackConfig is the on-disk stack.yaml schema.

Jump to

Keyboard shortcuts

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