Replies: 4 comments 8 replies
-
Agree with this direction longterm. I think we are outgrowing the initial idea of "everyone is going to use the bitcoin test framework" and have learned instead that usually there is a lot of setup required to get something working, e.g. opening lightning channels, mining a chain so wallets have UTXOs, etc. The library approach makes a lot of sense to me in that you can pull stuff in as needed and then flexibility to write code for what you want to happen.
This is the north star, imo. We can also dogfood any of the code we are exposing in a "library" by building the CLI directly on top of it, i.e. the CLI is a client of the library code we are writing. |
Beta Was this translation helpful? Give feedback.
-
I mean, also concept ACK on this. I'd just not that this was the intention of the IMO I think one mistake we have arguably made is going too genric over everything. Perhaps we should define warnet as:
Perhaps the easiest way to do this using some "kind of" DSL as was previously discussed, would be with a config yaml/toml which warnet parses? # Network Configuration Schema
[network]
# Number of total nodes in the network
n = 10
# Number of nodes with associated LND/Core Lightning nodes
m = 5
# Number of nodes with associated Circuitbreaker nodes
p = 3
# Specify the topology
topology = "erdos-renyi"
# Docker images for each node type
[docker_images]
# Docker image for regular nodes
regular = "node:latest"
# Docker image for nodes with LND/Core Lightning
lightning = "lnd:latest"
# Docker image for nodes with Circuitbreaker
circuitbreaker = "circuitbreaker:latest"
# Bitcoind node options
[bitcoind_options]
debug = 1
blocksonly = 1
At this point, it may not even be particularly worth bothering to parse this all into graphml. Just use |
Beta Was this translation helpful? Give feedback.
-
Quick example i started writing that works but doesn't do anything yet. This file doesn't even have to be in the warnet directory as long as warnet is installed: from pathlib import Path
from warnet.warnet import Warnet
from warnet.tank import Tank
from warnet.lnnode import LNNode
config_dir = Path("/tmp/wn_test")
network_name = "wn_test"
wn = Warnet(config_dir, "compose", network_name)
tank0 = Tank(0, wn)
tank0.lnnode = LNNode(wn, tank0, wn.container_interface, {"impl": "lnd", "ln_image": "lightninglabs/lnd:v0.17.0-beta", "cb_image": None, "ln_config": None})
tank1 = Tank(1, wn)
tank1.lnnode = LNNode(wn, tank1, wn.container_interface, {"impl": "lnd", "ln_image": "lightninglabs/lnd:v0.17.0-beta", "cb_image": None, "ln_config": None})
wn.generate_deployment()
wn.warnet_build()
wn.warnet_up() |
Beta Was this translation helpful? Give feedback.
-
I like the idea of using a library approach rather than a graphml + scenario file approach. The support for moving away from using the test framework surprises me a little. I imagined us making certain incisions in the test framework code to transplant TestNode out of its local popen process and into a pod. Some functions need to be modified such as Then again, if I came to this project and it did not support the test framework, but it did have the ability to act as a warnet in its own way, then I actually may not be surprised that it didn't support the test framework. And perhaps the costs of supporting a framework that is out of our control may not be in our interest. |
Beta Was this translation helpful? Give feedback.
-
Most experiments with Warnet require at least one graphml file and one scenario. Graphml is a fairly annoying format and is likely to be overkill:
edge
's and the difference is subtleSO WHAT IF...
ln_init.py
and eventuallyonion_init.py
so they can be imported into new scenarios as library functionsALSO...
There are tons of functions in the bitcoin test framework we cant support without stubbing (i.e.
assert_debug_log()
) and we do not need proxies-on-proxies for, like, code coverage. That's why I think we should plan long term on dropping the bitcoin test framework and writing our own.HELL...
These single-point-of-entry scenario files could even launch kubernetes locally or ensure its already running or whatever. Then we can also remove all the justfile commands and integrate everything into one place.
Imagine:
"How do I use Warnet?"
"You write one file, and execute one command"
Beta Was this translation helpful? Give feedback.
All reactions