我想使用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节点的数据库
发布评论