mirror of
https://github.com/corda/corda.git
synced 2024-12-21 13:57:54 +00:00
Trader demo now works from the command line in new RPC only mode.
This commit is contained in:
parent
e6da4909d3
commit
082fec1362
@ -67,6 +67,11 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['build']) {
|
task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['build']) {
|
||||||
|
ext.rpcUsers = [['user': "demo", 'password': "demo", 'permissions': [
|
||||||
|
'StartFlow.net.corda.flows.IssuerFlow$IssuanceRequester',
|
||||||
|
"StartFlow.net.corda.traderdemo.flow.SellerFlow"
|
||||||
|
]]]
|
||||||
|
|
||||||
directory "./build/nodes"
|
directory "./build/nodes"
|
||||||
// This name "Notary" is hard-coded into TraderDemoClientApi so if you change it here, change it there too.
|
// This name "Notary" is hard-coded into TraderDemoClientApi so if you change it here, change it there too.
|
||||||
// In this demo the node that runs a standalone notary also acts as the network map server.
|
// In this demo the node that runs a standalone notary also acts as the network map server.
|
||||||
@ -86,6 +91,7 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['build']) {
|
|||||||
artemisPort 10004
|
artemisPort 10004
|
||||||
webPort 10005
|
webPort 10005
|
||||||
cordapps = []
|
cordapps = []
|
||||||
|
rpcUsers = ext.rpcUsers
|
||||||
}
|
}
|
||||||
node {
|
node {
|
||||||
name "Bank B"
|
name "Bank B"
|
||||||
@ -94,6 +100,7 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['build']) {
|
|||||||
artemisPort 10006
|
artemisPort 10006
|
||||||
webPort 10007
|
webPort 10007
|
||||||
cordapps = []
|
cordapps = []
|
||||||
|
rpcUsers = ext.rpcUsers
|
||||||
}
|
}
|
||||||
node {
|
node {
|
||||||
name "BankOfCorda"
|
name "BankOfCorda"
|
||||||
|
@ -47,12 +47,12 @@ private class TraderDemo {
|
|||||||
val role = options.valueOf(roleArg)!!
|
val role = options.valueOf(roleArg)!!
|
||||||
if (role == Role.BUYER) {
|
if (role == Role.BUYER) {
|
||||||
val host = HostAndPort.fromString("localhost:10004")
|
val host = HostAndPort.fromString("localhost:10004")
|
||||||
CordaRPCClient(host, sslConfigFor("nodea", options.valueOf(certsPath))).use("demo", "demo") {
|
CordaRPCClient(host, sslConfigFor("BankA", options.valueOf(certsPath))).use("demo", "demo") {
|
||||||
TraderDemoClientApi(this).runBuyer()
|
TraderDemoClientApi(this).runBuyer()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
val host = HostAndPort.fromString("localhost:10006")
|
val host = HostAndPort.fromString("localhost:10006")
|
||||||
CordaRPCClient(host, sslConfigFor("nodeb", options.valueOf(certsPath))).use("demo", "demo") {
|
CordaRPCClient(host, sslConfigFor("BankB", options.valueOf(certsPath))).use("demo", "demo") {
|
||||||
TraderDemoClientApi(this).runSeller(1000.DOLLARS, "Bank A")
|
TraderDemoClientApi(this).runSeller(1000.DOLLARS, "Bank A")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user