bitcoin-dev-project / warnet

Monitor and analyze the emergent behaviors of Bitcoin networks
https://warnet.dev
MIT License
63 stars 28 forks source link

Remove ipv4 v3 #303

Open willcl-ark opened 2 months ago

willcl-ark commented 2 months ago

Remove the ipv4 stuff (and fixed subnet from compose).

Closes #253

pinheadmz commented 2 months ago

Re: https://github.com/bitcoin-dev-project/warnet/issues/134

Yes this does create each new network with a unique subnet.

Test:

warcli network start --network=wn1
warcli network start --network=wn2
docker inspect wn1 | grep Subnet
docker inspect wn2 | grep Subnet

However I think we could make one additional change to the compose file to make it even more clear in the docker desktop GUI and who knows wherever else:

diff --git a/src/backends/compose/compose_backend.py b/src/backends/compose/compose_backend.py
index ecc067c..7eab535 100644
--- a/src/backends/compose/compose_backend.py
+++ b/src/backends/compose/compose_backend.py
@@ -289,7 +289,7 @@ class ComposeBackend(BackendInterface):
     def _write_docker_compose(self, warnet):
         compose = {
             "version": "3.8",
-            "name": "warnet",
+            "name": warnet.network_name,
             "networks": {
                 warnet.network_name: {
                     "name": warnet.network_name,
willcl-ark commented 2 months ago

Yes this does create each new network with a unique subnet.

I just added the fixed subnet back in. It would seem to me to make things much easier for you on the Tor side, whilst not having much downside for us?

It's compose-only now, and not part of Warnet. (added to compose_backend here (yes I re-organised those other variables in this touch, and what!)