@@ -178,17 +178,30 @@ class DockerService implements DockerLibrary {
178178 const nodes = new Set ( ) ;
179179 const activities = new Set ( ) ;
180180 network . simulationActivities . map ( activity => {
181+ const { source, destination } = activity ;
182+ // split the macaroon and cert path at "volumes/" to get the relative path
183+ // to the docker volume. This is necessary because the docker volumes are
184+ // mounted as a different path in the container
185+ const sourceMacaroon = source . macaroon . split ( 'volumes/' ) . pop ( ) ;
186+ const sourceCert = source ?. tlsCert
187+ ? source . tlsCert ?. split ( 'volumes/' ) . pop ( )
188+ : source ?. clientKey ?. split ( 'volumes/' ) . pop ( ) ;
189+ const destMacaroon = destination . macaroon . split ( 'volumes/' ) . pop ( ) ;
190+ const destCert = destination . tlsCert
191+ ? destination . tlsCert ?. split ( 'volumes/' ) . pop ( )
192+ : destination ?. clientKey ?. split ( 'volumes/' ) . pop ( ) ;
193+ info ( { sourceMacaroon, sourceCert, destMacaroon, destCert } ) ;
181194 nodes . add ( {
182195 id : activity . source . id ,
183196 address : activity . source . address ,
184- macaroon : activity . source . macaroon ,
185- cert : activity . source . clientCert ?? activity . source . clientKey ,
197+ macaroon : `/home/simln/. ${ sourceMacaroon } ` ,
198+ cert : `/home/simln/. ${ sourceCert } ` ,
186199 } ) ;
187200 nodes . add ( {
188201 id : activity . destination . id ,
189202 address : activity . destination . address ,
190- macaroon : activity . destination . macaroon ,
191- cert : activity . destination . clientCert ?? activity . destination . clientKey ,
203+ macaroon : `/home/simln/. ${ destMacaroon } ` ,
204+ cert : `/home/simln/. ${ destCert } ` ,
192205 } ) ;
193206
194207 activities . add ( {
@@ -200,7 +213,7 @@ class DockerService implements DockerLibrary {
200213 } ) ;
201214 return {
202215 nodes : Array . from ( nodes ) ,
203- activities : Array . from ( activities ) as SimulationActivity [ ] ,
216+ activity : Array . from ( activities ) as SimulationActivity [ ] ,
204217 } ;
205218 }
206219
@@ -210,8 +223,9 @@ class DockerService implements DockerLibrary {
210223 */
211224 async startSimulationActivity ( network : Network ) {
212225 const simJson = await this . constructSimJson ( network ) ;
213- console . log ( 'simJson' , simJson ) ;
214- info ( `simJson: ${ simJson } ` ) ;
226+ info (
227+ `simJson: ${ simJson } simJson.nodes: ${ simJson . nodes } simJson.activities: ${ simJson . activity } ` ,
228+ ) ;
215229 await this . ensureDirs ( network , [
216230 ...network . nodes . bitcoin ,
217231 ...network . nodes . lightning ,
@@ -234,8 +248,12 @@ class DockerService implements DockerLibrary {
234248 info ( `Simulation activity stopped:\n ${ result . out || result . err } ` ) ;
235249
236250 // remove container to avoid conflicts when starting the network again
237- await this . execute ( compose . rm as any , this . getArgs ( network ) , 'simln' ) ;
238- info ( `Removed simln container` ) ;
251+ const removedContainer = await this . execute (
252+ compose . rm as any ,
253+ this . getArgs ( network ) ,
254+ 'simln' ,
255+ ) ;
256+ info ( `Removed simln container ${ removedContainer . out || removedContainer . err } ` ) ;
239257 }
240258
241259 /**
0 commit comments