Documentation
¶
Overview ¶
Package devcmd provides development-related commands for local testing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
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
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
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.