mirror of
https://github.com/corda/corda.git
synced 2024-12-19 04:57:58 +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']) {
|
||||
ext.rpcUsers = [['user': "demo", 'password': "demo", 'permissions': [
|
||||
'StartFlow.net.corda.flows.IssuerFlow$IssuanceRequester',
|
||||
"StartFlow.net.corda.traderdemo.flow.SellerFlow"
|
||||
]]]
|
||||
|
||||
directory "./build/nodes"
|
||||
// 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.
|
||||
@ -86,6 +91,7 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['build']) {
|
||||
artemisPort 10004
|
||||
webPort 10005
|
||||
cordapps = []
|
||||
rpcUsers = ext.rpcUsers
|
||||
}
|
||||
node {
|
||||
name "Bank B"
|
||||
@ -94,6 +100,7 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['build']) {
|
||||
artemisPort 10006
|
||||
webPort 10007
|
||||
cordapps = []
|
||||
rpcUsers = ext.rpcUsers
|
||||
}
|
||||
node {
|
||||
name "BankOfCorda"
|
||||
|
@ -47,12 +47,12 @@ private class TraderDemo {
|
||||
val role = options.valueOf(roleArg)!!
|
||||
if (role == Role.BUYER) {
|
||||
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()
|
||||
}
|
||||
} else {
|
||||
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")
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user