Hyperledger Composer Rest Server 与 Cloudant NoSQL DB 的连接

Hyperledger Composer Rest Server connection with Cloudant NoSQL DB

我正在尝试设置 Hyperledger Composer Rest Server (https://hyperledger.github.io/composer/reference/rest-server) 以便在 IBM Cloud 上使用 Cloudant DB 并将卡片存储在其中用于与区块链交互。

特别是我想知道如何配置 composer-rest-server 的 COMPOSER_DATASOURCES 参数。

提前感谢您的光临。
最好的问候

Composer Rest Server 使用环回,因此 COMPOSER_DATASOURCES 是回溯数据源。为了使用 cloudant,您需要使用 npm 安装 loopback-conector-cloudant,然后将数据源设置为:

"mydb": {
  "name": "mydb",
  "connector": "cloudant",
  "username": "XXXX-bluemix",
  "password": "YYYYYYYYYYYY",
  "database": "test"
}

loopback 提供了很好的详细文档 here