Cleaned up notary configuration by introducing a notary config option.

extraAdvertisedServiceIds is no longer used for this.
This commit is contained in:
Shams Asari
2017-10-05 12:27:45 +01:00
parent 83f37417ae
commit 727cd0e55c
88 changed files with 600 additions and 716 deletions

View File

@ -75,7 +75,8 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
networkMap "O=Notary Service,OU=corda,L=London,C=GB"
node {
name "O=Notary Service,OU=corda,L=London,C=GB"
advertisedServices = ["corda.notary.validating"]
notary = [validating : true]
advertisedServices = []
p2pPort 10002
rpcPort 10003
webPort 10004

View File

@ -11,8 +11,6 @@ import net.corda.finance.contracts.asset.Cash
import net.corda.finance.flows.CashIssueFlow
import net.corda.finance.flows.CashPaymentFlow
import net.corda.node.services.FlowPermissions.Companion.startFlowPermission
import net.corda.nodeapi.internal.ServiceInfo
import net.corda.node.services.transactions.ValidatingNotaryService
import net.corda.nodeapi.User
import net.corda.testing.*
import net.corda.testing.driver.driver
@ -32,10 +30,10 @@ class IntegrationTestingTutorial {
val bobUser = User("bobUser", "testPassword2", permissions = setOf(
startFlowPermission<CashPaymentFlow>()
))
val (alice, bob, notary) = listOf(
val (alice, bob) = listOf(
startNode(providedName = ALICE.name, rpcUsers = listOf(aliceUser)),
startNode(providedName = BOB.name, rpcUsers = listOf(bobUser)),
startNode(providedName = DUMMY_NOTARY.name, advertisedServices = setOf(ServiceInfo(ValidatingNotaryService.type)))
startNotaryNode(DUMMY_NOTARY.name)
).transpose().getOrThrow()
// END 1

View File

@ -15,9 +15,7 @@ import net.corda.finance.flows.CashExitFlow
import net.corda.finance.flows.CashIssueFlow
import net.corda.finance.flows.CashPaymentFlow
import net.corda.node.services.FlowPermissions.Companion.startFlowPermission
import net.corda.node.services.transactions.ValidatingNotaryService
import net.corda.nodeapi.User
import net.corda.nodeapi.internal.ServiceInfo
import net.corda.testing.ALICE
import net.corda.testing.DUMMY_NOTARY
import net.corda.testing.driver.driver
@ -49,7 +47,7 @@ fun main(args: Array<String>) {
startFlowPermission<CashExitFlow>()))
driver(driverDirectory = baseDirectory, extraCordappPackagesToScan = listOf("net.corda.finance")) {
startNode(providedName = DUMMY_NOTARY.name, advertisedServices = setOf(ServiceInfo(ValidatingNotaryService.type)))
startNotaryNode(DUMMY_NOTARY.name)
val node = startNode(providedName = ALICE.name, rpcUsers = listOf(user)).get()
// END 1

View File

@ -9,8 +9,6 @@ import net.corda.finance.contracts.getCashBalances
import net.corda.finance.flows.CashIssueFlow
import net.corda.finance.schemas.CashSchemaV1
import net.corda.node.internal.StartedNode
import net.corda.node.services.transactions.ValidatingNotaryService
import net.corda.nodeapi.internal.ServiceInfo
import net.corda.testing.*
import net.corda.testing.node.MockNetwork
import org.junit.After
@ -30,11 +28,7 @@ class CustomVaultQueryTest {
fun setup() {
setCordappPackages("net.corda.finance.contracts.asset")
mockNet = MockNetwork(threadPerNode = true)
val notaryService = ServiceInfo(ValidatingNotaryService.type)
mockNet.createNode(
legalName = DUMMY_NOTARY.name,
notaryIdentity = notaryService to DUMMY_NOTARY_KEY,
advertisedServices = *arrayOf(notaryService))
mockNet.createNotaryNode(legalName = DUMMY_NOTARY.name)
nodeA = mockNet.createPartyNode()
nodeB = mockNet.createPartyNode()

View File

@ -9,8 +9,6 @@ import net.corda.finance.contracts.getCashBalances
import net.corda.finance.flows.CashIssueFlow
import net.corda.finance.schemas.CashSchemaV1
import net.corda.node.internal.StartedNode
import net.corda.node.services.transactions.ValidatingNotaryService
import net.corda.nodeapi.internal.ServiceInfo
import net.corda.testing.*
import net.corda.testing.node.MockNetwork
import org.junit.After
@ -28,11 +26,7 @@ class FxTransactionBuildTutorialTest {
fun setup() {
setCordappPackages("net.corda.finance.contracts.asset")
mockNet = MockNetwork(threadPerNode = true)
val notaryService = ServiceInfo(ValidatingNotaryService.type)
mockNet.createNode(
legalName = DUMMY_NOTARY.name,
notaryIdentity = notaryService to DUMMY_NOTARY_KEY,
advertisedServices = *arrayOf(notaryService))
mockNet.createNotaryNode(legalName = DUMMY_NOTARY.name)
nodeA = mockNet.createPartyNode()
nodeB = mockNet.createPartyNode()
nodeA.internals.registerCustomSchemas(setOf(CashSchemaV1))

View File

@ -9,10 +9,11 @@ import net.corda.core.node.services.vault.QueryCriteria
import net.corda.core.toFuture
import net.corda.core.utilities.getOrThrow
import net.corda.node.internal.StartedNode
import net.corda.node.services.transactions.ValidatingNotaryService
import net.corda.nodeapi.internal.ServiceInfo
import net.corda.testing.*
import net.corda.testing.DUMMY_NOTARY
import net.corda.testing.chooseIdentity
import net.corda.testing.node.MockNetwork
import net.corda.testing.setCordappPackages
import net.corda.testing.unsetCordappPackages
import org.junit.After
import org.junit.Before
import org.junit.Test
@ -33,11 +34,7 @@ class WorkflowTransactionBuildTutorialTest {
fun setup() {
setCordappPackages("net.corda.docs")
mockNet = MockNetwork(threadPerNode = true)
val notaryService = ServiceInfo(ValidatingNotaryService.type)
mockNet.createNode(
legalName = DUMMY_NOTARY.name,
notaryIdentity = Pair(notaryService, DUMMY_NOTARY_KEY),
advertisedServices = *arrayOf(notaryService))
mockNet.createNotaryNode(legalName = DUMMY_NOTARY.name)
nodeA = mockNet.createPartyNode()
nodeB = mockNet.createPartyNode()
nodeA.internals.registerInitiatedFlow(RecordCompletionFlow::class.java)