mirror of
https://github.com/corda/corda.git
synced 2025-01-04 04:04:27 +00:00
Split users for bank and big corp
This commit is contained in:
parent
e80001a831
commit
53e7c27d58
@ -22,6 +22,9 @@ fun main(args: Array<String>) {
|
|||||||
BankOfCordaDriver().main(args)
|
BankOfCordaDriver().main(args)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val BANK_USERNAME = "bankUser"
|
||||||
|
val BIGCORP_USERNAME = "bigCorpUser"
|
||||||
|
|
||||||
private class BankOfCordaDriver {
|
private class BankOfCordaDriver {
|
||||||
enum class Role {
|
enum class Role {
|
||||||
ISSUE_CASH_RPC,
|
ISSUE_CASH_RPC,
|
||||||
@ -48,10 +51,11 @@ private class BankOfCordaDriver {
|
|||||||
val role = options.valueOf(roleArg)!!
|
val role = options.valueOf(roleArg)!!
|
||||||
if (role == Role.ISSUER) {
|
if (role == Role.ISSUER) {
|
||||||
driver(dsl = {
|
driver(dsl = {
|
||||||
val user = User("user1", "test", permissions = setOf(startFlowPermission<CashFlow>(), startFlowPermission<IssuerFlow.IssuanceRequester>()))
|
val bankUser = User(BANK_USERNAME, "test", permissions = setOf(startFlowPermission<CashFlow>(), startFlowPermission<IssuerFlow.IssuanceRequester>()))
|
||||||
|
val bigCorpUser = User(BIGCORP_USERNAME, "test", permissions = setOf(startFlowPermission<CashFlow>()))
|
||||||
startNode("Notary", setOf(ServiceInfo(SimpleNotaryService.type)))
|
startNode("Notary", setOf(ServiceInfo(SimpleNotaryService.type)))
|
||||||
val bankOfCorda = startNode("BankOfCorda", rpcUsers = listOf(user), advertisedServices = setOf(ServiceInfo(ServiceType.corda.getSubType("issuer.USD"))))
|
val bankOfCorda = startNode("BankOfCorda", rpcUsers = listOf(bankUser), advertisedServices = setOf(ServiceInfo(ServiceType.corda.getSubType("issuer.USD"))))
|
||||||
startNode("BigCorporation", rpcUsers = listOf(user))
|
startNode("BigCorporation", rpcUsers = listOf(bigCorpUser))
|
||||||
startWebserver(bankOfCorda.get())
|
startWebserver(bankOfCorda.get())
|
||||||
waitForAllNodesToFinish()
|
waitForAllNodesToFinish()
|
||||||
}, isDebug = true)
|
}, isDebug = true)
|
||||||
|
@ -32,7 +32,7 @@ class BankOfCordaClientApi(val hostAndPort: HostAndPort) {
|
|||||||
fun requestRPCIssue(params: IssueRequestParams): SignedTransaction {
|
fun requestRPCIssue(params: IssueRequestParams): SignedTransaction {
|
||||||
val client = CordaRPCClient(hostAndPort, configureTestSSL())
|
val client = CordaRPCClient(hostAndPort, configureTestSSL())
|
||||||
// TODO: privileged security controls required
|
// TODO: privileged security controls required
|
||||||
client.start("user1","test")
|
client.start("user1", "test")
|
||||||
val proxy = client.proxy()
|
val proxy = client.proxy()
|
||||||
|
|
||||||
// Resolve parties via RPC
|
// Resolve parties via RPC
|
||||||
|
Loading…
Reference in New Issue
Block a user