@@ -204,7 +204,7 @@ def custom_graph(num_nodes: int, num_connections: int, version: str, datadir: Pa
204
204
nodes = []
205
205
206
206
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 } }
208
208
209
209
# Add round-robin connection
210
210
next_node = (i + 1 ) % num_nodes
@@ -223,44 +223,19 @@ def custom_graph(num_nodes: int, num_connections: int, version: str, datadir: Pa
223
223
224
224
nodes .append (node )
225
225
226
- # Add image tag to the first node
227
- nodes [0 ]["image" ] = {"tag" : "v0.20.0" }
228
-
229
226
network_yaml_data = {"nodes" : nodes }
230
227
231
228
with open (os .path .join (datadir , "network.yaml" ), "w" ) as f :
232
229
yaml .dump (network_yaml_data , f , default_flow_style = False )
233
230
234
231
# 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
+ )
0 commit comments