2

在运行快速入门教程时,如果您尝试将数据持久化到 Postgres 数据库中,那么当您重新启动沙箱时,您会在控制台中看到账本标识符不匹配。

检查数据库后,合同信息仍然存在,但ledger_entries为空。

脚步:

  1. daml new quickstart quickstart-java
  2. cd quickstart
  3. daml build
  4. daml sandbox dist/quickstart.dar --sql-backend-jdbcurl jdbc:postgresql://localhost/postgres?user=user&password=pass

以下是控制台上的输出:

HikariPool-1 - Start completed.
HikariPool-2 - Starting...
HikariPool-2 - Start completed.
running Flyway migration..
Flyway Community Edition 5.2.4 by Boxfuse
Database: jdbc:postgresql://localhost/postgres (PostgreSQL 11.3)
Flyway upgrade recommended: PostgreSQL 11.3 is newer than this version of Flyway and support has not been tested.
Successfully validated 4 migrations (execution time 00:00.053s)
Current version of schema "public": 3
Schema "public" is up to date. No migration necessary.
Flyway schema migration finished successfully applying 0 steps.
Ledger id mismatch. Ledger id given ('sandbox-69cc5004-a456-4372-9979-74e3e0eb94d2') is not equal to the existing one ('sandbox-3896b4a5-3b50-4d75-b062-7370898eac2d')!
Could not start PostgreSQL persistence layer
java.lang.RuntimeException: Ledger id mismatch. Ledger id given ('sandbox-69cc5004-a456-4372-9979-74e3e0eb94d2') is not equal to the existing one ('sandbox-3896b4a5-3b50-4d75-b062-7370898eac2d')!

这是一个不受控制的错误吗?还是数据库中保存的数据不一致?

4

1 回答 1

1

您可以将固定的分类帐 ID 作为命令行选项传递给沙箱--ledgerid my-ledger

不过我明白你的意思。如果沙盒从数据库中获取分类帐 ID,那将是更好的体验。

于 2019-06-05T18:45:50.067 回答