Skip to content

Commit 39da86d

Browse files
committed
incorporate many of zip's suggestions
1 parent 27ac1f3 commit 39da86d

File tree

7 files changed

+7
-42
lines changed

7 files changed

+7
-42
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ jobs:
4949
- rpc_test.py
5050
- services_test.py
5151
- signet_test.py
52+
- simln_test.py
5253
- scenarios_test.py
5354
- namespace_admin_test.py
54-
- simln_test.py
5555
steps:
5656
- uses: actions/checkout@v4
5757
- uses: azure/[email protected]

resources/networks/hello/node-defaults.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ image:
55

66
lnd:
77
defaultConfig: |
8-
color=#000000
8+
color=#000000

resources/plugins/hello/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from warnet.constants import PLUGIN_ANNEX, AnnexMember, HookValue, WarnetContent
1111
from warnet.process import run_command
1212

13-
# Tt is common for Warnet objects to have a "mission" label to help query for them in the cluster.
13+
# It is common for Warnet objects to have a "mission" label to help query them in the cluster.
1414
MISSION = "hello"
1515
PRIMARY_CONTAINER = MISSION
1616

resources/plugins/simln/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Since SimLN already has access to those LND connection details, it means you can
2525
### Launch activity definitions from the command line
2626
The SimLN plugin takes "activity" definitions like so:
2727

28-
`./simln/plugin.py launch-activiy '[{\"source\": \"tank-0003-ln\", \"destination\": \"tank-0005-ln\", \"interval_secs\": 1, \"amount_msat\": 2000}]'"''`
28+
`./simln/plugin.py launch-activity '[{\"source\": \"tank-0003-ln\", \"destination\": \"tank-0005-ln\", \"interval_secs\": 1, \"amount_msat\": 2000}]'"''`
2929

3030
### Launch activity definitions from within `network.yaml`
3131
When you initialize a new Warnet network, Warnet will create a new `network.yaml` file. If your `network.yaml` file includes lightning nodes, then you can use SimLN to produce activity between those nodes like this:
@@ -106,7 +106,7 @@ The SimLN plugin fetches a SimLN docker image from dockerhub. You can generate y
106106
2. Follow the instructions to build a docker image as detailed int the SimLn repository.
107107
3. Tag the resulting docker image: `docker tag IMAGEID YOURUSERNAME/sim-ln:VERSION`
108108
4. Push the tagged image to you dockerhub account.
109-
5Modify the `values.yaml` file in the plugin's chart to reflect your username and version number:
109+
5. Modify the `values.yaml` file in the plugin's chart to reflect your username and version number:
110110
```YAML
111111
repository: "YOURUSERNAME/sim-ln"
112112
tag: "VERSION"

resources/plugins/simln/charts/simln/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: "simln"
22
image:
3-
repository: "mplsgrant/sim-ln"
4-
tag: "4d33f24"
3+
repository: "bitcoindevproject/simln"
4+
tag: "0.2.3"
55
pullPolicy: IfNotPresent
66

77
workingVolume:

src/warnet/k8s.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,22 +61,6 @@ def get_pod(name: str, namespace: Optional[str] = None) -> V1Pod:
6161
return sclient.read_namespaced_pod(name=name, namespace=namespace)
6262

6363

64-
def get_pods_with_label(label_selector: str, namespace: Optional[str] = None) -> list[V1Pod]:
65-
"""Get a list of pods by label.
66-
Label example: "mission=lightning"
67-
"""
68-
namespace = get_default_namespace_or(namespace)
69-
v1 = get_static_client()
70-
71-
try:
72-
pods = v1.list_namespaced_pod(namespace=namespace, label_selector=label_selector)
73-
v1_pods = [pod for pod in pods.items]
74-
return v1_pods
75-
except client.exceptions.ApiException as e:
76-
print(f"Error fetching pods: {e}")
77-
return []
78-
79-
8064
def get_mission(mission: str) -> list[V1Pod]:
8165
pods = get_pods()
8266
crew: list[V1Pod] = []

src/warnet/process.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import subprocess
2-
from time import sleep
32

43

54
def run_command(command: str) -> str:
@@ -30,21 +29,3 @@ def stream_command(command: str) -> bool:
3029
if return_code != 0:
3130
raise Exception(message)
3231
return True
33-
34-
35-
def wait_for_run(predicate, timeout=5 * 60, interval=5):
36-
print(f"Waiting for predicate with timeout {timeout}s and interval {interval}s")
37-
print(predicate)
38-
while timeout > 0:
39-
try:
40-
if run_command(predicate):
41-
return
42-
except Exception:
43-
pass
44-
sleep(interval)
45-
timeout -= interval
46-
import inspect
47-
48-
raise Exception(
49-
f"Timed out waiting for Truth from predicate: {inspect.getsource(predicate).strip()}"
50-
)

0 commit comments

Comments
 (0)