diff --git a/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/BlacklistKotlinClosureTest.kt b/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/BlacklistKotlinClosureTest.kt index aef9fdda7f..8b45c6337d 100644 --- a/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/BlacklistKotlinClosureTest.kt +++ b/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/BlacklistKotlinClosureTest.kt @@ -48,7 +48,7 @@ class BlacklistKotlinClosureTest : IntegrationTest() { @Test fun `closure sent via RPC`() { - driver(DriverParameters(startNodesInProcess = true)) { + driver(DriverParameters(startNodesInProcess = true, notarySpecs = emptyList())) { val rpc = startNode(providedName = ALICE_NAME).getOrThrow().rpc val packet = Packet { EVIL } assertThatExceptionOfType(RPCException::class.java) @@ -56,4 +56,4 @@ class BlacklistKotlinClosureTest : IntegrationTest() { .withMessageContaining("is not on the whitelist or annotated with @CordaSerializable") } } -} \ No newline at end of file +} diff --git a/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/FlowsExecutionModeRpcTest.kt b/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/FlowsExecutionModeRpcTest.kt index c2db0111ae..25aa097da7 100644 --- a/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/FlowsExecutionModeRpcTest.kt +++ b/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/FlowsExecutionModeRpcTest.kt @@ -54,7 +54,7 @@ class FlowsExecutionModeRpcTest : IntegrationTest() { assumeFalse(System.getProperty("os.name").toLowerCase().startsWith("win")) val user = User("mark", "dadada", setOf(invokeRpc("setFlowsDrainingModeEnabled"), invokeRpc("isFlowsDrainingModeEnabled"))) - driver(DriverParameters(inMemoryDB = false, startNodesInProcess = true)) { + driver(DriverParameters(inMemoryDB = false, startNodesInProcess = true, notarySpecs = emptyList())) { val nodeName = { val nodeHandle = startNode(rpcUsers = listOf(user)).getOrThrow() val nodeName = nodeHandle.nodeInfo.chooseIdentity().name diff --git a/constants.properties b/constants.properties index 652116e765..876ab7d370 100644 --- a/constants.properties +++ b/constants.properties @@ -11,7 +11,7 @@ gradlePluginsVersion=4.0.25 kotlinVersion=1.2.51 platformVersion=4 -guavaVersion=21.0 +guavaVersion=25.1-jre proguardVersion=6.0.3 bouncycastleVersion=1.57 typesafeConfigVersion=1.3.1 diff --git a/docs/source/aws-vm-explore.rst b/docs/source/aws-vm-explore.rst new file mode 100644 index 0000000000..7dcb725fae --- /dev/null +++ b/docs/source/aws-vm-explore.rst @@ -0,0 +1,111 @@ +Deploying Corda to Corda Testnet from an AWS Cloud Platform VM +============================================================== + +.. contents:: + +This document explains how to deploy a Corda node to AWS that can connect directly to the Corda Testnet. +A self service download link can be obtained from https://testnet.corda.network. This +document will describe how to set up a virtual machine on the AWS +Cloud Platform to deploy your pre-configured Corda node and automatically connnect +to Testnet. + +Pre-requisites +-------------- +* Ensure you have a registered Amazon AWS account which can create virtual machines and you are logged on to the AWS console: https://console.aws.amazon.com. + + +Deploy Corda node +----------------- + +Browse to https://console.aws.amazon.com and log in with your AWS account. + + +**STEP 1: Launch a new virtual machine** + +Click on Launch a virtual machine with EC2. + +.. image:: resources/aws-launch.png + +In the quick start wizard scroll down and select the most recent Ubuntu machine image as the Amazon Machine Image (AMI). + +.. image:: resources/aws_select_ubuntu.png + +Select the instance type (for example t2.xlarge). + +.. image:: resources/aws-instance-type.png + +Configure a couple of other settings before we review and launch + +Under the storage tab (Step 4) increase the storage to 40GB: + +.. image:: resources/aws-storage.png + +Configure the security group (Step 6) to open the firewall ports which Corda uses. + +.. image:: resources/aws-firewall.png + +Add a firewall rule for port range 10002-10003 and allow connection from Anywhere. Add another rule for the webserver on port 8080. + +Click on the Review and Launch button then if everything looks ok click Launch. + +You will be prompted to set up keys to securely access the VM remotely over ssh. Select "Create a new key pair" from the drop down and enter a name for the key file. Click download to get the keys and keep them safe on your local machine. + +.. note:: These keys are just for connecting to your VM and are separate from the keys Corda will use to sign transactions. These keys will be generated as part of the download bundle. + +.. image:: resources/aws-keys.png + +Click "Launch Instances". + +Click on the link to go to the Instances pages in the AWS console where after a few minutes you will be able to see your instance running. + +.. image:: resources/aws-instances.png + +**STEP 2: Set up static IP address** + +On AWS a permanent IP address is called an Elastic IP. Click on the +"Elastic IP" link in the navigation panel on the left hand side of the console and then click on "Allocate new address": + +.. image:: resources/aws-elastic.png + +Follow the form then once the address is allocated click on "Actions" +then "Associate address": + +.. image:: resources/aws-elastic-actions.png + +Then select the instance you created for your Corda node to attach the +IP address to. + +**STEP 3: Connect to your VM and set up the environment** + +In the instances console click on "Connect" and follow the instructions to connect to your instance using ssh. + +.. image:: resources/aws-instances-connect.png + +.. image:: resources/aws-connect.png + + +**STEP 4: Download and set up your Corda node** + +Now your AWS environment is configured you can switch back to the Testnet +web application and click on the copy to clipboard button to get a one +time installation script. + +.. note:: If you have not already set up your account on Testnet then please visit https://testnet.corda.network and sign up. + +.. image:: resources/testnet-platform.png + +You can generate as many Testnet identites as you like by refreshing +this page to generate a new one time link. + +In the terminal of your cloud instance paste the command you just copied to install and run +your unique Corda instance on that instance: + +.. code:: bash + + sudo ONE_TIME_DOWNLOAD_KEY=YOUR_UNIQUE_DOWNLOAD_KEY_HERE bash -c "$(curl -L https://testnet.corda.network/api/user/node/install.sh)" + +.. warning:: This command will execute the install script as ROOT on your cloud instance. You may wish to examine the script prior to executing it on your machine. + +You can now navigate to the external web address of the instance and +see any cordapps running on port 8080 (if you have any installed). + diff --git a/docs/source/azure-vm-explore.rst b/docs/source/azure-vm-explore.rst new file mode 100644 index 0000000000..ef64a86782 --- /dev/null +++ b/docs/source/azure-vm-explore.rst @@ -0,0 +1,135 @@ +Deploying Corda to Corda Testnet from an Azure Cloud Platform VM +================================================================ + +.. contents:: + +This document explains how to deploy a Corda node to Azure that can connect directly to the Corda Testnet. A self service download link can be obtained from https://testnet.corda.network. This document will describe how to set up a virtual machine on the Azure Cloud Platform to deploy your pre-configured Corda node and automatically connnect to Testnet. + +Pre-requisites +-------------- +* Ensure you have a registered Microsoft Azure account which can create virtual machines and you are logged on to the Azure portal: https://portal.azure.com. + + +Deploy Corda node +----------------- + +Browse to https://portal.azure.com and log in with your Microsoft account. + + +**STEP 1: Create a Resource Group** + +Click on the "Resource groups" link in the side nav in the Azure +Portal and then click "Add": + +.. image:: resources/azure-rg.png + +Fill in the form and click "Create": + +.. image:: resources/azure-rg-2.png + +**STEP 2: Launch the VM** + +At the top of the left sidenav click on the button with the green cross "Create a resource". + +In this example we are going to use an Ubuntu server so select the latest Ubuntu Server option. + +.. image:: resources/azure-select-ubuntu.png + +Fill in the form: + +.. image:: resources/azure-vm-form.png + +Add a username (to log into the VM) and choose and enter a password. + +Choose the resource group we created earlier from the "Use existing" dropdown. + +Select a cloud region geographically near to your location to host your VM. + +Click on OK. + +Choose the "D4S_V3 Standard" option and click "Select": + +.. image:: resources/azure-instance-type.png + +Click on "Public IP address" to open the settings panel + +.. image:: resources/azure-vm-settings.png + +Set the IP address to "Static" under Assignment. + +.. note:: This is so the IP address for your node does not change rapidly in the global network map. + +.. image:: resources/azure-set-static-ip.png + +Click OK. + +Next click on "Network security group (firewall)": + +.. image:: resources/azure-nsg.png + +Add inbound rules for ports 8080 (webserver), and +10002-10003 for the P2P and RPC ports used by the Corda node +respectively: + +Add 3 rules with the following port, name and priorities: + +.. code:: bash + + Port range: 10002, Priority: 1041 Name: Port_10002 + Port range: 10003, Priority: 1042 Name: Port_10003 + Port range: 8080, Priority: 1043 Name: Port_8080 + +.. note:: The priority has to be unique number in the range 900 + (highest) and 4096 (lowest) priority. Make sure each rule + has a unique priority or there will be a validation failure and error message. + +.. image:: resources/azure-nsg-2.png + +Click OK and OK again on the Settings panel. + +.. image:: resources/azure-settings-ok.png + + +Click "Create" and wait a few minutes for your instance to provision +and start running. + +.. image:: resources/azure-create-vm.png + + + +**STEP 3: Connect to your VM and set up the environment** + +Once your instance is running click on the "Connect" button and copy the ssh command: + +.. image:: resources/azure-ssh.png + +Enter the ssh command into your terminal. At the prompt to continue connecting type yes and then enter the password you configured earlier to log into the remote VM: + +.. image:: resources/azure-shell.png + + +**STEP 4: Download and set up your Corda node** + +Now your Azure environment is configured you can switch to the Testnet +web application and click on the copy to clipboard button to get a one +time installation script. + +.. note:: If you have not already set up your account on Testnet then please visit https://testnet.corda.network and sign up. + + +.. image:: resources/testnet-platform.png + +You can generate as many Testnet identites as you like by refreshing +this page to generate a new one time link. + +In the terminal of your cloud instance paste the command you just copied to install and run +your unique Corda node: + +.. code:: bash + + sudo ONE_TIME_DOWNLOAD_KEY=YOUR_UNIQUE_DOWNLOAD_KEY_HERE bash -c "$(curl -L https://testnet.corda.network/api/user/node/install.sh)" + +.. warning:: This command will execute the install script as ROOT on your cloud instance. You may wish to examine the script prior to executing it on your machine. + +You can now navigate to the external web address of the instance and +see any cordapps running on port 8080 (if you have any installed). diff --git a/docs/source/corda-networks-index.rst b/docs/source/corda-networks-index.rst index c56a8f3210..777d57a443 100644 --- a/docs/source/corda-networks-index.rst +++ b/docs/source/corda-networks-index.rst @@ -9,4 +9,8 @@ Networks permissioning network-map versioning + corda-testnet-intro + azure-vm-explore + aws-vm-explore + gcp-vm cipher-suites diff --git a/docs/source/corda-testnet-intro.rst b/docs/source/corda-testnet-intro.rst new file mode 100644 index 0000000000..1fb9c58740 --- /dev/null +++ b/docs/source/corda-testnet-intro.rst @@ -0,0 +1,75 @@ +The Corda Testnet +================= + +.. contents:: + +The Corda Testnet is an open public network of Corda nodes on the internet. It is designed to be a complement to *the* Corda Network where any entity can transact real world value with any other counterparty in the context of any application. The Corda Testnet is designed for "non-production" use in a genuine global context of Corda nodes, including but not limited to CorDapp development, multi-party testing, demonstration and showcasing of applications and services, learning, training and development of the Corda platform technology and specific applications of Corda. + +The Corda Testnet is based on exactly the same technology as the main Corda Network, but can be joined on a self-service basis through the automated provisioning system described below. + +The Corda Testnet is currently in private beta. Interested parties can request in invitation to join the Corda Testnet by completing a short request form (see below). + + +Deploying a Corda node to the Corda Testnet +------------------------------------------- + +Access to the Corda Testnet is enabled by visiting https://testnet.corda.network. + +.. image:: resources/testnet-landing.png + :target: https://testnet.corda.network + +Click on "Join the Corda Testnet". + +Select whether you want to register a company or as an individual on the Testnet. + +This will create you an account with the Testnet onboarding application which will enable you to provision and manage multiple Corda nodes on Testnet. You will log in to this account to view and manage you Corda Testnet identitiy certificates. + +.. image:: resources/testnet-account-type.png + +Fill in the form with your details. This helps prioritise requests to join the private beta. + + +.. image:: resources/testnet-form.png + +Note we currently only support federated login using either Google email accounts or Github enabled email accounts. Please ensure the email you use to register is either set up as a Google or Github account and that you use this email to log in with the appropriate service. + +To enable your email for Google please see https://support.google.com/accounts/answer/176347?hl=en + +To set up a Github account please see https://github.com/join + + +Once you have been approved to join the beta you will receive an email. Follow the link in the email to sign in or click on "I have an invitation" on the https://testnet.corda.network + +Sign in using either the Google or Github login services: + +.. image:: resources/testnet-signin.png + +When prompted approve the Testnet application: + +.. image:: resources/testnet-signin-auth.png + +At this point you may need to verify your email address is valid. If prompted check your email and click on the link to validate then return to the sign in page and sign in again. + +Next agree to the terms of service: + +.. image:: resources/testnet-terms.png + +You can now choose how to deploy your Corda node to the Corda Testnet. We strongly recommend hosting your Corda node on a public cloud resource. + +.. note:: If you host your node on your own machine or a corporate server you must ensure it is reachable from the public internet at a specific IP address. This will typically require port forwarding on your router. + +Select the cloud provider you wish to use for documentation on how to specifically configure Corda for that environment. + +.. image:: resources/testnet-platform-clean.png + +Once your cloud instance is set up you can install and run your Testnet pre-provisioned Corda node by clicking on "Copy" and pasting the one time link into your cloud shell. + +The installation script will download the Corda binaries as well as your PKI certificates, private keys and suporting files and will install and run Corda on your fresh cloud VM. Your node will register itself with the Corda Testnet when it first runs and be added to the global network map and be visible to counterparties after approximately 5 minutes. + +Hosting a Corda node locally is possible but will require manually configuring firewall and port forwarding on your local router. If you want this option then click on the "Download" button to download a Zip file with a pre-configured Corda node. + +A note on identities on Corda Testnet +------------------------------------- + +Unlike the main Corda Network, which is designed for verified real world identities, The Corda Testnet automatically assigns a "distinguished name" as your identity on the network. This is to prevent name abuse such as the use of offensive language in the names or name squatting. This allows the provision of a node to be automatic and instantaneous. It also enables the same user to safely generate many nodes without accidental name conflicts. If you require a human readable name then please contact support and a partial organsation name can be approved. + diff --git a/docs/source/gcp-vm.rst b/docs/source/gcp-vm.rst new file mode 100644 index 0000000000..8f5f8e9606 --- /dev/null +++ b/docs/source/gcp-vm.rst @@ -0,0 +1,120 @@ +Deploying Corda to Corda Testnet from a Google Cloud Platform VM +================================================================ + +.. contents:: + +This document explains how to deploy a Corda node to Google Cloud Platform that can connect directly to the Corda Testnet. A self service download link can be obtained from https://testnet.corda.network. This document will describe how to set up a virtual machine on the Google Cloud Platform (GCP) to deploy your pre-configured Corda node and automatically connnect to Testnet. + +Pre-requisites +-------------- +* Ensure you have a registered Google Cloud Platform account with + billing enabled (https://cloud.google.com/billing/docs/how-to/manage-billing-account) which can create virtual machines under your subscription(s) and you are logged on to the GCP console: https://console.cloud.google.com. + + +Deploy Corda node +----------------- + +Browse to https://console.cloud.google.com and log in with your +Google credentials. + +**STEP 1: Create a GCP Project** + +In the project drop down click on the plus icon to create a new +project to house your Corda resources. + +.. image:: resources/consolegcp.png + +.. image:: resources/console2.png + +.. image:: resources/newprojectgcp.png + +Enter a project name and click Create. + +**STEP 2: Launch the VM** + +In the left hand side nav click on Compute Engine. + +.. image:: resources/gcpcompute.png + +Click on Create Instance. + +.. image:: resources/consolegcpcreatevm.png + +Fill in the form with the desired VM specs: + +Recommended minimum 4vCPU with 15GB memory and 40GB Persistent disk. +Ubuntu 16.04 LTS. + +Allow full API access. + +Dont worry about firewall settings as you will configure those later. + +.. image:: resources/gcpconsolevmsettings.png + +Click Create and wait a few sections for your instance to provision +and start running. + +**STEP 3: Connect to your VM and set up the environment** + +Once your instance is running click on the SSH button to launch a +cloud SSH terminal in a new window. + +.. image:: resources/gcpconsolelaunchssh.png + +.. image:: resources/gcpshell.png + +Run the following to configure the firewall to allow Corda traffic + +.. code:: bash + + gcloud compute firewall-rules create nodetonode --allow tcp:10002 + gcloud compute firewall-rules create nodetorpc --allow tcp:10003 + gcloud compute firewall-rules create webserver --allow tcp:8080 + + +Promote the ephemeral IP address associated with this +instance to a static IP address. + +First check the region and select the one you are using from the list: + +.. code:: bash + + gcloud compute regions list + +Find your external IP: + +.. code:: bash + + gcloud compute addresses list + +Run this command with the ephemeral IP address as the argument to +the --addresses flag and the region: + +.. code:: bash + + gcloud compute addresses create corda-node --addresses 35.204.53.61 --region europe-west4 + +**STEP 4: Download and set up your Corda node** + +Now your GCP environment is configured you can switch to the Testnet +web application and click on the copy to clipboard button to get a one +time installation script. + +.. note:: If you have not already set up your account on Testnet then please visit https://testnet.corda.network and sign up. + +.. image:: resources/testnet-platform.png + +You can generate as many Testnet identites as you like by refreshing +this page to generate a new one time link. + +In the terminal of your cloud instance paste the command you just copied to install and run +your unique Corda instance: + +.. code:: bash + + sudo ONE_TIME_DOWNLOAD_KEY=YOUR_UNIQUE_DOWNLOAD_KEY_HERE bash -c "$(curl -L https://testnet.corda.network/api/user/node/install.sh)" + +.. warning:: This command will execute the install script as ROOT on your cloud instance. You may wish to examine the script prior to executing it on your machine. + +You can now navigate to the external web address of the instance and +see any cordapps running on port 8080 (if you have any installed). diff --git a/docs/source/resources/aws-connect.png b/docs/source/resources/aws-connect.png new file mode 100644 index 0000000000..bc62d4e956 Binary files /dev/null and b/docs/source/resources/aws-connect.png differ diff --git a/docs/source/resources/aws-elastic-actions.png b/docs/source/resources/aws-elastic-actions.png new file mode 100644 index 0000000000..63b48b52cd Binary files /dev/null and b/docs/source/resources/aws-elastic-actions.png differ diff --git a/docs/source/resources/aws-elastic.png b/docs/source/resources/aws-elastic.png new file mode 100644 index 0000000000..5fa3c700e8 Binary files /dev/null and b/docs/source/resources/aws-elastic.png differ diff --git a/docs/source/resources/aws-firewall.png b/docs/source/resources/aws-firewall.png new file mode 100644 index 0000000000..13cca347a0 Binary files /dev/null and b/docs/source/resources/aws-firewall.png differ diff --git a/docs/source/resources/aws-instance-type.png b/docs/source/resources/aws-instance-type.png new file mode 100644 index 0000000000..996dc08b75 Binary files /dev/null and b/docs/source/resources/aws-instance-type.png differ diff --git a/docs/source/resources/aws-instances-connect.png b/docs/source/resources/aws-instances-connect.png new file mode 100644 index 0000000000..a2ee1170f8 Binary files /dev/null and b/docs/source/resources/aws-instances-connect.png differ diff --git a/docs/source/resources/aws-instances.png b/docs/source/resources/aws-instances.png new file mode 100644 index 0000000000..eb9fb21b86 Binary files /dev/null and b/docs/source/resources/aws-instances.png differ diff --git a/docs/source/resources/aws-keys.png b/docs/source/resources/aws-keys.png new file mode 100644 index 0000000000..3a09e4e22d Binary files /dev/null and b/docs/source/resources/aws-keys.png differ diff --git a/docs/source/resources/aws-launch.png b/docs/source/resources/aws-launch.png new file mode 100644 index 0000000000..7c9a03ed0d Binary files /dev/null and b/docs/source/resources/aws-launch.png differ diff --git a/docs/source/resources/aws-storage.png b/docs/source/resources/aws-storage.png new file mode 100644 index 0000000000..5d772a2f69 Binary files /dev/null and b/docs/source/resources/aws-storage.png differ diff --git a/docs/source/resources/aws_select_ubuntu.png b/docs/source/resources/aws_select_ubuntu.png new file mode 100644 index 0000000000..a7084b1fd1 Binary files /dev/null and b/docs/source/resources/aws_select_ubuntu.png differ diff --git a/docs/source/resources/azure-connect-ssh.png b/docs/source/resources/azure-connect-ssh.png new file mode 100644 index 0000000000..7c49b1613a Binary files /dev/null and b/docs/source/resources/azure-connect-ssh.png differ diff --git a/docs/source/resources/azure-connect.png b/docs/source/resources/azure-connect.png new file mode 100644 index 0000000000..63e1e0ab08 Binary files /dev/null and b/docs/source/resources/azure-connect.png differ diff --git a/docs/source/resources/azure-create-vm.png b/docs/source/resources/azure-create-vm.png new file mode 100644 index 0000000000..ff2e0795ae Binary files /dev/null and b/docs/source/resources/azure-create-vm.png differ diff --git a/docs/source/resources/azure-instance-type.png b/docs/source/resources/azure-instance-type.png new file mode 100644 index 0000000000..72c5148185 Binary files /dev/null and b/docs/source/resources/azure-instance-type.png differ diff --git a/docs/source/resources/azure-networking.png b/docs/source/resources/azure-networking.png new file mode 100644 index 0000000000..7a7e31263c Binary files /dev/null and b/docs/source/resources/azure-networking.png differ diff --git a/docs/source/resources/azure-nsg-2.png b/docs/source/resources/azure-nsg-2.png new file mode 100644 index 0000000000..b69d1b31b1 Binary files /dev/null and b/docs/source/resources/azure-nsg-2.png differ diff --git a/docs/source/resources/azure-nsg.png b/docs/source/resources/azure-nsg.png new file mode 100644 index 0000000000..d3133763ce Binary files /dev/null and b/docs/source/resources/azure-nsg.png differ diff --git a/docs/source/resources/azure-port-rule.png b/docs/source/resources/azure-port-rule.png new file mode 100644 index 0000000000..40bf16e7e9 Binary files /dev/null and b/docs/source/resources/azure-port-rule.png differ diff --git a/docs/source/resources/azure-rg-2.png b/docs/source/resources/azure-rg-2.png new file mode 100644 index 0000000000..9d1a2dfd85 Binary files /dev/null and b/docs/source/resources/azure-rg-2.png differ diff --git a/docs/source/resources/azure-rg.png b/docs/source/resources/azure-rg.png new file mode 100644 index 0000000000..8264249b87 Binary files /dev/null and b/docs/source/resources/azure-rg.png differ diff --git a/docs/source/resources/azure-screen-form.png b/docs/source/resources/azure-screen-form.png new file mode 100644 index 0000000000..3cc9979cf4 Binary files /dev/null and b/docs/source/resources/azure-screen-form.png differ diff --git a/docs/source/resources/azure-select-ubuntu.png b/docs/source/resources/azure-select-ubuntu.png new file mode 100644 index 0000000000..9c017e422f Binary files /dev/null and b/docs/source/resources/azure-select-ubuntu.png differ diff --git a/docs/source/resources/azure-set-static-ip.png b/docs/source/resources/azure-set-static-ip.png new file mode 100644 index 0000000000..8efe84bd5a Binary files /dev/null and b/docs/source/resources/azure-set-static-ip.png differ diff --git a/docs/source/resources/azure-settings-ok.png b/docs/source/resources/azure-settings-ok.png new file mode 100644 index 0000000000..ebc1801c3a Binary files /dev/null and b/docs/source/resources/azure-settings-ok.png differ diff --git a/docs/source/resources/azure-shell.png b/docs/source/resources/azure-shell.png new file mode 100644 index 0000000000..799eb3f8e4 Binary files /dev/null and b/docs/source/resources/azure-shell.png differ diff --git a/docs/source/resources/azure-ssh.png b/docs/source/resources/azure-ssh.png new file mode 100644 index 0000000000..0ef577a1bd Binary files /dev/null and b/docs/source/resources/azure-ssh.png differ diff --git a/docs/source/resources/azure-vm-form.png b/docs/source/resources/azure-vm-form.png new file mode 100644 index 0000000000..7d2ee7835f Binary files /dev/null and b/docs/source/resources/azure-vm-form.png differ diff --git a/docs/source/resources/azure-vm-settings.png b/docs/source/resources/azure-vm-settings.png new file mode 100644 index 0000000000..5329477c52 Binary files /dev/null and b/docs/source/resources/azure-vm-settings.png differ diff --git a/docs/source/resources/azure-vm-spec.png b/docs/source/resources/azure-vm-spec.png new file mode 100644 index 0000000000..98df5ccd4a Binary files /dev/null and b/docs/source/resources/azure-vm-spec.png differ diff --git a/docs/source/resources/console2.png b/docs/source/resources/console2.png new file mode 100644 index 0000000000..00dc994b82 Binary files /dev/null and b/docs/source/resources/console2.png differ diff --git a/docs/source/resources/consolegcp.png b/docs/source/resources/consolegcp.png new file mode 100644 index 0000000000..d7139f645a Binary files /dev/null and b/docs/source/resources/consolegcp.png differ diff --git a/docs/source/resources/consolegcpcreatevm.png b/docs/source/resources/consolegcpcreatevm.png new file mode 100644 index 0000000000..ba42d5c0ab Binary files /dev/null and b/docs/source/resources/consolegcpcreatevm.png differ diff --git a/docs/source/resources/gcpcompute.png b/docs/source/resources/gcpcompute.png new file mode 100644 index 0000000000..9e614477d6 Binary files /dev/null and b/docs/source/resources/gcpcompute.png differ diff --git a/docs/source/resources/gcpconsolelaunchssh.png b/docs/source/resources/gcpconsolelaunchssh.png new file mode 100644 index 0000000000..101ad7bff2 Binary files /dev/null and b/docs/source/resources/gcpconsolelaunchssh.png differ diff --git a/docs/source/resources/gcpconsolevmsettings.png b/docs/source/resources/gcpconsolevmsettings.png new file mode 100644 index 0000000000..73d857a233 Binary files /dev/null and b/docs/source/resources/gcpconsolevmsettings.png differ diff --git a/docs/source/resources/gcpshell.png b/docs/source/resources/gcpshell.png new file mode 100644 index 0000000000..b873a7e49f Binary files /dev/null and b/docs/source/resources/gcpshell.png differ diff --git a/docs/source/resources/newprojectgcp.png b/docs/source/resources/newprojectgcp.png new file mode 100644 index 0000000000..735fb595b0 Binary files /dev/null and b/docs/source/resources/newprojectgcp.png differ diff --git a/docs/source/resources/testnet-account-type.png b/docs/source/resources/testnet-account-type.png new file mode 100644 index 0000000000..739b82d8b9 Binary files /dev/null and b/docs/source/resources/testnet-account-type.png differ diff --git a/docs/source/resources/testnet-form.png b/docs/source/resources/testnet-form.png new file mode 100644 index 0000000000..3c2f8cfa93 Binary files /dev/null and b/docs/source/resources/testnet-form.png differ diff --git a/docs/source/resources/testnet-landing.png b/docs/source/resources/testnet-landing.png new file mode 100644 index 0000000000..6e3ad8e3ee Binary files /dev/null and b/docs/source/resources/testnet-landing.png differ diff --git a/docs/source/resources/testnet-platform-clean.png b/docs/source/resources/testnet-platform-clean.png new file mode 100644 index 0000000000..f48f7a8740 Binary files /dev/null and b/docs/source/resources/testnet-platform-clean.png differ diff --git a/docs/source/resources/testnet-platform.png b/docs/source/resources/testnet-platform.png new file mode 100644 index 0000000000..1af4bc462a Binary files /dev/null and b/docs/source/resources/testnet-platform.png differ diff --git a/docs/source/resources/testnet-signin-auth.png b/docs/source/resources/testnet-signin-auth.png new file mode 100644 index 0000000000..bd189e6770 Binary files /dev/null and b/docs/source/resources/testnet-signin-auth.png differ diff --git a/docs/source/resources/testnet-signin.png b/docs/source/resources/testnet-signin.png new file mode 100644 index 0000000000..dba4974296 Binary files /dev/null and b/docs/source/resources/testnet-signin.png differ diff --git a/docs/source/resources/testnet-terms.png b/docs/source/resources/testnet-terms.png new file mode 100644 index 0000000000..45aa91cec2 Binary files /dev/null and b/docs/source/resources/testnet-terms.png differ diff --git a/finance/src/integration-test/kotlin/net/corda/finance/compat/CashExceptionSerialisationTest.kt b/finance/src/integration-test/kotlin/net/corda/finance/compat/CashExceptionSerialisationTest.kt index 080d677b20..f64b2ecaed 100644 --- a/finance/src/integration-test/kotlin/net/corda/finance/compat/CashExceptionSerialisationTest.kt +++ b/finance/src/integration-test/kotlin/net/corda/finance/compat/CashExceptionSerialisationTest.kt @@ -31,7 +31,7 @@ class CashExceptionSerialisationTest : IntegrationTest() { @Test fun `cash exception with a cause can be serialised with AMQP`() { - driver(DriverParameters(startNodesInProcess = true)) { + driver(DriverParameters(startNodesInProcess = true, notarySpecs = emptyList())) { val node = startNode(rpcUsers = listOf(User("mark", "dadada", setOf(all())))).getOrThrow() val action = { node.rpc.startFlow(::CashExceptionThrowingFlow).returnValue.getOrThrow() } assertThatThrownBy(action).isInstanceOfSatisfying(CashException::class.java) { thrown -> diff --git a/finance/src/integration-test/kotlin/net/corda/finance/flows/CashConfigDataFlowTest.kt b/finance/src/integration-test/kotlin/net/corda/finance/flows/CashConfigDataFlowTest.kt index 72002c20f7..dce4ebb22f 100644 --- a/finance/src/integration-test/kotlin/net/corda/finance/flows/CashConfigDataFlowTest.kt +++ b/finance/src/integration-test/kotlin/net/corda/finance/flows/CashConfigDataFlowTest.kt @@ -18,6 +18,7 @@ import net.corda.testing.core.ALICE_NAME import net.corda.testing.core.BOB_NAME import net.corda.testing.core.DUMMY_BANK_A_NAME import net.corda.testing.core.DUMMY_NOTARY_NAME +import net.corda.testing.driver.DriverParameters import net.corda.testing.driver.driver import net.corda.testing.internal.IntegrationTest import net.corda.testing.internal.IntegrationTestSchemas @@ -35,10 +36,10 @@ class CashConfigDataFlowTest : IntegrationTest() { } @Test fun `issuable currencies are read in from node config`() { - driver { + driver(DriverParameters(notarySpecs = emptyList())) { val node = startNode(customOverrides = mapOf("custom" to mapOf("issuableCurrencies" to listOf("EUR", "USD")))).getOrThrow() val config = node.rpc.startFlow(::CashConfigDataFlow).returnValue.getOrThrow() assertThat(config.issuableCurrencies).containsExactly(EUR, USD) } } -} \ No newline at end of file +} diff --git a/node/src/integration-test/kotlin/net/corda/node/BootTests.kt b/node/src/integration-test/kotlin/net/corda/node/BootTests.kt index 9aaf60ce79..878c90f4a8 100644 --- a/node/src/integration-test/kotlin/net/corda/node/BootTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/BootTests.kt @@ -25,7 +25,7 @@ import net.corda.node.services.Permissions.Companion.startFlow import net.corda.nodeapi.exceptions.InternalNodeException import net.corda.testing.core.ALICE_NAME import net.corda.testing.core.BOB_NAME -import net.corda.testing.core.DUMMY_NOTARY_NAME +import net.corda.testing.core.DUMMY_BANK_A_NAME import net.corda.testing.driver.DriverParameters import net.corda.testing.driver.NodeHandle import net.corda.testing.driver.NodeParameters @@ -48,26 +48,16 @@ class BootTests : IntegrationTest() { companion object { @ClassRule @JvmField - val databaseSchemas = IntegrationTestSchemas(ALICE_NAME.toDatabaseSchemaName(), BOB_NAME.toDatabaseSchemaName(), DUMMY_NOTARY_NAME.toDatabaseSchemaName()) + val databaseSchemas = IntegrationTestSchemas(ALICE_NAME.toDatabaseSchemaName(), BOB_NAME.toDatabaseSchemaName(), DUMMY_BANK_A_NAME.toDatabaseSchemaName()) } - @Test fun `java deserialization is disabled`() { - val user = User("u", "p", setOf(startFlow())) - val params = NodeParameters(rpcUsers = listOf(user)) - - fun NodeHandle.attemptJavaDeserialization() { - CordaRPCClient(rpcAddress).use(user.username, user.password) { connection -> - connection.proxy - rpc.startFlow(::ObjectInputStreamFlow).returnValue.getOrThrow() - } - } - driver { - val devModeNode = startNode(params, BOB_NAME).getOrThrow() - val node = startNode(ALICE_NAME, devMode = false, parameters = params).getOrThrow() - - assertThatThrownBy { devModeNode.attemptJavaDeserialization() }.isInstanceOf(CordaRuntimeException::class.java) - assertThatThrownBy { node.attemptJavaDeserialization() }.isInstanceOf(InternalNodeException::class.java) + driver(DriverParameters(notarySpecs = emptyList())) { + val user = User("u", "p", setOf(startFlow())) + val future = CordaRPCClient(startNode(rpcUsers = listOf(user)).getOrThrow().rpcAddress). + start(user.username, user.password).proxy.startFlow(::ObjectInputStreamFlow).returnValue + assertThatThrownBy { future.getOrThrow() } + .isInstanceOf(CordaRuntimeException::class.java) } } diff --git a/node/src/integration-test/kotlin/net/corda/node/CordappScanningDriverTest.kt b/node/src/integration-test/kotlin/net/corda/node/CordappScanningDriverTest.kt index 96ee0b67df..46d3cf4248 100644 --- a/node/src/integration-test/kotlin/net/corda/node/CordappScanningDriverTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/CordappScanningDriverTest.kt @@ -23,6 +23,7 @@ import net.corda.testing.core.ALICE_NAME import net.corda.testing.core.BOB_NAME import net.corda.testing.core.DUMMY_NOTARY_NAME import net.corda.testing.core.singleIdentity +import net.corda.testing.driver.DriverParameters import net.corda.testing.driver.driver import net.corda.testing.internal.IntegrationTest import net.corda.testing.internal.IntegrationTestSchemas @@ -44,7 +45,7 @@ class CordappScanningDriverTest : IntegrationTest() { fun `sub-classed initiated flow pointing to the same initiating flow as its super-class`() { val user = User("u", "p", setOf(startFlow())) // The driver will automatically pick up the annotated flows below - driver { + driver(DriverParameters(notarySpecs = emptyList())) { val (alice, bob) = listOf( startNode(providedName = ALICE_NAME, rpcUsers = listOf(user)), startNode(providedName = BOB_NAME)).transpose().getOrThrow() diff --git a/node/src/integration-test/kotlin/net/corda/node/NodeUnloadHandlerTests.kt b/node/src/integration-test/kotlin/net/corda/node/NodeUnloadHandlerTests.kt index 0c402fdda7..d5f6da21ac 100644 --- a/node/src/integration-test/kotlin/net/corda/node/NodeUnloadHandlerTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/NodeUnloadHandlerTests.kt @@ -24,6 +24,7 @@ import net.corda.testing.internal.IntegrationTestSchemas import net.corda.testing.internal.toDatabaseSchemaName import org.junit.Assert import org.junit.ClassRule +import org.junit.Assert.assertTrue import org.junit.Test import java.util.concurrent.CountDownLatch import java.util.concurrent.TimeUnit @@ -38,16 +39,16 @@ class NodeUnloadHandlerTests : IntegrationTest() { @Test fun `should be able to register run on stop lambda`() { - driver(DriverParameters(startNodesInProcess = true, extraCordappPackagesToScan = listOf("net.corda.node"))) { + driver(DriverParameters(startNodesInProcess = true, extraCordappPackagesToScan = listOf("net.corda.node"), notarySpecs = emptyList())) { startNode(providedName = DUMMY_BANK_A_NAME).getOrThrow() // just want to fall off the end of this for the mo... } - Assert.assertTrue("Timed out waiting for AbstractNode to invoke the test service shutdown callback", latch.await(30, TimeUnit.SECONDS)) + assertTrue("Timed out waiting for AbstractNode to invoke the test service shutdown callback", latch.await(30, TimeUnit.SECONDS)) } + @Suppress("unused") @CordaService class RunOnStopTestService(serviceHub: ServiceHub) : SingletonSerializeAsToken() { - companion object { private val log = contextLogger() } @@ -56,9 +57,9 @@ class NodeUnloadHandlerTests : IntegrationTest() { serviceHub.registerUnloadHandler(this::shutdown) } - fun shutdown() { + private fun shutdown() { log.info("shutting down") latch.countDown() } } -} \ No newline at end of file +} diff --git a/node/src/integration-test/kotlin/net/corda/node/flows/FlowRetryTest.kt b/node/src/integration-test/kotlin/net/corda/node/flows/FlowRetryTest.kt index 0e06ea54bb..46f0983385 100644 --- a/node/src/integration-test/kotlin/net/corda/node/flows/FlowRetryTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/flows/FlowRetryTest.kt @@ -46,11 +46,13 @@ class FlowRetryTest : IntegrationTest() { val numSessions = 2 val numIterations = 10 val user = User("mark", "dadada", setOf(Permissions.startFlow())) - val result: Any? = driver(DriverParameters(startNodesInProcess = isQuasarAgentSpecified(), - portAllocation = RandomFree)) { - - val nodeAHandle = startNode(providedName = ALICE_NAME, rpcUsers = listOf(user)).getOrThrow() - val nodeBHandle = startNode(providedName = BOB_NAME, rpcUsers = listOf(user)).getOrThrow() + val result: Any? = driver(DriverParameters( + startNodesInProcess = isQuasarAgentSpecified(), + portAllocation = RandomFree, + notarySpecs = emptyList() + )) { + val nodeAHandle = startNode(rpcUsers = listOf(user)).getOrThrow() + val nodeBHandle = startNode(rpcUsers = listOf(user)).getOrThrow() val result = CordaRPCClient(nodeAHandle.rpcAddress).start(user.username, user.password).use { it.proxy.startFlow(::InitiatorFlow, numSessions, numIterations, nodeBHandle.nodeInfo.singleIdentity()).returnValue.getOrThrow() @@ -165,4 +167,4 @@ data class SessionInfo(val sessionNum: Int, val iterationsCount: Int) enum class Step { First, BeforeInitiate, AfterInitiate, AfterInitiateSendReceive, BeforeSend, AfterSend, BeforeReceive, AfterReceive } -data class Visited(val sessionNum: Int, val iterationNum: Int, val step: Step) \ No newline at end of file +data class Visited(val sessionNum: Int, val iterationNum: Int, val step: Step) diff --git a/node/src/integration-test/kotlin/net/corda/node/modes/draining/P2PFlowsDrainingModeTest.kt b/node/src/integration-test/kotlin/net/corda/node/modes/draining/P2PFlowsDrainingModeTest.kt index fcda5dc136..c2b42eeffa 100644 --- a/node/src/integration-test/kotlin/net/corda/node/modes/draining/P2PFlowsDrainingModeTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/modes/draining/P2PFlowsDrainingModeTest.kt @@ -68,9 +68,7 @@ class P2PFlowsDrainingModeTest : IntegrationTest() { @Test fun `flows draining mode suspends consumption of initial session messages`() { - - driver(DriverParameters(startNodesInProcess = false, portAllocation = portAllocation)) { - + driver(DriverParameters(startNodesInProcess = false, portAllocation = portAllocation, notarySpecs = emptyList())) { val initiatedNode = startNode(providedName = ALICE_NAME).getOrThrow() val initiating = startNode(providedName = BOB_NAME, rpcUsers = users).getOrThrow().rpc val counterParty = initiatedNode.nodeInfo.singleIdentity() @@ -100,9 +98,7 @@ class P2PFlowsDrainingModeTest : IntegrationTest() { @Test fun `clean shutdown by draining`() { - - driver(DriverParameters(startNodesInProcess = true, portAllocation = portAllocation)) { - + driver(DriverParameters(startNodesInProcess = true, portAllocation = portAllocation, notarySpecs = emptyList())) { val nodeA = startNode(providedName = ALICE_NAME, rpcUsers = users).getOrThrow() val nodeB = startNode(providedName = BOB_NAME, rpcUsers = users).getOrThrow() var successful = false diff --git a/node/src/integration-test/kotlin/net/corda/node/modes/draining/RpcFlowsDrainingModeTest.kt b/node/src/integration-test/kotlin/net/corda/node/modes/draining/RpcFlowsDrainingModeTest.kt index d971726ef5..ef1a0471ea 100644 --- a/node/src/integration-test/kotlin/net/corda/node/modes/draining/RpcFlowsDrainingModeTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/modes/draining/RpcFlowsDrainingModeTest.kt @@ -44,11 +44,8 @@ class RpcFlowsDrainingModeTest : IntegrationTest() { @Test fun `flows draining mode rejects start flows commands through rpc`() { - - driver(DriverParameters(startNodesInProcess = false, portAllocation = portAllocation)) { - + driver(DriverParameters(startNodesInProcess = false, portAllocation = portAllocation, notarySpecs = emptyList())) { startNode(rpcUsers = users).getOrThrow().rpc.apply { - setFlowsDrainingModeEnabled(true) val error: Throwable? = catchThrowable { startFlow(RpcFlowsDrainingModeTest::NoOpFlow) } @@ -61,11 +58,9 @@ class RpcFlowsDrainingModeTest : IntegrationTest() { @StartableByRPC class NoOpFlow : FlowLogic() { - @Suspendable override fun call() { - println("NO OP!") } } -} \ No newline at end of file +} diff --git a/node/src/integration-test/kotlin/net/corda/node/services/AttachmentLoadingTests.kt b/node/src/integration-test/kotlin/net/corda/node/services/AttachmentLoadingTests.kt index 51db21b079..67367d12c8 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/AttachmentLoadingTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/AttachmentLoadingTests.kt @@ -123,25 +123,28 @@ class AttachmentLoadingTests : IntegrationTest() { } @Test - fun `test that attachments retrieved over the network are not used for code`() = withoutTestSerialization { - driver(DriverParameters(startNodesInProcess = true)) { - installIsolatedCordappTo(bankAName) - val (bankA, bankB) = createTwoNodes() - assertFailsWith("Party C=CH,L=Zurich,O=BankB rejected session request: Don't know net.corda.finance.contracts.isolated.IsolatedDummyFlow\$Initiator") { - bankA.rpc.startFlowDynamic(flowInitiatorClass, bankB.nodeInfo.legalIdentities.first()).returnValue.getOrThrow() + fun `test that attachments retrieved over the network are not used for code`() { + withoutTestSerialization { + driver(DriverParameters(startNodesInProcess = true, notarySpecs = emptyList())) { + installIsolatedCordappTo(bankAName) + val (bankA, bankB) = createTwoNodes() + assertFailsWith("Party C=CH,L=Zurich,O=BankB rejected session request: Don't know net.corda.finance.contracts.isolated.IsolatedDummyFlow\$Initiator") { + bankA.rpc.startFlowDynamic(flowInitiatorClass, bankB.nodeInfo.legalIdentities.first()).returnValue.getOrThrow() + } } + Unit } - Unit } @Test - fun `tests that if the attachment is loaded on both sides already that a flow can run`() = withoutTestSerialization { - driver { - installIsolatedCordappTo(bankAName) - installIsolatedCordappTo(bankBName) - val (bankA, bankB) = createTwoNodes() - bankA.rpc.startFlowDynamic(flowInitiatorClass, bankB.nodeInfo.legalIdentities.first()).returnValue.getOrThrow() + fun `tests that if the attachment is loaded on both sides already that a flow can run`() { + withoutTestSerialization { + driver { + installIsolatedCordappTo(bankAName) + installIsolatedCordappTo(bankBName) + val (bankA, bankB) = createTwoNodes() + bankA.rpc.startFlowDynamic(flowInitiatorClass, bankB.nodeInfo.legalIdentities.first()).returnValue.getOrThrow() + } } - Unit } } diff --git a/node/src/integration-test/kotlin/net/corda/node/services/rpc/RpcSslTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/rpc/RpcSslTest.kt index 625186c27e..164b826f6d 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/rpc/RpcSslTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/rpc/RpcSslTest.kt @@ -70,7 +70,7 @@ class RpcSslTest : IntegrationTest() { val trustStorePath = saveToTrustStore(tempFolder.root.toPath() / "truststore.jks", cert) val clientSslOptions = ClientRpcSslOptions(trustStorePath, "password") - driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree)) { + driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree, notarySpecs = emptyList())) { val node = startNode(rpcUsers = listOf(user), customOverrides = brokerSslOptions.useSslRpcOverrides()).getOrThrow() val client = CordaRPCClient.createWithSsl(node.rpcAddress, sslConfiguration = clientSslOptions) val connection = client.start(user.username, user.password) @@ -108,7 +108,7 @@ class RpcSslTest : IntegrationTest() { val trustStorePath = saveToTrustStore(tempFolder.root.toPath() / "truststore.jks", cert1) val clientSslOptions = ClientRpcSslOptions(trustStorePath, "password") - driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree)) { + driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree, notarySpecs = emptyList())) { val node = startNode(rpcUsers = listOf(user), customOverrides = brokerSslOptions.useSslRpcOverrides()).getOrThrow() Assertions.assertThatThrownBy { val connection = CordaRPCClient.createWithSsl(node.rpcAddress, sslConfiguration = clientSslOptions).start(user.username, user.password) @@ -128,7 +128,7 @@ class RpcSslTest : IntegrationTest() { fun `RPC client not using ssl can run commands`() { val user = User("mark", "dadada", setOf(all())) var successful = false - driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree)) { + driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree, notarySpecs = emptyList())) { val node = startNode(rpcUsers = listOf(user)).getOrThrow() val connection = CordaRPCClient(node.rpcAddress).start(user.username, user.password) connection.proxy.apply { @@ -148,7 +148,7 @@ class RpcSslTest : IntegrationTest() { val trustStorePath = saveToTrustStore(tempFolder.root.toPath() / "truststore.jks", cert) val clientSslOptions = ClientRpcSslOptions(trustStorePath, "password") - driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree)) { + driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree, notarySpecs = emptyList())) { val node = startNode(customOverrides = brokerSslOptions.useSslRpcOverrides()).getOrThrow() val client = CordaRPCClient.createWithSsl(node.rpcAddress, sslConfiguration = clientSslOptions) diff --git a/node/src/integration-test/kotlin/net/corda/node/services/statemachine/HardRestartTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/statemachine/HardRestartTest.kt index d51a350be6..5aa73ef59e 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/statemachine/HardRestartTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/statemachine/HardRestartTest.kt @@ -43,7 +43,7 @@ class HardRestartTest : IntegrationTest() { @StartableByRPC @InitiatingFlow - class Ping(val pongParty: Party, val times: Int) : FlowLogic() { + class Ping(private val pongParty: Party, val times: Int) : FlowLogic() { @Suspendable override fun call() { val pongSession = initiateFlow(pongParty) @@ -56,7 +56,7 @@ class HardRestartTest : IntegrationTest() { } @InitiatedBy(Ping::class) - class Pong(val pingSession: FlowSession) : FlowLogic() { + class Pong(private val pingSession: FlowSession) : FlowLogic() { @Suspendable override fun call() { val times = pingSession.sendAndReceive(Unit).unwrap { it } @@ -70,7 +70,12 @@ class HardRestartTest : IntegrationTest() { @Test fun restartShortPingPongFlowRandomly() { val demoUser = User("demo", "demo", setOf(Permissions.startFlow(), Permissions.all())) - driver(DriverParameters(startNodesInProcess = false, inMemoryDB = false, systemProperties = mapOf("log4j.configurationFile" to logConfigFile.toString()))) { + driver(DriverParameters( + startNodesInProcess = false, + inMemoryDB = false, + notarySpecs = emptyList(), + systemProperties = mapOf("log4j.configurationFile" to logConfigFile.toString()) + )) { val (a, b) = listOf( startNode(providedName = DUMMY_BANK_A_NAME, rpcUsers = listOf(demoUser), customOverrides = mapOf("p2pAddress" to "localhost:30000")), startNode(providedName = DUMMY_BANK_B_NAME, rpcUsers = listOf(demoUser), customOverrides = mapOf("p2pAddress" to "localhost:40000")) @@ -102,7 +107,12 @@ class HardRestartTest : IntegrationTest() { @Test fun restartLongPingPongFlowRandomly() { val demoUser = User("demo", "demo", setOf(Permissions.startFlow(), Permissions.all())) - driver(DriverParameters(startNodesInProcess = false, inMemoryDB = false, systemProperties = mapOf("log4j.configurationFile" to logConfigFile.toString()))) { + driver(DriverParameters( + startNodesInProcess = false, + inMemoryDB = false, + notarySpecs = emptyList(), + systemProperties = mapOf("log4j.configurationFile" to logConfigFile.toString()) + )) { val (a, b) = listOf( startNode(providedName = DUMMY_BANK_A_NAME, rpcUsers = listOf(demoUser), customOverrides = mapOf("p2pAddress" to "localhost:30000")), startNode(providedName = DUMMY_BANK_B_NAME, rpcUsers = listOf(demoUser), customOverrides = mapOf("p2pAddress" to "localhost:40000")) @@ -134,7 +144,12 @@ class HardRestartTest : IntegrationTest() { @Test fun softRestartLongPingPongFlowRandomly() { val demoUser = User("demo", "demo", setOf(Permissions.startFlow(), Permissions.all())) - driver(DriverParameters(startNodesInProcess = false, inMemoryDB = false, systemProperties = mapOf("log4j.configurationFile" to logConfigFile.toString()))) { + driver(DriverParameters( + startNodesInProcess = false, + inMemoryDB = false, + notarySpecs = emptyList(), + systemProperties = mapOf("log4j.configurationFile" to logConfigFile.toString()) + )) { val (a, b) = listOf( startNode(providedName = DUMMY_BANK_A_NAME, rpcUsers = listOf(demoUser), customOverrides = mapOf("p2pAddress" to "localhost:30000")), startNode(providedName = DUMMY_BANK_B_NAME, rpcUsers = listOf(demoUser), customOverrides = mapOf("p2pAddress" to "localhost:40000")) @@ -197,20 +212,25 @@ class HardRestartTest : IntegrationTest() { @InitiatingFlow @InitiatedBy(RecursiveA::class) - class RecursiveB(val otherSession: FlowSession) : FlowLogic() { + class RecursiveB(private val otherSession: FlowSession) : FlowLogic() { @Suspendable override fun call() { val depth = otherSession.receive().unwrap { it } val newSession = initiateFlow(otherSession.counterparty) val string = newSession.sendAndReceive(depth - 1).unwrap { it } - otherSession.send(string + ":" + depth) + otherSession.send("$string:$depth") } } @Test fun restartRecursiveFlowRandomly() { val demoUser = User("demo", "demo", setOf(Permissions.startFlow(), Permissions.all())) - driver(DriverParameters(startNodesInProcess = false, inMemoryDB = false, systemProperties = mapOf("log4j.configurationFile" to logConfigFile.toString()))) { + driver(DriverParameters( + startNodesInProcess = false, + inMemoryDB = false, + notarySpecs = emptyList(), + systemProperties = mapOf("log4j.configurationFile" to logConfigFile.toString()) + )) { val (a, b) = listOf( startNode(providedName = DUMMY_BANK_A_NAME, rpcUsers = listOf(demoUser), customOverrides = mapOf("p2pAddress" to "localhost:30000")), startNode(providedName = DUMMY_BANK_B_NAME, rpcUsers = listOf(demoUser), customOverrides = mapOf("p2pAddress" to "localhost:40000")) diff --git a/testing/node-driver/src/integration-test/kotlin/net/corda/testing/driver/DriverTests.kt b/testing/node-driver/src/integration-test/kotlin/net/corda/testing/driver/DriverTests.kt index d1293bfc19..3baabd14c5 100644 --- a/testing/node-driver/src/integration-test/kotlin/net/corda/testing/driver/DriverTests.kt +++ b/testing/node-driver/src/integration-test/kotlin/net/corda/testing/driver/DriverTests.kt @@ -73,7 +73,7 @@ class DriverTests : IntegrationTest() { @Test fun `simple node startup and shutdown`() { - val handle = driver { + val handle = driver(DriverParameters(notarySpecs = emptyList())) { val node = startNode(providedName = DUMMY_REGULATOR_NAME) nodeMustBeUp(node) } diff --git a/tools/shell/src/integration-test/kotlin/net/corda/tools/shell/InteractiveShellIntegrationTest.kt b/tools/shell/src/integration-test/kotlin/net/corda/tools/shell/InteractiveShellIntegrationTest.kt index 5d4cd1709b..c22a142050 100644 --- a/tools/shell/src/integration-test/kotlin/net/corda/tools/shell/InteractiveShellIntegrationTest.kt +++ b/tools/shell/src/integration-test/kotlin/net/corda/tools/shell/InteractiveShellIntegrationTest.kt @@ -62,12 +62,12 @@ class InteractiveShellIntegrationTest : IntegrationTest() { @JvmField val tempFolder = TemporaryFolder() - val testName = X500Principal("CN=Test,O=R3 Ltd,L=London,C=GB") + private val testName = X500Principal("CN=Test,O=R3 Ltd,L=London,C=GB") @Test fun `shell should not log in with invalid credentials`() { val user = User("u", "p", setOf()) - driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree)) { + driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree, notarySpecs = emptyList())) { val nodeFuture = startNode(providedName = ALICE_NAME, rpcUsers = listOf(user), startInSameProcess = true) val node = nodeFuture.getOrThrow() @@ -83,7 +83,7 @@ class InteractiveShellIntegrationTest : IntegrationTest() { @Test fun `shell should log in with valid credentials`() { val user = User("u", "p", setOf()) - driver { + driver(DriverParameters(notarySpecs = emptyList())) { val nodeFuture = startNode(providedName = ALICE_NAME, rpcUsers = listOf(user), startInSameProcess = true) val node = nodeFuture.getOrThrow() @@ -108,7 +108,7 @@ class InteractiveShellIntegrationTest : IntegrationTest() { val trustStorePath = saveToTrustStore(tempFolder.root.toPath() / "truststore.jks", cert) val clientSslOptions = ClientRpcSslOptions(trustStorePath, "password") - driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree)) { + driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree, notarySpecs = emptyList())) { startNode(rpcUsers = listOf(user), customOverrides = brokerSslOptions.useSslRpcOverrides()).getOrThrow().use { node -> val conf = ShellConfiguration(commandsDirectory = Files.createTempDir().toPath(), @@ -136,7 +136,7 @@ class InteractiveShellIntegrationTest : IntegrationTest() { val trustStorePath = saveToTrustStore(tempFolder.root.toPath() / "truststore.jks", cert1) val clientSslOptions = ClientRpcSslOptions(trustStorePath, "password") - driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree)) { + driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree, notarySpecs = emptyList())) { startNode(rpcUsers = listOf(user), customOverrides = brokerSslOptions.useSslRpcOverrides()).getOrThrow().use { node -> val conf = ShellConfiguration(commandsDirectory = Files.createTempDir().toPath(), @@ -153,7 +153,7 @@ class InteractiveShellIntegrationTest : IntegrationTest() { @Test fun `internal shell user should not be able to connect if node started with devMode=false`() { - driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree)) { + driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree, notarySpecs = emptyList())) { startNode().getOrThrow().use { node -> val conf = (node as NodeHandleInternal).configuration.toShellConfig() InteractiveShell.startShellInternal(conf) @@ -168,7 +168,7 @@ class InteractiveShellIntegrationTest : IntegrationTest() { val user = User("u", "p", setOf(Permissions.startFlow(), Permissions.invokeRpc(CordaRPCOps::registeredFlows), Permissions.invokeRpc(CordaRPCOps::nodeInfo))) - driver { + driver(DriverParameters(notarySpecs = emptyList())) { val nodeFuture = startNode(providedName = ALICE_NAME, rpcUsers = listOf(user), startInSameProcess = true) val node = nodeFuture.getOrThrow() @@ -219,7 +219,7 @@ class InteractiveShellIntegrationTest : IntegrationTest() { val clientSslOptions = ClientRpcSslOptions(trustStorePath, "password") var successful = false - driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree)) { + driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree, notarySpecs = emptyList())) { startNode(rpcUsers = listOf(user), customOverrides = brokerSslOptions.useSslRpcOverrides()).getOrThrow().use { node -> val conf = ShellConfiguration(commandsDirectory = Files.createTempDir().toPath(), @@ -261,4 +261,4 @@ class InteractiveShellIntegrationTest : IntegrationTest() { } } -} \ No newline at end of file +} diff --git a/tools/shell/src/integration-test/kotlin/net/corda/tools/shell/SSHServerTest.kt b/tools/shell/src/integration-test/kotlin/net/corda/tools/shell/SSHServerTest.kt index e1ecd0db75..4148108b74 100644 --- a/tools/shell/src/integration-test/kotlin/net/corda/tools/shell/SSHServerTest.kt +++ b/tools/shell/src/integration-test/kotlin/net/corda/tools/shell/SSHServerTest.kt @@ -37,7 +37,6 @@ import org.bouncycastle.util.io.Streams import org.junit.ClassRule import org.junit.Ignore import org.junit.Test -import java.lang.Thread.sleep import java.net.ConnectException import kotlin.test.assertTrue import kotlin.test.fail @@ -53,7 +52,7 @@ class SSHServerTest : IntegrationTest() { fun `ssh server does not start be default`() { val user = User("u", "p", setOf()) // The driver will automatically pick up the annotated flows below - driver { + driver(DriverParameters(notarySpecs = emptyList())) { val node = startNode(providedName = ALICE_NAME, rpcUsers = listOf(user)) node.getOrThrow() @@ -64,7 +63,7 @@ class SSHServerTest : IntegrationTest() { try { session.connect() fail() - } catch (e:JSchException) { + } catch (e: JSchException) { assertTrue(e.cause is ConnectException) } } @@ -74,7 +73,7 @@ class SSHServerTest : IntegrationTest() { fun `ssh server starts when configured`() { val user = User("u", "p", setOf()) // The driver will automatically pick up the annotated flows below - driver { + driver(DriverParameters(notarySpecs = emptyList())) { val node = startNode(providedName = ALICE_NAME, rpcUsers = listOf(user), customOverrides = mapOf("sshd" to mapOf("port" to 2222)) /*, startInSameProcess = true */) node.getOrThrow() @@ -93,7 +92,7 @@ class SSHServerTest : IntegrationTest() { fun `ssh server verify credentials`() { val user = User("u", "p", setOf()) // The driver will automatically pick up the annotated flows below - driver { + driver(DriverParameters(notarySpecs = emptyList())) { val node = startNode(providedName = ALICE_NAME, rpcUsers = listOf(user), customOverrides = mapOf("sshd" to mapOf("port" to 2222))) node.getOrThrow() @@ -117,7 +116,7 @@ class SSHServerTest : IntegrationTest() { val user = User("u", "p", setOf(startFlow(), invokeRpc(CordaRPCOps::wellKnownPartyFromX500Name))) // The driver will automatically pick up the annotated flows below - driver { + driver(DriverParameters(notarySpecs = emptyList())) { val node = startNode(providedName = ALICE_NAME, rpcUsers = listOf(user), customOverrides = mapOf("sshd" to mapOf("port" to 2222))) node.getOrThrow() @@ -146,7 +145,7 @@ class SSHServerTest : IntegrationTest() { fun `ssh runs flows`() { val user = User("u", "p", setOf(startFlow())) // The driver will automatically pick up the annotated flows below - driver { + driver(DriverParameters(notarySpecs = emptyList())) { val node = startNode(providedName = ALICE_NAME, rpcUsers = listOf(user), customOverrides = mapOf("sshd" to mapOf("port" to 2222))) node.getOrThrow() @@ -191,9 +190,10 @@ class SSHServerTest : IntegrationTest() { override val progressTracker: ProgressTracker? = ProgressTracker(HELLO_STEP) } + @Suppress("unused") @StartableByRPC @InitiatingFlow - class FlowICannotRun(val otherParty: Party) : FlowLogic() { + class FlowICannotRun(private val otherParty: Party) : FlowLogic() { @Suspendable override fun call(): String = initiateFlow(otherParty).receive().unwrap { it } diff --git a/webserver/src/integration-test/kotlin/net/corda/webserver/WebserverDriverTests.kt b/webserver/src/integration-test/kotlin/net/corda/webserver/WebserverDriverTests.kt index ac4a9cd3eb..367b1a3732 100644 --- a/webserver/src/integration-test/kotlin/net/corda/webserver/WebserverDriverTests.kt +++ b/webserver/src/integration-test/kotlin/net/corda/webserver/WebserverDriverTests.kt @@ -18,6 +18,7 @@ import net.corda.testing.core.DUMMY_BANK_A_NAME import net.corda.testing.core.DUMMY_NOTARY_NAME import net.corda.testing.internal.IntegrationTest import net.corda.testing.internal.IntegrationTestSchemas +import net.corda.testing.driver.DriverParameters import net.corda.testing.driver.WebserverHandle import net.corda.testing.driver.driver import net.corda.testing.node.internal.addressMustBeBound @@ -47,7 +48,7 @@ class WebserverDriverTests : IntegrationTest() { @Test fun `starting a node and independent web server works`() { - val addr = driver { + val addr = driver(DriverParameters(notarySpecs = emptyList())) { val node = startNode(providedName = DUMMY_BANK_A_NAME).getOrThrow() val webserverHandle = startWebserver(node).getOrThrow() webserverMustBeUp(webserverHandle)