I'm using Hyperledger Fabric SDK for node.js to enroll a user. I'm using this code to deploy in fabric. It uses FileKeyValueStore (uses files to store the key values) to store client's user credential.
I want to use CouchDBKeyValueStore to store user key in CouchDB database instance. So I found sample source code at stackoverflow. But I don't know what value should be inside the <USERNAME>, <PASSWORD>, <URL>. For example, I don't know if it's the username of the OS or the name of the user I want to register.
Hyperledger fabric client credential store using CouchDB
const Client = require('fabric-client');
const CDBKVS = require('fabric-client/lib/impl/CouchDBKeyValueStore.js');
var client = Client.loadFromConfig('test/fixtures/network.yaml');
// Set the state store
let stateStore = await new CDBKVS({url: 'https://<USERNAME>:<PASSWORD>@<URL>', name: '<DB_NAME>'})
client.setStateStore(stateStore);
// Set the crypto store
const crypto = Client.newCryptoSuite();
let cryptoKS = Client.newCryptoKeyStore(
CDBKVS,
{
url: 'https://<USERNAME>:<PASSWORD>@<URL>.cloudant.com',
name: '<DB_NAME>'
}
);
crypto.SetCryptoKeyStore(cryptoKS);
client.setCryptoSuite(crypto);
It is the DB USERNAME.
If you're using couchdb docker image.
Then that connection string will be:
Reference: https://hub.docker.com/_/couchdb