BigChainDb:testnet.bigchaindb.com 和 MongoDb?

BigChainDb: testnet.bigchaindb.com with MongoDb?

所以我为什么要遵循这个例子:

https://github.com/manolodewiner/query-mongodb-bigchaindb/blob/master/queryMongo.js

但我使用的是 bigChainDb 提供的测试网服务器,所以我这样做:

const MongoClient = require('mongodb').MongoClient;


const urlMongo = 'mongodb://localhost:27017'

const dbName = 'bigchain'




let conn = new driver.Connection('https://test.bigchaindb.com/api/v1/', { 
    app_id: 'yyyyyy',
    app_key: 'xxxxxxxxxxxxxxxxxxxxxxxxxxx'
})

const alice = new driver.Ed25519Keypair();
const bob = new driver.Ed25519Keypair();

const assetdata = {
    'invoice': {
            'invoiceNo': '811',
            'issuedBy': 'supplier1',
    }

}

这显然是错误的,因为根据此处的文档:

How to Connect to MongoDB Before you can query a MongoDB database, you must connect to it, and to do that, you need to know its hostname and port.

If you’re running a BigchainDB node on your local machine (e.g. for dev and test), then the hostname should be localhost and the port should be 27017, unless you did something to change those values. If you’re running a BigchainDB node on a remote machine and you can SSH to that machine, then the same is true.

If you’re running a BigchainDB node on a remote machine and you configured its MongoDB to use auth and to be publicly-accessible (to people with authorization), then you can probably figure out its hostname and port.

https://docs.bigchaindb.com/en/latest/query.html

在示例代码中,manolodewiner 是 'pairing' 他的本地 bigchaindb 和本地 mongodb,这是默认设置,对吗?

但在我当前的代码中,我显然指向我的本地 mongodb 但 bigchain 是远程的,在 bigchain 的测试网络上,但这不起作用 - 我的本地 mongodb 并且没有 mongo 查询在工作,我应该怎么做才能 "pair" 使用本地 mongodb 远程 test.bigchaindb?

当前的 BigchainDB 测试网(在 test.bigchaindb.com)不允许外部用户直接连接到其节点中的 MongoDB 个实例。您也不能启动本地节点并将其添加到 BigchainDB 测试网。这是一个"permissioned network":现有网络节点必须明确将您的节点添加到网络中。

所以我不明白重点是什么。 我想做概念验证,但如果我无法验证数据是否在“网络上”持续存在,即使我的服务器“崩溃”,那么我除了简单的传统 mongoDB 查询.