Using PostgreSQL instead of H2 as the Corda node's database

后端 未结 3 608
走了就别回头了
走了就别回头了 2020-12-16 08:12

I would like to use PostgreSQL instead of H2 as the database for my node. Is using PostgreSQL for Corda nodes possible? How would I configure my node to use a PostgreSQL dat

3条回答
  •  天涯浪人
    2020-12-16 08:38

    You can add the Postgresql DB properties to your node config in build.gradle script using extraConfig=[ ... ] block is shown as below.

    node {
    
        ...
    
        extraConfig = [
            dataSourceProperties: [
                    dataSourceClassName : "org.postgresql.ds.PGSimpleDataSource",
                    'dataSource.url' : "jdbc:postgresql://localhost:5432/nodedb",
                    'dataSource.user' : "postgres",
                    'dataSource.password' : "pa$$w0rd"
            ],
            database: [
                    transactionIsolationLevel : "READ_COMMITTED"
            ]
        ]
    }
    

提交回复
热议问题