0

Am stuck, trying to integrate azure postgres with corda. I'm using gradle's deployNodes task to create the network locally.

Below is the exception that I get.

[ERROR] 2021-09-06T06:53:02,290Z [main] internal.NodeStartupLogging. - Exception during node startup: Couldn't find network parameters file and compatibility zone wasn't configured/isn't reachable. - Couldn't find network parameters file and compatibility zone wasn't configured/isn't reachable. [errorCode=1917kd6, moreInformationAt=https://errors.corda.net/OS/4.5/1917kd6]

I had no issues when connected with a local instance of postgres installed on my machine.

Below given is the azure postgres configuration that errors.

extraConfig = [
            'dataSourceProperties' : [
                    'dataSourceClassName': 'org.postgresql.ds.PGSimpleDataSource',
                    'dataSource.url': 'jdbc:postgresql://azure_database_name.postgres.database.azure.com:5432/demo?searchpath=demo_schema?ssl=true',
                    'dataSource.user': 'userN@me@azure_database_name',
                    'dataSource.password': 'pa$$word'
            ]
  • Did you deploy your Corda Node on an Azure VM, or your node is still on your laptop that connects to the database on Azure? – Alessandro Baffa Sep 06 '21 at 07:58
  • It's still on my machine. Once I get this working, I will have to move it to a VM. – user16528894 Sep 06 '21 at 08:07
  • The error is saying that it cannot find the network parameters file, which is needed to connect to a Corda network. Please, update your question adding what you are using for creating the Corda network locally: Network Bootstrapper? So we can be able to help you. Thank you! – Alessandro Baffa Sep 06 '21 at 08:12
  • I have reproduced your mentioned error and I have put my answer below. Please, let me know if it solves your problem @user16528894. – Alessandro Baffa Sep 06 '21 at 22:22

1 Answers1

0

Try to do this:

  • create a /drivers folder in your project root folder. This folder will contain the postgresql-XX.X.jar of PostgreSQL
  • update your build.gradle to add the location of the jar of the drivers with jarDirs, like so:
extraConfig = [
            jarDirs : ['/your-project-absolute-path/drivers'],
            dataSourceProperties : [
                    'dataSourceClassName': 'org.postgresql.ds.PGSimpleDataSource',
                    'dataSource.url': 'jdbc:postgresql://azure_database_name.postgres.database.azure.com:5432/demo?searchpath=demo_schema?ssl=true',
                    'dataSource.user': 'userN@me@azure_database_name',
                    'dataSource.password': 'pa$$word'
            ]
        ]
  • run ./gradlew deployNodes
  • run ./build/nodes/runnodes
  • the node should start (it will take some time since it has to connect to Azure DB)
Alessandro Baffa
  • 1,127
  • 3
  • 11
  • 25