@@ -101,10 +101,10 @@ object InteractiveShell {
101
101
this .nodeLegalName = configuration.myLegalName
102
102
this .database = database
103
103
val dir = configuration.baseDirectory
104
- val runSshDeamon = configuration.sshd != null
104
+ val runSshDaemon = configuration.sshd != null
105
105
106
106
val config = Properties ()
107
- if (runSshDeamon ) {
107
+ if (runSshDaemon ) {
108
108
val sshKeysDir = dir / " sshkey"
109
109
sshKeysDir.toFile().mkdirs()
110
110
@@ -120,7 +120,7 @@ object InteractiveShell {
120
120
ExternalResolver .INSTANCE .addCommand(" start" , " An alias for 'flow start'" , StartShellCommand ::class .java)
121
121
shell = ShellLifecycle (dir).start(config)
122
122
123
- if (runSshDeamon ) {
123
+ if (runSshDaemon ) {
124
124
Node .printBasicNodeInfo(" SSH server listening on port" , configuration.sshd!! .port.toString())
125
125
}
126
126
}
@@ -182,7 +182,7 @@ object InteractiveShell {
182
182
context.refresh()
183
183
this .config = config
184
184
start(context)
185
- return context.getPlugin(ShellFactory ::class .java).create(null , CordaSSHAuthInfo (false , RPCOpsWithContext (rpcOps, net.corda.core.context.InvocationContext .shell(), RpcPermissions .ALL ), StdoutANSIProgressRenderer ))
185
+ return context.getPlugin(ShellFactory ::class .java).create(null , CordaSSHAuthInfo (false , makeRPCOpsWithContext (rpcOps, net.corda.core.context.InvocationContext .shell(), RpcPermissions .ALL ), StdoutANSIProgressRenderer ))
186
186
}
187
187
}
188
188
@@ -236,7 +236,7 @@ object InteractiveShell {
236
236
try {
237
237
// Show the progress tracker on the console until the flow completes or is interrupted with a
238
238
// Ctrl-C keypress.
239
- val stateObservable = runFlowFromString({ clazz,args -> rpcOps.startTrackedFlowDynamic (clazz, * args) }, inputData, clazz)
239
+ val stateObservable = runFlowFromString({ clazz, args -> rpcOps.startTrackedFlowDynamic(clazz, * args) }, inputData, clazz)
240
240
241
241
val latch = CountDownLatch (1 )
242
242
ansiProgressRenderer.render(stateObservable, { latch.countDown() })
@@ -247,7 +247,6 @@ object InteractiveShell {
247
247
} catch (e: InterruptedException ) {
248
248
// TODO: When the flow framework allows us to kill flows mid-flight, do so here.
249
249
}
250
-
251
250
} catch (e: NoApplicableConstructor ) {
252
251
output.println (" No matching constructor found:" , Color .red)
253
252
e.errors.forEach { output.println (" - $it " , Color .red) }
@@ -326,7 +325,9 @@ object InteractiveShell {
326
325
val (stateMachines, stateMachineUpdates) = proxy.stateMachinesFeed()
327
326
val currentStateMachines = stateMachines.map { StateMachineUpdate .Added (it) }
328
327
val subscriber = FlowWatchPrintingSubscriber (out )
329
- stateMachineUpdates.startWith(currentStateMachines).subscribe(subscriber)
328
+ database.transaction {
329
+ stateMachineUpdates.startWith(currentStateMachines).subscribe(subscriber)
330
+ }
330
331
var result: Any? = subscriber.future
331
332
if (result is Future <* >) {
332
333
if (! result.isDone) {
@@ -348,7 +349,7 @@ object InteractiveShell {
348
349
}
349
350
350
351
@JvmStatic
351
- fun runRPCFromString (input : List <String >, out : RenderPrintWriter , context : InvocationContext <out Any >): Any? {
352
+ fun runRPCFromString (input : List <String >, out : RenderPrintWriter , context : InvocationContext <out Any >, cordaRPCOps : CordaRPCOps ): Any? {
352
353
val parser = StringToMethodCallParser (CordaRPCOps ::class .java, context.attributes[" mapper" ] as ObjectMapper )
353
354
354
355
val cmd = input.joinToString(" " ).trim { it <= ' ' }
@@ -363,7 +364,7 @@ object InteractiveShell {
363
364
var result: Any? = null
364
365
try {
365
366
InputStreamSerializer .invokeContext = context
366
- val call = database.transaction { parser.parse(context.attributes[ " ops " ] as CordaRPCOps , cmd) }
367
+ val call = database.transaction { parser.parse(cordaRPCOps , cmd) }
367
368
result = call.call()
368
369
if (result != null && result !is kotlin.Unit && result !is Void ) {
369
370
result = printAndFollowRPCResponse(result, out )
0 commit comments