You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/external/getting-started.md
+16-4Lines changed: 16 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -216,7 +216,7 @@ The code for this lies in the `core/drivers/fabric-driver` folder.
216
216
217
217
#### Configuring
218
218
219
-
In the `core/drivers/fabric-driver` folder, copy `.env.template` to `.env` and update `CONNECTION_PROFILE` to point to the connection profile of the fabric network (e.g. `<PATH_TO_NETWORK_SETUPS_REPO>/fabric/shared/network1/peerOrganizations/org1.network1.com/connection-org1.json`)
219
+
In the `core/drivers/fabric-driver` folder, copy `.env.template` to `.env` and update `CONNECTION_PROFILE` to point to the connection profile of the fabric network (e.g. `<PATH-TO-NETWORK-SETUPS>/fabric/shared/network1/peerOrganizations/org1.network1.com/connection-org1.json`)
220
220
221
221
Configure `fabric-driver` for `network1` as follows:
222
222
- Navigate to the `core/drivers/fabric-driver` folder.
@@ -373,11 +373,15 @@ Once you have the networks, the relays, and the drivers, running, and the ledger
373
373
374
374
## Corda to Fabric
375
375
376
-
To test the scenario where `Corda_Network` requests the value of the state (key) `Arcturus` from `network1`, do the following:
376
+
To test the scenario where `Corda_Network` requests the value of the state (key) `a` from `network1`, do the following:
377
377
- Navigate to the `samples/corda-simple-application` folder.
- Query the value of the requested state (key) `a` in `Corda_Network` using the following (replace LinearId with the CorDapp simplestate linearId value obtained in the previous command):
- Query the value of the requested state (key) `H` in `network1` using the following (replace the Args with the Args value obtained in the previous command):
- Query the value of the requested state (key) `Arcturus` in `network1` using the following (replace the Args with the Args value obtained in the previous command):
Copy file name to clipboardExpand all lines: samples/corda-simple-application/clients/src/main/kotlin/com/cordaSimpleApplication/client/InteropRequests.kt
Copy file name to clipboardExpand all lines: samples/corda-simple-application/clients/src/main/kotlin/com/cordaSimpleApplication/client/SimpleStateManager.kt
+29-1Lines changed: 29 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -121,7 +121,35 @@ class GetStateCommand : CliktCommand(help = "Gets state by key. Requires a key")
121
121
val proxy = rpc.proxy
122
122
val states = proxy.startFlow(::GetStateByKey, key)
123
123
.returnValue.get()
124
-
println(states)
124
+
println(states.toString(Charsets.UTF_8))
125
+
} catch (e:Exception) {
126
+
println(e.toString())
127
+
} finally {
128
+
rpc.close()
129
+
}
130
+
}
131
+
}
132
+
133
+
/**
134
+
* The CLI command used to trigger a GetStateByLinearId flow.
135
+
*
136
+
* @property linearId The linearId for the [SimpleState] to be retrieved.
137
+
*/
138
+
classGetStateUsingLinearIdCommand : CliktCommand(help = "Gets state by linearId. Requires a linearId") {
139
+
val linearId:String by argument()
140
+
val config by requireObject<Map<String, String>>()
141
+
overridefunrun() {
142
+
println("Get state with linearId $linearId")
143
+
val rpc =NodeRPCConnection(
144
+
host = config["CORDA_HOST"]!!,
145
+
username ="clientUser1",
146
+
password ="test",
147
+
rpcPort = config["CORDA_PORT"]!!.toInt())
148
+
try {
149
+
val proxy = rpc.proxy
150
+
val state = proxy.startFlow(::GetStateByLinearId, linearId)
0 commit comments