使用PostgreSQL代替H2作为Corda节点的数据库

编程入门 行业动态 更新时间:2024-10-19 04:24:48
本文介绍了使用PostgreSQL代替H2作为Corda节点的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想使用PostgreSQL而不是H2作为我的节点的数据库。是否可以将PostgreSQL用于Corda节点?我该如何配置我的节点以使用PostgreSQL数据库?

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 database?

推荐答案

Corda 2和Corda 3都允许使用PostgreSQL 9.6,使用PostgreSQL JDBC驱动程序42.1.4。请注意,这是社区的实验性贡献,目前尚未经过测试。

Both Corda 2 and Corda 3 allow the use of PostgreSQL 9.6, using PostgreSQL JDBC Driver 42.1.4. Note that this is an experimental community contribution, and is currently untested.

以下是PostgreSQL的示例节点配置块:

Here is an example node configuration block for PostgreSQL:

dataSourceProperties = { dataSourceClassName = "org.postgresql.ds.PGSimpleDataSource" dataSource.url = "jdbc:postgresql://[HOST]:[PORT]/postgres" dataSource.user = [USER] dataSource.password = [PASSWORD] } database = { transactionIsolationLevel = READ_COMMITTED schema = [SCHEMA] }

您需要添加此块到节点的 node.conf 文件,该文件位于节点文件夹的根目录。

You need to add this block to the node's node.conf file, found at the root of the node folder.

请注意:

  • database.schema 属性是可选的。它表示数据库的命名空间
  • database.schema 的值未用双引号引起来,Postgres始终将其视为较低的-案例值(例如 AliceCorp 变为 alicecorp )
  • The database.schema property is optional. It represents the database's namespace
  • The value of database.schema is not wrapped in double quotes and Postgres always treats it as a lower-case value (e.g. AliceCorp becomes alicecorp)

更多推荐

使用PostgreSQL代替H2作为Corda节点的数据库

本文发布于:2023-10-24 14:23:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1524168.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:节点   数据库   PostgreSQL   Corda

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!