Skip to content
433 changes: 157 additions & 276 deletions resources/scenarios/ln_framework/ln.py

Large diffs are not rendered by default.

265 changes: 169 additions & 96 deletions resources/scenarios/ln_init.py

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/warnet/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ def check_logging_required(directory: Path):
return True
if default_file.get("metricsExport", False):
return True
if default_file.get("lnd", False).get("metricsExport"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to use {} for the default value
if default_file.get("lnd", {}).get("metricsExport"):

return True

# check to see if individual nodes have logging enabled
network_file_path = directory / NETWORK_FILE
Expand All @@ -216,6 +218,8 @@ def check_logging_required(directory: Path):
return True
if node.get("metricsExport", False):
return True
if node.get("lnd", False).get("metricsExport"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^^ same problem

return True

return False

Expand Down
12 changes: 8 additions & 4 deletions src/warnet/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
from rich.console import Console
from rich.table import Table

from resources.scenarios.ln_framework.ln import Policy
from resources.scenarios.ln_framework.ln import (
CHANNEL_OPEN_START_HEIGHT,
CHANNEL_OPENS_PER_BLOCK,
Policy,
)

from .constants import (
DEFAULT_IMAGE_REPO,
Expand Down Expand Up @@ -339,8 +343,8 @@ def _import_network(graph_file_path, output_path):

sorted_edges = sorted(graph["edges"], key=lambda x: int(x["channel_id"]))

# By default we start including channel open txs in block 300
block = 300
# Start including channel open txs at this block height
block = CHANNEL_OPEN_START_HEIGHT
# Coinbase occupies the 0 position!
index = 1
count = 0
Expand All @@ -356,7 +360,7 @@ def _import_network(graph_file_path, output_path):
}
tanks[source]["lnd"]["channels"].append(channel)
index += 1
if index > 250:
if index > CHANNEL_OPENS_PER_BLOCK:
index = 1
block += 1
count += 1
Expand Down
Loading
Loading