Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ on:
jobs:
deploy-to-dockerhub:
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success'
# if: github.event.workflow_run.conclusion == 'success'
# DISABLE FOR REWRITE
if: false
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/publish-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand All @@ -30,7 +29,9 @@ jobs:
publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
# if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
# DISABLE FOR REWRITE
if: false
needs:
- build
runs-on: ubuntu-latest
Expand Down
56 changes: 13 additions & 43 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,25 @@ on:
- main

jobs:
# ruff:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: chartboost/ruff-action@v1
# with:
# args: 'check .'
ruff-format:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
with:
args: 'format --check .'
build-image:
# needs: [ruff, ruff-format]
needs: [ruff-format]
- uses: hynek/setup-cached-uv@v1
- run: uv venv
- run: uv pip install ruff==0.5.4
- run: source .venv/bin/activate; ruff check .
ruff-format:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and export
uses: docker/build-push-action@v5
with:
file: resources/images/rpc/Dockerfile_prod
context: .
tags: warnet/dev
cache-from: type=gha
cache-to: type=gha,mode=max
outputs: type=docker,dest=/tmp/warnet.tar

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: warnet
path: /tmp/warnet.tar
- uses: actions/checkout@v4
- uses: hynek/setup-cached-uv@v1
- run: uv venv
- run: uv pip install ruff==0.5.4
- run: source .venv/bin/activate; ruff format .
test:
needs: [build-image]
# DISABLE FOR REWRITE
if: false
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -102,10 +79,3 @@ jobs:
run: |
source .venv/bin/activate
./test/${{matrix.test}}
# build-test:
# needs: [build-image]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: ./.github/actions/compose
# - run: ./test/build_branch_test.py compose
154 changes: 12 additions & 142 deletions docs/warcli.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,87 +30,6 @@ options:
Check Warnet requirements are installed


## Bitcoin

### `warcli bitcoin debug-log`
Fetch the Bitcoin Core debug log from \<node> in [network]

options:
| name | type | required | default |
|---------|--------|------------|-----------|
| node | Int | yes | |
| network | String | | "warnet" |

### `warcli bitcoin grep-logs`
Grep combined logs via fluentd using regex \<pattern>

options:
| name | type | required | default |
|---------------------|--------|------------|-----------|
| pattern | String | yes | |
| show_k8s_timestamps | Bool | | False |
| no_sort | Bool | | False |
| network | String | | "warnet" |

### `warcli bitcoin messages`
Fetch messages sent between \<node_a> and \<node_b> in [network]

options:
| name | type | required | default |
|---------|--------|------------|-----------|
| node_a | Int | yes | |
| node_b | Int | yes | |
| network | String | | "warnet" |

### `warcli bitcoin rpc`
Call bitcoin-cli \<method> [params] on \<node> in [network]

options:
| name | type | required | default |
|---------|--------|------------|-----------|
| node | Int | yes | |
| method | String | yes | |
| params | String | | |
| network | String | | "warnet" |

## Cluster

### `warcli cluster connect-logging`
Connect kubectl to cluster logging


### `warcli cluster deploy`
Deploy Warnet using the current kubectl-configured cluster

options:
| name | type | required | default |
|--------|--------|------------|-----------|
| dev | Bool | | False |

### `warcli cluster deploy-logging`
Deploy logging configurations to the cluster using helm


### `warcli cluster port-start`
Port forward (runs as a detached process)


### `warcli cluster port-stop`
Stop the port forwarding process


### `warcli cluster setup-minikube`
Configure a local minikube cluster

options:
| name | type | required | default |
|--------|--------|------------|-----------|
| clean | Bool | | False |

### `warcli cluster teardown`
Stop the warnet server and tear down the cluster


## Graph

### `warcli graph create`
Expand Down Expand Up @@ -165,36 +84,15 @@ options:
| arches | String | | |
| action | String | | "load" |

## Ln

### `warcli ln pubkey`
Get lightning node pub key on \<node> in [network]

options:
| name | type | required | default |
|---------|--------|------------|-----------|
| node | Int | yes | |
| network | String | | "warnet" |

### `warcli ln rpc`
Call lightning cli rpc \<command> on \<node> in [network]

options:
| name | type | required | default |
|---------|--------|------------|-----------|
| node | Int | yes | |
| command | String | yes | |
| network | String | | "warnet" |

## Network

### `warcli network connected`
Indicate whether the all of the edges in the gaph file are connected in [network]
### `warcli network connect`
Connect nodes based on the edges defined in the graph file.

options:
| name | type | required | default |
|---------|--------|------------|-----------|
| network | String | | "warnet" |
| name | type | required | default |
|------------|--------|------------|----------------------------------|
| graph_file | Path | | resources/graphs/default.graphml |

