Skip to content

Conversation

@zeekay
Copy link
Member

@zeekay zeekay commented Dec 3, 2025

Summary

Make CLI commands safely repeatable without side effects:

  • lux network start - checks if running, reports status instead of error

    • Adds --force flag to restart even if already running
    • Adds --luxd-path to use local binary
    • Adds --no-snapshot for fresh start
  • lux network stop - handles gracefully if not running

    • Adds --force/--no-save to skip saving state
    • Returns success with message if already stopped
  • lux network deploy - prevents duplicate deployments with clear messages

    • Adds --force flag to clean and redeploy (local only)
    • Provides actionable options when blockchain exists

All commands now follow idempotent design: running them multiple times
produces the same result as running once, enabling safe automation.

Test plan

  • Run lux network start twice - second run should report status
  • Run lux network start --force - should restart network
  • Run lux network stop when not running - should succeed with message
  • Run lux network deploy mychain twice - should show options
  • Run lux network deploy mychain --force - should clean and redeploy

…agement

Implement declarative network specifications enabling version-controllable,
idempotent network definitions through YAML/JSON configuration files.

New commands:
- `lux network apply -f spec.yaml`: Create/update network from spec
- `lux network spec-export`: Export current state to specification file

Features:
- YAML/JSON schema for defining nodes, subnets, and blockchains
- Idempotent apply with diffing (only changes what's different)
- Dry-run mode to preview changes before applying
- Force mode to recreate existing resources
- Comprehensive validation with clear error messages

Example spec.yaml:
  apiVersion: lux.network/v1
  kind: Network
  network:
    name: mydevnet
    nodes: 5
    subnets:
      - name: mychain
        vm: subnet-evm
        chainId: 12345
        validators: 3
Make CLI commands safely repeatable without side effects:

- network start: checks if running, reports status instead of error
  - Adds --force flag to restart even if already running
  - Adds --luxd-path to use local binary
  - Adds --no-snapshot for fresh start

- network stop: handles gracefully if not running
  - Adds --force/--no-save to skip saving state
  - Returns success with message if already stopped

- network deploy: prevents duplicate deployments with clear messages
  - Adds --force flag to clean and redeploy (local only)
  - Provides actionable options when blockchain exists

All commands now follow idempotent design: running them multiple times
produces the same result as running once, enabling safe automation.
@zeekay zeekay changed the title feat(network): add Infrastructure as Code for declarative network management feat(cli): make network commands idempotent with --force flags Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants