Skip to content

Commit ca5b046

Browse files
committed
remove hardcoded test from quickstart
1 parent a3b5ae9 commit ca5b046

File tree

2 files changed

+11
-126
lines changed

2 files changed

+11
-126
lines changed

src/warnet/main.py

Lines changed: 11 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def custom_graph(num_nodes: int, num_connections: int, version: str, datadir: Pa
204204
nodes = []
205205

206206
for i in range(num_nodes):
207-
node = {"name": f"tank-{i:04d}", "connect": []}
207+
node = {"name": f"tank-{i:04d}", "connect": [], "image": {"tag": version}}
208208

209209
# Add round-robin connection
210210
next_node = (i + 1) % num_nodes
@@ -223,44 +223,19 @@ def custom_graph(num_nodes: int, num_connections: int, version: str, datadir: Pa
223223

224224
nodes.append(node)
225225

226-
# Add image tag to the first node
227-
nodes[0]["image"] = {"tag": "v0.20.0"}
228-
229226
network_yaml_data = {"nodes": nodes}
230227

231228
with open(os.path.join(datadir, "network.yaml"), "w") as f:
232229
yaml.dump(network_yaml_data, f, default_flow_style=False)
233230

234231
# Generate defaults.yaml
235-
defaults_yaml_content = """
236-
chain: regtest
237-
238-
collectLogs: true
239-
metricsExport: true
240-
241-
resources: {}
242-
# We usually recommend not to specify default resources and to leave this as a conscious
243-
# choice for the user. This also increases chances charts run on environments with little
244-
# resources, such as Minikube. If you do want to specify resources, uncomment the following
245-
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
246-
# limits:
247-
# cpu: 100m
248-
# memory: 128Mi
249-
# requests:
250-
# cpu: 100m
251-
# memory: 128Mi
252-
253-
image:
254-
repository: bitcoindevproject/bitcoin
255-
pullPolicy: IfNotPresent
256-
# Overrides the image tag whose default is the chart appVersion.
257-
tag: "27.0"
258-
259-
config: |
260-
dns=1
261-
"""
262-
263-
with open(os.path.join(datadir, "defaults.yaml"), "w") as f:
264-
f.write(defaults_yaml_content.strip())
265-
266-
click.echo(f"Project '{datadir}' has been created with 'network.yaml' and 'defaults.yaml'.")
232+
default_yaml_path = files("resources.networks").joinpath("6_node_bitcoin/node-defaults.yaml")
233+
with open(str(default_yaml_path)) as f:
234+
defaults_yaml_content = f.read()
235+
236+
with open(os.path.join(datadir, "node-defaults.yaml"), "w") as f:
237+
f.write(defaults_yaml_content)
238+
239+
click.echo(
240+
f"Project '{datadir}' has been created with 'network.yaml' and 'node-defaults.yaml'."
241+
)

src/warnet/project.py

Lines changed: 0 additions & 90 deletions
This file was deleted.

0 commit comments

Comments
 (0)