### `warcli network down`
Bring down a running warnet named [network]
Expand All @@ -204,26 +102,14 @@ options:
|---------|--------|------------|-----------|
| network | String | | "warnet" |

### `warcli network export`
Export all [network] data for a "simln" service running in a container
on the network. Optionally add JSON string [activity] to simln config.
Optionally provide a list of tank indexes to [exclude].
Returns True on success.

options:
| name | type | required | default |
|----------|--------|------------|-----------|
| network | String | | "warnet" |
| activity | String | | |
| exclude | String | | "[]" |

### `warcli network info`
Get info about a warnet named [network]
### `warcli network generate-yaml`
Generate a Kubernetes YAML file from a graph file for deploying warnet nodes.

options:
| name | type | required | default |
|---------|--------|------------|-----------|
| network | String | | "warnet" |
| name | type | required | default |
|------------|--------|------------|----------------------------------|
| graph_file | Path | | resources/graphs/default.graphml |
| output | String | | "warnet-deployment.yaml" |

### `warcli network logs`
Get Kubernetes logs from the RPC server
Expand All @@ -240,24 +126,8 @@ options:
| name | type | required | default |
|------------|--------|------------|----------------------------------|
| graph_file | Path | | resources/graphs/default.graphml |
| force | Bool | | False |
| network | String | | "warnet" |

### `warcli network status`
Get status of a warnet named [network]

options:
| name | type | required | default |
|---------|--------|------------|-----------|
| network | String | | "warnet" |

### `warcli network up`
Bring up a previously-stopped warnet named [network]

options:
| name | type | required | default |
|---------|--------|------------|-----------|
| network | String | | "warnet" |
| logging | Bool | | False |

## Scenarios

Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ classifiers = [
dynamic = ["dependencies"]

[project.scripts]
warnet = "warnet.server:run_server"
warcli = "warnet.cli.main:cli"

[project.urls]
Expand Down
24 changes: 12 additions & 12 deletions resources/graphs/default.graphml
Original file line number Diff line number Diff line change
Expand Up @@ -18,60 +18,60 @@
<graph edgedefault="directed">
<node id="0">
<data key="version">27.0</data>
<data key="bitcoin_config">-uacomment=w0</data>
<data key="bitcoin_config">uacomment=w0</data>
<data key="exporter">true</data>
<data key="collect_logs">true</data>
</node>
<node id="1">
<data key="version">27.0</data>
<data key="bitcoin_config">-uacomment=w1</data>
<data key="bitcoin_config">uacomment=w1</data>
<data key="exporter">true</data>
<data key="collect_logs">true</data>
</node>
<node id="2">
<data key="image">bitcoindevproject/bitcoin:26.0</data>
<data key="bitcoin_config">-uacomment=w2 -debug=mempool</data>
<data key="bitcoin_config">uacomment=w2,debug=mempool</data>
<data key="exporter">true</data>
<data key="collect_logs">true</data>
</node>
<node id="3">
<data key="version">27.0</data>
<data key="bitcoin_config">-uacomment=w3</data>
<data key="bitcoin_config">uacomment=w3</data>
<data key="exporter">true</data>
</node>
<node id="4">
<data key="version">27.0</data>
<data key="bitcoin_config">-uacomment=w4</data>
<data key="bitcoin_config">uacomment=w4</data>
<data key="exporter">true</data>
</node>
<node id="5">
<data key="version">27.0</data>
<data key="bitcoin_config">-uacomment=w5</data>
<data key="bitcoin_config">uacomment=w5</data>
<data key="exporter">true</data>
</node>
<node id="6">
<data key="version">27.0</data>
<data key="bitcoin_config">-uacomment=w6</data>
<data key="bitcoin_config">uacomment=w6</data>
</node>
<node id="7">
<data key="version">27.0</data>
<data key="bitcoin_config">-uacomment=w7</data>
<data key="bitcoin_config">uacomment=w7</data>
</node>
<node id="8">
<data key="version">27.0</data>
<data key="bitcoin_config">-uacomment=w8</data>
<data key="bitcoin_config">uacomment=w8</data>
</node>
<node id="9">
<data key="version">27.0</data>
<data key="bitcoin_config">-uacomment=w9</data>
<data key="bitcoin_config">uacomment=w9</data>
</node>
<node id="10">
<data key="version">27.0</data>
<data key="bitcoin_config">-uacomment=w10</data>
<data key="bitcoin_config">uacomment=w10</data>
</node>
<node id="11">
<data key="version">27.0</data>
<data key="bitcoin_config">-uacomment=w11</data>
<data key="bitcoin_config">uacomment=w11</data>
</node>
<!-- connect the nodes in a ring to start -->
<edge id="0" source="0" target="1"></edge>
Expand Down
Binary file added src/.DS_Store
Binary file not shown.
Empty file removed src/warnet/backend/__init__.py
Empty file.
Loading