The command-line interface tool for Warnet.
Once warnet is running it can be interacted with using the cli tool warnet.
Execute warnet --help to see a list of command categories.
Help text is provided, with optional parameters in [square brackets] and required parameters in .
warnet commands are organized in a hierarchy of categories and subcommands.
Authenticate with a Warnet cluster using a kubernetes config file.
Merges the given kubeconfig into the local kubeconfig and switches the
active context. If an entry already exists and differs, a diff is shown
and confirmation is requested before overwriting.
Pass --revert (with no AUTH_CONFIG) to restore the kubeconfig that was
active before the most recent `warnet auth` call.
options:
| name | type | required | default |
|---|---|---|---|
| revert | Bool | False | |
| auth_config | String |
Create a new warnet network
Open the Warnet dashboard in default browser
Deploy a warnet with topology loaded from <directory>
options:
| name | type | required | default |
|---|---|---|---|
| directory | Path | yes | |
| debug | Bool | False | |
| namespace | String | ||
| to_all_users | Bool | False |
Bring down a running warnet carefully.
Interactive: shows a table of all Helm releases that will be destroyed and
asks for confirmation. If Persistent Volume Claims (PVCs) exist, also asks
whether to delete them. Answering 'n' to the PVC prompt preserves
persistent node data across redeployments.
Get one cluster node IP, used for accessing NodePorts
Create a network from an imported lightning network graph JSON
options:
| name | type | required | default |
|---|---|---|---|
| graph_file_path | Path | yes | |
| output_path | Path | yes |
Initialize a warnet project in the current directory
Show the logs of a pod.
If pod_name is omitted, an interactive menu lists all available commander
and tank pods sorted by creation time, most recent first.
options:
| name | type | required | default |
|---|---|---|---|
| pod_name | String | "" | |
| follow | Bool | False | |
| namespace | String | "default" |
Create a new warnet project in the specified directory
options:
| name | type | required | default |
|---|---|---|---|
| directory | Path | yes |
Run a scenario from a file.
Pass `-- --help` to print that scenario's argument help without deploying a pod.
Use --source_dir to bundle a directory of helper modules into the commander pod.
Use --admin to grant cross-namespace node access (requires admin kubeconfig context).
Use --debug to stream logs and delete the pod when the scenario exits.
options:
| name | type | required | default |
|---|---|---|---|
| scenario_file | Path | yes | |
| debug | Bool | False | |
| source_dir | Path | ||
| additional_args | String | ||
| admin | Bool | False | |
| namespace | String |
Setup warnet
Create a snapshot of a tank's Bitcoin data or snapshot all tanks.
If neither tank_name nor --all is given, an interactive menu lets you
select which tank to snapshot.
options:
| name | type | required | default |
|---|---|---|---|
| tank_name | String | ||
| snapshot_all | Bool | False | |
| output | Path | ./warnet-snapshots | |
| filter | String |
Display the unified status of the Warnet network and active scenarios
Stop a running scenario or all scenarios.
If scenario_name is omitted, an interactive menu lists all running
scenarios. Enter the number to stop one, 'a' to stop all, or 'q' to quit.
options:
| name | type | required | default |
|---|---|---|---|
| scenario_name | String |
Display the installed version of warnet
Create kubeconfig files for ServiceAccounts
options:
| name | type | required | default |
|---|---|---|---|
| kubeconfig_dir | String | "kubeconfigs" | |
| token_duration | Int | 172800 |
Initialize a warnet project in the current directory
Destroy a specific namespace or all 'wargames-' prefixed namespaces.
Only namespaces with the 'wargames-' prefix can be destroyed this way.
options:
| name | type | required | default |
|---|---|---|---|
| destroy_all | Bool | False | |
| namespace | String |
List all active namespaces with the 'wargames-' prefix
Fetch the Bitcoin Core debug log from <tank pod name>
options:
| name | type | required | default |
|---|---|---|---|
| tank | String | yes | |
| namespace | String |
Grep combined bitcoind logs using regex <pattern>
options:
| name | type | required | default |
|---|---|---|---|
| pattern | String | yes | |
| show_k8s_timestamps | Bool | False | |
| no_sort | Bool | False |
Fetch messages sent between <tank_a pod name> and <tank_b pod name> in [chain]
tank_b can be a tank pod name, an onion address, or any external peer identifier.
Optionally, include a namespace like so: tank-name.namespace
options:
| name | type | required | default |
|---|---|---|---|
| tank_a | String | yes | |
| tank_b | String | yes | |
| chain | String | "regtest" |
Call bitcoin-cli <method> [params] on <tank pod name>
options:
| name | type | required | default |
|---|---|---|---|
| tank | String | yes | |
| method | String | yes | |
| params | String | ||
| namespace | String |
Build a Bitcoin Core Docker image with specified parameters from specified commit or tag.
�
Usage Examples:
# Build an image for Warnet repository
warnet image build --repo bitcoin/bitcoin --commit-sha d6db87165c6dc2123a759c79ec236ea1ed90c0e3 --tags bitcoindevproject/bitcoin:v29.0-rc2 --action push
# Build from a tag instead of commit hash
warnet image build --repo bitcoin/bitcoin --commit-sha v31.0 --tags bitcoindevproject/bitcoin:v31.0 --action push
# Build an image for local testing on arm64 only
warnet image build --repo bitcoin/bitcoin --commit-sha d6db87165c6dc2123a759c79ec236ea1ed90c0e3 --tags bitcoindevproject/bitcoin:v29.0-rc2 --arches arm64 --action load
options:
| name | type | required | default |
|---|---|---|---|
| repo | String | yes | |
| commit_sha | String | yes | |
| tags | String | yes | |
| build_args | String | ||
| arches | String | ||
| action | String | "load" | |
| no_patches | Bool | False |
Get lightning node host from <ln pod name>
options:
| name | type | required | default |
|---|---|---|---|
| pod | String | yes |
Get lightning node pub key from <ln pod name>
options:
| name | type | required | default |
|---|---|---|---|
| pod | String | yes |
Call lightning cli rpc <command> on <ln pod name>
options:
| name | type | required | default |
|---|---|---|---|
| pod | String | yes | |
| method | String | yes | |
| params | String | ||
| namespace | String |
Destroy a specific namespace or all 'wargames-' prefixed namespaces.
Only namespaces with the 'wargames-' prefix can be destroyed this way.
options:
| name | type | required | default |
|---|---|---|---|
| destroy_all | Bool | False | |
| namespace | String |
List all active namespaces with the 'wargames-' prefix