From 2de789877ae0dd9b55f55ff924748e01a8aec929 Mon Sep 17 00:00:00 2001 From: Joel Dudley Date: Mon, 23 Jul 2018 12:33:56 +0100 Subject: [PATCH 1/7] Update CONTRIBUTORS.md --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index b947c7644e..2cbba70ca1 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -127,6 +127,7 @@ see changes to this list. * Massimo Morini * Mat Rizzo (R3) * Matt Britton (BCS) +* Matthew Layton (TradeIX) * Matthew Nesbit (R3) * Matthijs van den Bos (ING) * Michal Kit (R3) From 6a895401c5da1e0a6dee10c6a131fc2e02aba5d7 Mon Sep 17 00:00:00 2001 From: Matthew Layton Date: Mon, 23 Jul 2018 12:34:07 +0100 Subject: [PATCH 2/7] series0ne/corda-demobench-cordapp-select (#3543) Adds the ability to multi-select CorDapp JARs for node profiles. --- .../main/kotlin/net/corda/demobench/views/NodeTabView.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/demobench/src/main/kotlin/net/corda/demobench/views/NodeTabView.kt b/tools/demobench/src/main/kotlin/net/corda/demobench/views/NodeTabView.kt index 8cded0186d..ade5653585 100644 --- a/tools/demobench/src/main/kotlin/net/corda/demobench/views/NodeTabView.kt +++ b/tools/demobench/src/main/kotlin/net/corda/demobench/views/NodeTabView.kt @@ -145,9 +145,11 @@ class NodeTabView : Fragment() { hbox { button("Add CorDapp") { setOnAction { - val app = (chooser.showOpenDialog(null) ?: return@setOnAction).toPath() - if (!cordapps.contains(app)) { - cordapps.add(app) + (chooser.showOpenMultipleDialog(null) ?: return@setOnAction).forEach { + val app = it.toPath() + if (!cordapps.contains(app)) { + cordapps.add(app) + } } } From a0183fbdfd9ebc325b5b14261a64bf6fd21ebf3e Mon Sep 17 00:00:00 2001 From: Shams Asari Date: Mon, 23 Jul 2018 14:01:14 +0100 Subject: [PATCH 3/7] Removed PersistentNetworkMapCache.start() (#3661) The loading of all node infos in the start method was unnecessary, both for the changePublisher and _loadDBSuccess, and the setting of _registrationFuture was incorrect. --- .../messaging/ArtemisMessagingTest.kt | 2 +- .../net/corda/node/internal/AbstractNode.kt | 107 +++--------------- .../node/services/api/ServiceHubInternal.kt | 4 - .../network/PersistentNetworkMapCache.kt | 63 +++++------ .../node/internal/InternalMockNetwork.kt | 6 - 5 files changed, 41 insertions(+), 141 deletions(-) diff --git a/node/src/integration-test/kotlin/net/corda/node/services/messaging/ArtemisMessagingTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/messaging/ArtemisMessagingTest.kt index be3484212b..ed97fc2b90 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/messaging/ArtemisMessagingTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/messaging/ArtemisMessagingTest.kt @@ -78,7 +78,7 @@ class ArtemisMessagingTest { } LogHelper.setLevel(PersistentUniquenessProvider::class) database = configureDatabase(makeTestDataSourceProperties(), DatabaseConfig(), { null }, { null }) - networkMapCache = NetworkMapCacheImpl(PersistentNetworkMapCache(database, emptyList()).start(), rigorousMock(), database) + networkMapCache = NetworkMapCacheImpl(PersistentNetworkMapCache(database, emptyList()), rigorousMock(), database) } @After diff --git a/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt b/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt index d60cbf67de..4dc18fe1a2 100644 --- a/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt +++ b/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt @@ -11,16 +11,7 @@ import net.corda.core.concurrent.CordaFuture import net.corda.core.context.InvocationContext import net.corda.core.crypto.newSecureRandom import net.corda.core.crypto.sign -import net.corda.core.flows.ContractUpgradeFlow -import net.corda.core.flows.FinalityFlow -import net.corda.core.flows.FlowLogic -import net.corda.core.flows.FlowLogicRefFactory -import net.corda.core.flows.FlowSession -import net.corda.core.flows.InitiatedBy -import net.corda.core.flows.InitiatingFlow -import net.corda.core.flows.NotaryChangeFlow -import net.corda.core.flows.NotaryFlow -import net.corda.core.flows.StartableByService +import net.corda.core.flows.* import net.corda.core.identity.AbstractParty import net.corda.core.identity.CordaX500Name import net.corda.core.identity.Party @@ -32,38 +23,20 @@ import net.corda.core.internal.concurrent.map import net.corda.core.internal.concurrent.openFuture import net.corda.core.internal.notary.NotaryService import net.corda.core.internal.uncheckedCast -import net.corda.core.messaging.CordaRPCOps -import net.corda.core.messaging.FlowHandle -import net.corda.core.messaging.FlowHandleImpl -import net.corda.core.messaging.FlowProgressHandle -import net.corda.core.messaging.FlowProgressHandleImpl -import net.corda.core.messaging.RPCOps -import net.corda.core.node.AppServiceHub -import net.corda.core.node.NetworkParameters -import net.corda.core.node.NodeInfo -import net.corda.core.node.ServiceHub -import net.corda.core.node.ServicesForResolution -import net.corda.core.node.services.AttachmentStorage -import net.corda.core.node.services.CordaService -import net.corda.core.node.services.IdentityService -import net.corda.core.node.services.KeyManagementService -import net.corda.core.node.services.TransactionVerifierService +import net.corda.core.messaging.* +import net.corda.core.node.* +import net.corda.core.node.services.* import net.corda.core.serialization.SerializationWhitelist import net.corda.core.serialization.SerializeAsToken import net.corda.core.serialization.SingletonSerializeAsToken import net.corda.core.serialization.serialize -import net.corda.core.utilities.NetworkHostAndPort -import net.corda.core.utilities.days -import net.corda.core.utilities.debug -import net.corda.core.utilities.getOrThrow -import net.corda.core.utilities.minutes +import net.corda.core.utilities.* import net.corda.node.CordaClock import net.corda.node.VersionInfo import net.corda.node.cordapp.CordappLoader import net.corda.node.internal.CheckpointVerifier.verifyCheckpointsCompatible import net.corda.node.internal.classloading.requireAnnotation import net.corda.node.internal.cordapp.CordappConfigFileProvider -import net.corda.node.internal.cordapp.JarScanningCordappLoader import net.corda.node.internal.cordapp.CordappProviderImpl import net.corda.node.internal.cordapp.CordappProviderInternal import net.corda.node.internal.rpc.proxies.AuthenticatedRpcOpsProxy @@ -72,61 +45,21 @@ import net.corda.node.internal.security.RPCSecurityManager import net.corda.node.services.ContractUpgradeHandler import net.corda.node.services.FinalityHandler import net.corda.node.services.NotaryChangeHandler -import net.corda.node.services.api.CheckpointStorage -import net.corda.node.services.api.DummyAuditService -import net.corda.node.services.api.FlowStarter -import net.corda.node.services.api.IdentityServiceInternal -import net.corda.node.services.api.MonitoringService -import net.corda.node.services.api.NetworkMapCacheBaseInternal -import net.corda.node.services.api.NetworkMapCacheInternal -import net.corda.node.services.api.NodePropertiesStore -import net.corda.node.services.api.SchedulerService -import net.corda.node.services.api.SchemaService -import net.corda.node.services.api.ServiceHubInternal -import net.corda.node.services.api.StartedNodeServices -import net.corda.node.services.api.VaultServiceInternal -import net.corda.node.services.api.WritableTransactionStorage -import net.corda.node.services.config.BFTSMaRtConfiguration -import net.corda.node.services.config.NodeConfiguration -import net.corda.node.services.config.NotaryConfig -import net.corda.node.services.config.configureWithDevSSLCertificate +import net.corda.node.services.api.* +import net.corda.node.services.config.* import net.corda.node.services.config.shell.toShellConfig -import net.corda.node.services.config.shouldInitCrashShell import net.corda.node.services.events.NodeSchedulerService import net.corda.node.services.events.ScheduledActivityObserver import net.corda.node.services.identity.PersistentIdentityService import net.corda.node.services.keys.PersistentKeyManagementService import net.corda.node.services.messaging.DeduplicationHandler import net.corda.node.services.messaging.MessagingService -import net.corda.node.services.network.NetworkMapCacheImpl -import net.corda.node.services.network.NetworkMapClient -import net.corda.node.services.network.NetworkMapUpdater -import net.corda.node.services.network.NodeInfoWatcher -import net.corda.node.services.network.PersistentNetworkMapCache -import net.corda.node.services.persistence.AbstractPartyDescriptor -import net.corda.node.services.persistence.AbstractPartyToX500NameAsStringConverter -import net.corda.node.services.persistence.DBCheckpointStorage -import net.corda.node.services.persistence.DBTransactionMappingStorage -import net.corda.node.services.persistence.DBTransactionStorage -import net.corda.node.services.persistence.NodeAttachmentService -import net.corda.node.services.persistence.NodePropertiesPersistentStore +import net.corda.node.services.network.* +import net.corda.node.services.persistence.* import net.corda.node.services.schema.HibernateObserver import net.corda.node.services.schema.NodeSchemaService -import net.corda.node.services.statemachine.ExternalEvent -import net.corda.node.services.statemachine.FlowLogicRefFactoryImpl -import net.corda.node.services.statemachine.FlowMonitor -import net.corda.node.services.statemachine.SingleThreadedStateMachineManager -import net.corda.node.services.statemachine.StateMachineManager -import net.corda.node.services.statemachine.StateMachineManagerInternal -import net.corda.node.services.statemachine.appName -import net.corda.node.services.statemachine.flowVersionAndInitiatingClass -import net.corda.node.services.transactions.BFTNonValidatingNotaryService -import net.corda.node.services.transactions.BFTSMaRt -import net.corda.node.services.transactions.RaftNonValidatingNotaryService -import net.corda.node.services.transactions.RaftUniquenessProvider -import net.corda.node.services.transactions.RaftValidatingNotaryService -import net.corda.node.services.transactions.SimpleNotaryService -import net.corda.node.services.transactions.ValidatingNotaryService +import net.corda.node.services.statemachine.* +import net.corda.node.services.transactions.* import net.corda.node.services.upgrade.ContractUpgradeServiceImpl import net.corda.node.services.vault.NodeVaultService import net.corda.node.utilities.AffinityExecutor @@ -271,7 +204,6 @@ abstract class AbstractNode(val configuration: NodeConfiguration, // TODO The fact that we need to specify an empty list of notaries just to generate our node info looks // like a design smell. val persistentNetworkMapCache = PersistentNetworkMapCache(database, notaries = emptyList()) - persistentNetworkMapCache.start() val (_, nodeInfo) = updateNodeInfo(persistentNetworkMapCache, null, identity, identityKeyPair) nodeInfo } @@ -282,8 +214,7 @@ abstract class AbstractNode(val configuration: NodeConfiguration, Node.printBasicNodeInfo("Clearing network map cache entries") log.info("Starting clearing of network map cache entries...") configureDatabase(configuration.dataSourceProperties, configuration.database, { null }, { null }).use { - val networkMapCache = PersistentNetworkMapCache(it, emptyList()) - networkMapCache.clearNetworkMapCache() + PersistentNetworkMapCache(it, emptyList()).clearNetworkMapCache() } } @@ -321,7 +252,7 @@ abstract class AbstractNode(val configuration: NodeConfiguration, } val (startedImpl, schedulerService) = database.transaction { - val networkMapCache = NetworkMapCacheImpl(PersistentNetworkMapCache(database, networkParameters.notaries).start(), identityService, database) + val networkMapCache = NetworkMapCacheImpl(PersistentNetworkMapCache(database, networkParameters.notaries), identityService, database) val (keyPairs, nodeInfo) = updateNodeInfo(networkMapCache, networkMapClient, identity, identityKeyPair) identityService.loadIdentities(nodeInfo.legalIdentitiesAndCerts) val metrics = MetricRegistry() @@ -860,13 +791,6 @@ abstract class AbstractNode(val configuration: NodeConfiguration, } } - protected open fun checkNetworkMapIsInitialized() { - if (!services.networkMapCache.loadDBSuccess) { - // TODO: There should be a consistent approach to configuration error exceptions. - throw NetworkMapCacheEmptyException() - } - } - protected open fun makeKeyManagementService(identityService: IdentityService, keyPairs: Set, database: CordaPersistence): KeyManagementService { return PersistentKeyManagementService(identityService, keyPairs, database) } @@ -1098,11 +1022,6 @@ internal class FlowStarterImpl(private val smm: StateMachineManager, private val class ConfigurationException(message: String) : CordaException(message) -/** - * Thrown when a node is about to start and its network map cache doesn't contain any node. - */ -internal class NetworkMapCacheEmptyException : Exception() - /** * Creates the connection pool to the database. * diff --git a/node/src/main/kotlin/net/corda/node/services/api/ServiceHubInternal.kt b/node/src/main/kotlin/net/corda/node/services/api/ServiceHubInternal.kt index ac68f07944..3fbb296485 100644 --- a/node/src/main/kotlin/net/corda/node/services/api/ServiceHubInternal.kt +++ b/node/src/main/kotlin/net/corda/node/services/api/ServiceHubInternal.kt @@ -24,7 +24,6 @@ import net.corda.node.services.network.NetworkMapUpdater import net.corda.node.services.statemachine.ExternalEvent import net.corda.node.services.statemachine.FlowStateMachineImpl import net.corda.nodeapi.internal.persistence.CordaPersistence -import net.corda.nodeapi.internal.persistence.contextDatabase interface NetworkMapCacheInternal : NetworkMapCache, NetworkMapCacheBaseInternal interface NetworkMapCacheBaseInternal : NetworkMapCacheBase { @@ -41,9 +40,6 @@ interface NetworkMapCacheBaseInternal : NetworkMapCacheBase { /** Removes a node from the local cache. */ fun removeNode(node: NodeInfo) - - /** Indicates if loading network map data from database was successful. */ - val loadDBSuccess: Boolean } interface ServiceHubInternal : ServiceHub { diff --git a/node/src/main/kotlin/net/corda/node/services/network/PersistentNetworkMapCache.kt b/node/src/main/kotlin/net/corda/node/services/network/PersistentNetworkMapCache.kt index fb815df849..5f61f193ad 100644 --- a/node/src/main/kotlin/net/corda/node/services/network/PersistentNetworkMapCache.kt +++ b/node/src/main/kotlin/net/corda/node/services/network/PersistentNetworkMapCache.kt @@ -91,26 +91,8 @@ open class PersistentNetworkMapCache( // TODO revisit the logic under which nodeReady and loadDBSuccess are set. // with the NetworkMapService redesign their meaning is not too well defined. - private val _registrationFuture = openFuture() - override val nodeReady: CordaFuture get() = _registrationFuture - private var _loadDBSuccess: Boolean = false - override val loadDBSuccess get() = _loadDBSuccess - - fun start(): PersistentNetworkMapCache { - // if we find any network map information in the db, we are good to go - if not - // we have to wait for some being added - synchronized(_changed) { - val allNodes = database.transaction { getAllInfos(session) } - if (allNodes.isNotEmpty()) { - _loadDBSuccess = true - } - allNodes.forEach { - changePublisher.onNext(MapChange.Added(it.toNodeInfo())) - } - _registrationFuture.set(null) - } - return this - } + private val _nodeReady = openFuture() + override val nodeReady: CordaFuture = _nodeReady override val notaryIdentities: List = notaries.map { it.identity } private val validatingNotaries = notaries.mapNotNullTo(HashSet()) { if (it.validating) it.identity else null } @@ -166,11 +148,15 @@ open class PersistentNetworkMapCache( } } - override fun getNodesByLegalName(name: CordaX500Name): List = database.transaction { queryByLegalName(session, name) }.sortedByDescending { it.serial } + override fun getNodesByLegalName(name: CordaX500Name): List { + return database.transaction { queryByLegalName(session, name) }.sortedByDescending { it.serial } + } override fun getNodesByLegalIdentityKey(identityKey: PublicKey): List = nodesByKeyCache[identityKey]!! - private val nodesByKeyCache = NonInvalidatingCache>(1024, { key -> database.transaction { queryByIdentityKey(session, key) } }) + private val nodesByKeyCache = NonInvalidatingCache>(1024) { key -> + database.transaction { queryByIdentityKey(session, key) } + } override fun getNodesByOwningKeyIndex(identityKeyIndex: String): List { return database.transaction { @@ -178,16 +164,21 @@ open class PersistentNetworkMapCache( } } - override fun getNodeByAddress(address: NetworkHostAndPort): NodeInfo? = database.transaction { queryByAddress(session, address) } + override fun getNodeByAddress(address: NetworkHostAndPort): NodeInfo? { + return database.transaction { queryByAddress(session, address) } + } - override fun getPeerCertificateByLegalName(name: CordaX500Name): PartyAndCertificate? = identityByLegalNameCache.get(name)!!.orElse(null) + override fun getPeerCertificateByLegalName(name: CordaX500Name): PartyAndCertificate? { + return identityByLegalNameCache.get(name)!!.orElse(null) + } - private val identityByLegalNameCache = NonInvalidatingCache>(1024, { name -> Optional.ofNullable(database.transaction { queryIdentityByLegalName(session, name) }) }) + private val identityByLegalNameCache = NonInvalidatingCache>(1024) { name -> + Optional.ofNullable(database.transaction { queryIdentityByLegalName(session, name) }) + } override fun track(): DataFeed, MapChange> { synchronized(_changed) { - val allInfos = database.transaction { getAllInfos(session).map { it.toNodeInfo() } } - return DataFeed(allInfos, _changed.bufferUntilSubscribed().wrapWithDatabaseTransaction()) + return DataFeed(allNodes, _changed.bufferUntilSubscribed().wrapWithDatabaseTransaction()) } } @@ -214,9 +205,8 @@ open class PersistentNetworkMapCache( logger.info("Previous node was identical to incoming one - doing nothing") } } - _loadDBSuccess = true // This is used in AbstractNode to indicate that node is ready. - _registrationFuture.set(null) - logger.info("Done adding node with info: $node") + _nodeReady.set(null) + logger.debug { "Done adding node with info: $node" } } override fun removeNode(node: NodeInfo) { @@ -227,15 +217,16 @@ open class PersistentNetworkMapCache( changePublisher.onNext(MapChange.Removed(node)) } } - logger.info("Done removing node with info: $node") + logger.debug { "Done removing node with info: $node" } } - override val allNodes: List - get() = database.transaction { - getAllInfos(session).map { it.toNodeInfo() } + override val allNodes: List get() { + return database.transaction { + getAllNodeInfos(session).map { it.toNodeInfo() } } + } - private fun getAllInfos(session: Session): List { + private fun getAllNodeInfos(session: Session): List { val criteria = session.criteriaBuilder.createQuery(NodeInfoSchemaV1.PersistentNodeInfo::class.java) criteria.select(criteria.from(NodeInfoSchemaV1.PersistentNodeInfo::class.java)) return session.createQuery(criteria).resultList @@ -344,7 +335,7 @@ open class PersistentNetworkMapCache( logger.info("Clearing Network Map Cache entries") invalidateCaches() database.transaction { - val result = getAllInfos(session) + val result = getAllNodeInfos(session) logger.debug { "Number of node infos to be cleared: ${result.size}" } for (nodeInfo in result) session.remove(nodeInfo) } diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/InternalMockNetwork.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/InternalMockNetwork.kt index cbdfd70c5e..c394df142c 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/InternalMockNetwork.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/InternalMockNetwork.kt @@ -304,12 +304,6 @@ open class InternalMockNetwork(defaultParameters: MockNetworkParameters = MockNe return Crypto.deriveKeyPairFromEntropy(Crypto.EDDSA_ED25519_SHA512, counter) } - /** - * InternalMockNetwork will ensure nodes are connected to each other. The nodes themselves - * won't be able to tell if that happened already or not. - */ - override fun checkNetworkMapIsInitialized() = Unit - override fun makeTransactionVerifierService() = InMemoryTransactionVerifierService(1) // NodeInfo requires a non-empty addresses list and so we give it a dummy value for mock nodes. From a7b11758330c102a616e0606be5082c704b90eac Mon Sep 17 00:00:00 2001 From: Joel Dudley Date: Mon, 23 Jul 2018 14:15:09 +0100 Subject: [PATCH 4/7] Extended docs on h2settings (#3669) * Extended docs on h2settings * Documents h2port being deprecated in favour of h2settings. * Fixes link. * Capitalisation --- docs/source/corda-configuration-file.rst | 4 +++- docs/source/node-database-access-h2.rst | 27 ++++++++++++++++++------ 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/docs/source/corda-configuration-file.rst b/docs/source/corda-configuration-file.rst index 3a2c462a42..0b8e0061bf 100644 --- a/docs/source/corda-configuration-file.rst +++ b/docs/source/corda-configuration-file.rst @@ -85,7 +85,9 @@ absolute path to the node's base directory. Currently the defaults in ``/node/src/main/resources/reference.conf`` are as shown in the first example. This is currently the only configuration that has been tested, although in the future full support for other storage layers will be validated. -:h2port: A number that's used to pick the H2 JDBC server port. If not set a randomly chosen port will be used. +:h2Port: Deprecated. Use ``h2Settings`` instead. + +:h2Settings: Sets the H2 JDBC server port. See :doc:`node-database-access-h2`. :messagingServerAddress: The address of the ArtemisMQ broker instance. If not provided the node will run one locally. diff --git a/docs/source/node-database-access-h2.rst b/docs/source/node-database-access-h2.rst index a7f2ee40c7..220f24c4ac 100644 --- a/docs/source/node-database-access-h2.rst +++ b/docs/source/node-database-access-h2.rst @@ -13,9 +13,10 @@ Any database browsing tool that supports JDBC can be used, but if you have Intel a tool integrated with your IDE. Just open the database window and add an H2 data source with the above details. You will now be able to browse the tables and row data within them. -By default the node will expose its database on the localhost network interface. This behaviour can be -overridden by specifying the full network address (interface and port), using the new h2Settings -syntax in the node configuration: +By default, the node's H2 database is not exposed. This behaviour can be overridden by specifying the full network +address (interface and port), using the new ``h2Settings`` syntax in the node configuration. + +The configuration below will restrict the H2 service to run on ``localhost``: .. sourcecode:: groovy @@ -23,9 +24,21 @@ syntax in the node configuration: address: "localhost:12345" } -The configuration above will restrict the H2 service to run on localhost. If remote access is required, the address -can be changed to 0.0.0.0. However it is recommended to change the default username and password -before doing so. +If you want H2 to auto-select a port (mimicking the old ``h2Port`` behaviour), you can use: + +.. sourcecode:: groovy + + h2Settings { + address: "localhost:0" + } + +If remote access is required, the address can be changed to ``0.0.0.0``. However it is recommended to change the default username and password before doing so. + +.. sourcecode:: groovy + + h2Settings { + address: "0.0.0.0:12345" + } The previous ``h2Port`` syntax is now deprecated. ``h2Port`` will continue to work but the database -will only be accessible on localhost. \ No newline at end of file +will only be accessible on localhost. From c2550d2871159a4ad69bd3871581f9422f348562 Mon Sep 17 00:00:00 2001 From: josecoll Date: Mon, 23 Jul 2018 16:24:34 +0100 Subject: [PATCH 5/7] Revert merge commit changes. (#3673) --- settings.gradle | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/settings.gradle b/settings.gradle index 9b36ae309e..0cb65be579 100644 --- a/settings.gradle +++ b/settings.gradle @@ -61,15 +61,3 @@ include 'samples:cordapp-configuration' include 'samples:network-verifier' include 'serialization' include 'serialization-deterministic' - -buildCache { - local { - enabled = false - } - remote(HttpBuildCache) { -// url = 'http://localhost:5071/cache/' - // CI server: gradle-build-cache - url = 'http://40.114.193.246:80/cache/' - push = true - } -} From 14458c64340253b6e677c979b3e2758e77985d61 Mon Sep 17 00:00:00 2001 From: Joel Dudley Date: Mon, 23 Jul 2018 16:44:13 +0100 Subject: [PATCH 6/7] Update CONTRIBUTORS.md --- CONTRIBUTORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 2cbba70ca1..094211ba30 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -192,7 +192,7 @@ see changes to this list. * Tommy Lillehagen (R3) * tomtau * Tudor Malene (R3) -* Tushar Singh Bora +* Tushar Singh Bora (Accenture) * varunkm * Venelin Stoykov (INDUSTRIA) * verymahler From b9efbaa2284c420ebf9a3661c137b55f63726351 Mon Sep 17 00:00:00 2001 From: Anthony Keenan Date: Tue, 24 Jul 2018 10:05:57 +0100 Subject: [PATCH 7/7] CORDA-1585 - Tidy up participate docs + pdf toctree backport (#3674) * Fix TOC for HTML and PDF (Backport from Enterprise docs) * Tidy up participate section * Address review comments --- docs/.gitignore | 1 + docs/ext/conditional_toctree.py | 37 ++++++++++++++ docs/source/building-container-images.rst | 2 +- docs/source/conf.py | 6 ++- docs/source/contributing-index.rst | 17 +++++++ docs/source/contributing.rst | 14 ++---- docs/source/getting-set-up.rst | 2 +- docs/source/index.rst | 61 ++++++++++++----------- docs/source/release-process-index.rst | 12 ----- 9 files changed, 98 insertions(+), 54 deletions(-) create mode 100644 docs/.gitignore create mode 100644 docs/ext/conditional_toctree.py create mode 100644 docs/source/contributing-index.rst delete mode 100644 docs/source/release-process-index.rst diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000000..0d20b6487c --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1 @@ +*.pyc diff --git a/docs/ext/conditional_toctree.py b/docs/ext/conditional_toctree.py new file mode 100644 index 0000000000..3b1e65d4cd --- /dev/null +++ b/docs/ext/conditional_toctree.py @@ -0,0 +1,37 @@ +import re +from docutils.parsers.rst import directives +from sphinx.directives.other import TocTree + +def setup(app): + app.add_directive('conditional-toctree', ConditionalTocTree) + ConditionalTocTree.defined_tags = app.tags.tags.keys() + return {'version': '1.0.0'} + +def tag(argument): + return directives.choice(argument, ('htmlmode', 'pdfmode')) + +class ConditionalTocTree(TocTree): + + defined_tags = [] + has_content = True + required_arguments = 0 + optional_arguments = 0 + final_argument_whitespace = False + option_spec = { + 'maxdepth': int, + 'name': directives.unchanged, + 'caption': directives.unchanged_required, + 'glob': directives.flag, + 'hidden': directives.flag, + 'includehidden': directives.flag, + 'titlesonly': directives.flag, + 'reversed': directives.flag, + 'if_tag': tag, + } + + def run(self): + if_tag = self.options.get('if_tag') + if if_tag in self.defined_tags: + return TocTree.run(self) + else: + return [] diff --git a/docs/source/building-container-images.rst b/docs/source/building-container-images.rst index 58e02b3580..21df0e4ffb 100644 --- a/docs/source/building-container-images.rst +++ b/docs/source/building-container-images.rst @@ -1,5 +1,5 @@ ========================= -Building Container Images +Building container images ========================= To build a container image of Corda you can use the Jib gradle tasks. See the `documentation of the Jib gradle plugin `_ for details. diff --git a/docs/source/conf.py b/docs/source/conf.py index e604d66e91..d7e1aa3a2b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -13,6 +13,9 @@ # serve to show the default. import sphinx_rtd_theme +import sys, os + +sys.path.append(os.path.abspath('../ext/')) # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -25,7 +28,7 @@ import sphinx_rtd_theme # needs_sphinx = '1.0' # m2r is a Markdown to RST converter, as our design docs use Markdown. -extensions = ['rst2pdf.pdfbuilder', 'm2r'] +extensions = ['rst2pdf.pdfbuilder', 'm2r', 'conditional_toctree'] # PDF configuration pdf_documents = [('index', u'corda-developer-site', u'Corda Developer Documentation', u'R3')] @@ -274,3 +277,4 @@ latex_elements = { 'extraclassoptions' : 'openany', } + diff --git a/docs/source/contributing-index.rst b/docs/source/contributing-index.rst new file mode 100644 index 0000000000..1187c1af22 --- /dev/null +++ b/docs/source/contributing-index.rst @@ -0,0 +1,17 @@ +Contributing +============ + +Corda is an open-source project and contributions are welcome. Our contributing philosophy is described in +`CONTRIBUTING.md `_. This guide explains the mechanics +of contributing to Corda. + +.. toctree:: + :maxdepth: 1 + + contributing + building-corda + testing + codestyle + building-the-docs + api-scanner + contributing-flow-state-machines \ No newline at end of file diff --git a/docs/source/contributing.rst b/docs/source/contributing.rst index 9b8e885de9..6e4516dd05 100644 --- a/docs/source/contributing.rst +++ b/docs/source/contributing.rst @@ -1,14 +1,9 @@ -Contributing -============ - -Corda is an open-source project and contributions are welcome. Our contributing philosophy is described in -`CONTRIBUTING.md `_. This guide explains the mechanics -of contributing to Corda. - -.. contents:: +How to contribute +================= Identifying an area to contribute --------------------------------- + There are several ways to identify an area where you can contribute to Corda: * Browse issues labelled as ``good first issue`` in the @@ -26,7 +21,8 @@ Making the required changes 1. Create a fork of the master branch of the `Corda repo `_ 2. Clone the fork to your local machine -3. Make the changes, in accordance with the :doc:`code style guide ` +3. Build Corda by following the instructions :doc:`here ` +4. Make the changes, in accordance with the :doc:`code style guide ` Extending the flow state machine ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/source/getting-set-up.rst b/docs/source/getting-set-up.rst index a96dfbb0ab..1ad1a71465 100644 --- a/docs/source/getting-set-up.rst +++ b/docs/source/getting-set-up.rst @@ -100,7 +100,7 @@ IntelliJ .. _deb-ubuntu-label: Debian/Ubuntu ------- +------------- .. warning:: If you are using a Mac or a Windows machine, please follow the :ref:`mac-label` or :ref:`windows-label` instructions instead. diff --git a/docs/source/index.rst b/docs/source/index.rst index 04b65a85d9..a909055626 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -53,40 +53,41 @@ We look forward to seeing what you can do with Corda! azure-vm.rst aws-vm.rst loadtesting.rst + building-container-images.rst .. Documentation is not included in the pdf unless it is included in a toctree somewhere -.. only:: pdfmode - .. toctree:: - :caption: Other documentation +.. conditional-toctree:: + :caption: Contents + :maxdepth: 2 + :if_tag: pdfmode - deterministic-modules.rst - release-notes.rst - changelog.rst + deterministic-modules.rst + release-notes.rst + changelog.rst -.. only:: htmlmode +.. conditional-toctree:: + :caption: Design docs + :maxdepth: 2 + :if_tag: htmlmode - .. toctree:: - :caption: Design docs - :maxdepth: 2 + design/design-review-process.md + design/certificate-hierarchies/design.md + design/failure-detection-master-election/design.md + design/float/design.md + design/hadr/design.md + design/kafka-notary/design.md + design/monitoring-management/design.md + design/sgx-integration/design.md + design/sgx-infrastructure/design.md - design/design-review-process.md - design/certificate-hierarchies/design.md - design/failure-detection-master-election/design.md - design/float/design.md - design/hadr/design.md - design/kafka-notary/design.md - design/monitoring-management/design.md - design/sgx-integration/design.md - design/sgx-infrastructure/design.md - - .. toctree:: - :caption: Participate - :maxdepth: 2 - - building-corda.rst - release-process-index.rst - corda-repo-layout.rst - deterministic-modules.rst - building-the-docs.rst - building-container-images.rst +.. conditional-toctree:: + :caption: Participate + :maxdepth: 2 + :if_tag: htmlmode + + contributing-index.rst + corda-repo-layout.rst + deterministic-modules.rst + release-notes + changelog diff --git a/docs/source/release-process-index.rst b/docs/source/release-process-index.rst deleted file mode 100644 index 9ef0c82347..0000000000 --- a/docs/source/release-process-index.rst +++ /dev/null @@ -1,12 +0,0 @@ -Release process -=============== - -.. toctree:: - :maxdepth: 1 - - release-notes - changelog - contributing - codestyle - testing - api-scanner \ No newline at end of file