From 537b0bec4dda58ff95967ae190f20841577efa1c Mon Sep 17 00:00:00 2001 From: david Date: Mon, 6 May 2024 05:00:54 +0800 Subject: [PATCH] [WIP] diagnose.js --- app/chaincodeOperator.js | 18 +- app/helper.js | 17 +- cc/golang/contracts.js | 9 +- cc/golang/{diagnose/invoke.js => diagnose.js} | 83 ++++++--- cc/golang/diagnose/diagnoseInvoke.js | 162 ------------------ cc/golang/diagnose/install.js | 116 ------------- cc/golang/external/install.js | 8 +- cc/node/diagnose/install.js | 4 +- cc/node/stress/install.js | 4 +- cc/testutil.js | 6 +- common | 2 +- config/configtx.yaml | 18 +- package.json | 3 +- 13 files changed, 105 insertions(+), 345 deletions(-) rename cc/golang/{diagnose/invoke.js => diagnose.js} (76%) delete mode 100644 cc/golang/diagnose/diagnoseInvoke.js delete mode 100644 cc/golang/diagnose/install.js diff --git a/app/chaincodeOperator.js b/app/chaincodeOperator.js index d27e7df..3a09db9 100644 --- a/app/chaincodeOperator.js +++ b/app/chaincodeOperator.js @@ -1,7 +1,7 @@ import assert from 'assert'; import {consoleLogger} from '@davidkhala/logger/log4.js'; import {install, getEndorsePolicy, getCollectionConfig} from './chaincodeHelper.js'; -import ChaincodeAction from '../common/nodejs/chaincodeOperation.js'; +import ChaincodeLifecycleOperation from '../common/nodejs/chaincodeOperation.js'; import {parsePackageID} from '../common/nodejs/formatter/chaincode.js'; import * as helper from './helper.js'; import QueryHub from '../common/nodejs/query.js'; @@ -22,9 +22,13 @@ export class ChaincodeDefinitionOperator { constructor(channelName, admin, peers, init_required) { const channel = helper.prepareChannel(channelName); this.waitForConsensus = 1000; - const chaincodeAction = new ChaincodeAction(peers, admin, channel, logger); + this.init_required = init_required; + this.chaincodeAction = new ChaincodeLifecycleOperation(peers, admin, channel, logger); this.forceUpgrade = true; - Object.assign(this, {chaincodeAction, peers, admin, channel, channelName}); + this.peers = peers; + this.admin = admin; + this.channel = channel; + this.channelName = channelName; } @@ -44,7 +48,7 @@ export class ChaincodeDefinitionOperator { } async approves({sequence, package_id}, orderer, gate) { - const {waitForConsensus, chaincodeAction} = this; + const {waitForConsensus, chaincodeAction, init_required} = this; await orderer.connect(); @@ -58,7 +62,7 @@ export class ChaincodeDefinitionOperator { chaincodeAction.setEndorsementPolicy(endorsementPolicy); chaincodeAction.setCollectionsConfig(getCollectionConfig(name)); try { - await chaincodeAction.approve({name, package_id, sequence}, orderer, waitForConsensus); + await chaincodeAction.approve({name, package_id, sequence, init_required}, orderer, waitForConsensus); } finally { orderer.disconnect(); } @@ -72,14 +76,14 @@ export class ChaincodeDefinitionOperator { * @param [gate] */ async commitChaincodeDefinition({sequence, name}, orderer, gate) { - const {chaincodeAction} = this; + const {chaincodeAction, init_required} = this; await orderer.connect(); const endorsementPolicy = {gate}; Object.assign(endorsementPolicy, getEndorsePolicy(name)); chaincodeAction.setEndorsementPolicy(endorsementPolicy); chaincodeAction.setCollectionsConfig(getCollectionConfig(name)); try { - await chaincodeAction.commitChaincodeDefinition({name, sequence}, orderer); + await chaincodeAction.commitChaincodeDefinition({name, sequence, init_required}, orderer); } finally { orderer.disconnect(); } diff --git a/app/helper.js b/app/helper.js index f00a4d1..dc422f1 100755 --- a/app/helper.js +++ b/app/helper.js @@ -11,7 +11,7 @@ import {randomKeyOf} from '@davidkhala/light/random.js'; import {getClientKeyPairPath} from '../config/caCryptoGen.js'; import {importFrom, filedirname} from '@davidkhala/light/es6.mjs'; -const globalConfig = importFrom(import.meta, '../config/orgs.json', ); +const globalConfig = importFrom(import.meta, '../config/orgs.json',); const logger = consoleLogger('Helper'); const orgsConfig = globalConfig.organizations; const channelsConfig = globalConfig.channels; @@ -22,20 +22,22 @@ export const projectResolve = (...args) => path.resolve(projectRoot, ...args); const CRYPTO_CONFIG_DIR = homeResolve(globalConfig.docker.volumes.MSPROOT); -export function orgNamesOfChannel(channelName){ - return Object.keys(globalConfig.channels[channelName].organizations) +export function orgNamesOfChannel(channelName) { + return Object.keys(globalConfig.channels[channelName].organizations); } + const preparePeer = (orgName, peerIndex, peerConfig) => { const {port: peerPort} = peerConfig; let peer; + const logger = consoleLogger('peer'); const cryptoPath = new CryptoPath(CRYPTO_CONFIG_DIR, {peer: {name: `peer${peerIndex}`, org: orgName}}); if (globalConfig.TLS) { const {caCert} = cryptoPath.TLSFile('peer'); - peer = new Peer({host: 'localhost', peerPort, cert: caCert}); + peer = new Peer({host: 'localhost', peerPort, cert: caCert}, logger); } else { - peer = new Peer({peerPort}); + peer = new Peer({peerPort}, logger); } return peer; @@ -51,6 +53,7 @@ export const newOrderer = (name, org, ordererSingleConfig) => { } }); let ordererWrapper; + const logger = consoleLogger('orderer'); if (globalConfig.TLS) { const {caCert} = cryptoPath.TLSFile(nodeType); const {clientKey, clientCert} = getClientKeyPairPath(cryptoPath, nodeType); @@ -60,9 +63,9 @@ export const newOrderer = (name, org, ordererSingleConfig) => { tlsCaCert: caCert, clientKey, clientCert, - }); + }, undefined, logger); } else { - ordererWrapper = new Orderer({ordererPort}); + ordererWrapper = new Orderer({ordererPort}, undefined, logger); } ordererWrapper.adminAddress = `localhost:${portAdmin}`; return ordererWrapper; diff --git a/cc/golang/contracts.js b/cc/golang/contracts.js index d22af18..e6c2241 100644 --- a/cc/golang/contracts.js +++ b/cc/golang/contracts.js @@ -3,7 +3,7 @@ import * as helper from '../../app/helper.js'; import FabricGateway from '../../common/nodejs/fabric-gateway/index.js'; import {consoleLogger} from '@davidkhala/logger/log4.js'; import UserBuilder from '../../common/nodejs/admin/user.js'; -import {dev, installAndApprove, commit} from '../testutil.js'; +import {dev, installAndApprove, commit, getContract} from '../testutil.js'; const chaincodeID = 'contracts'; const logger = consoleLogger(`chaincode:${chaincodeID}`); @@ -34,12 +34,7 @@ describe('deploy', function () { }); describe('invoke', function () { this.timeout(0); - const peer = helper.newPeer(0, 'astri.org'); - const org = 'icdd'; - const user = new UserBuilder(undefined, helper.getOrgAdmin(org)); - - const gateway = new FabricGateway(peer, user); - const contract = gateway.getContract(channel, chaincodeID); + const contract = getContract(chaincodeID); it('touch', async () => { contract.subContract = 'StupidContract'; diff --git a/cc/golang/diagnose/invoke.js b/cc/golang/diagnose.js similarity index 76% rename from cc/golang/diagnose/invoke.js rename to cc/golang/diagnose.js index dd5cdeb..f939ed2 100644 --- a/cc/golang/diagnose/invoke.js +++ b/cc/golang/diagnose.js @@ -1,50 +1,85 @@ +import {commit, dev, getContract, installAndApprove} from '../testutil.js'; +import {consoleLogger} from '@davidkhala/logger/log4.js'; +import * as helper from '../../app/helper.js'; +import {ChaincodeDefinitionOperator} from '../../app/chaincodeOperator.js'; import assert from 'assert'; import {base64} from '@davidkhala/light/format.js'; -import {consoleLogger} from '@davidkhala/logger/log4.js'; -import { - DiagnoseInvoke -} from './diagnoseInvoke.js'; +import {TxValidationCode} from '../../common/nodejs/formatter/constants.js'; +import {getResponses} from '../../common/nodejs/formatter/proposalResponse.js'; -const channelName = 'allchannel'; -const clientOrg = 'icdd'; -const peer = helper.newPeer(0, 'icdd'); -const diagnose = new DiagnoseInvoke(channelName, clientOrg, peer); -import {getResponses} from '../../../common/nodejs/formatter/proposalResponse.js'; -import {TxValidationCode} from '../../../common/nodejs/formatter/constants.js'; -import * as helper from '../../../app/helper.js'; +const logger = consoleLogger('chaincode:diagnose'); +const chaincodeID = 'diagnose'; +describe(`${chaincodeID} : green path`, function () { + this.timeout(0); + const orderers = helper.newOrderers(); + const orderer = orderers[0]; + it('validate', async () => { + const orgs = ['icdd', 'astri.org']; + for (const org of orgs) { + await dev(org, chaincodeID); + } + }); + it('install & approve', async () => { + const orgs = ['icdd', 'astri.org']; + for (const org of orgs) { + await installAndApprove(org, chaincodeID, orderer, true); + } + }); + it('commit', async () => { + const org = 'icdd'; + await commit(org, chaincodeID, orderer, true); + }); +}); + +describe('variant', async function () { + this.timeout(0); + + // TODO const gate = `AND('icddMSP.member')`; + it('init', async () => { + const org = 'icdd'; + const channel = 'allchannel'; + const peers = helper.allPeers(); + const admin = helper.getOrgAdmin(org); + const operator = new ChaincodeDefinitionOperator(channel, admin, peers); + await operator.connect(); + await operator.init(chaincodeID); + + operator.disconnect(); + }); +}); -const logger = consoleLogger('chaincode:diagnose'); -const org1 = 'icdd'; -const org2 = 'astri.org'; describe('chaincode query', () => { + const contract = getContract(chaincodeID); it('whom am i ', async () => { - const queryResult = await diagnose.whoami(); + const queryResult = await contract.evaluate(['whoami']); logger.info(queryResult); + const {MspID, Attrs, CertificatePem} = JSON.parse(queryResult); + assert.equal(MspID, 'icddMSP'); }); it('getCertID', async () => { - const result = await diagnose.getCertID(); - logger.info('certID', result); + const queryResult = await contract.evaluate(['getCertID']); + assert.equal(queryResult, 'x509::CN=Admin,OU=client::CN=fabric-ca-server,OU=Fabric,O=Hyperledger,ST=North Carolina,C=US'); }); it('peerMSPID', async () => { - const result = await diagnose.peerMSPID(); - logger.info(result); + const result = await contract.evaluate(['peerMSPID']); + assert.equal(result, 'icddMSP'); }); it('chaincode ping (google.com)', async () => { - const result = await diagnose.chaincodePing(); - logger.info(result); + const result = await contract.evaluate(['external']); + assert.equal(result, '200 OK'); }); }); describe('chaincode invoke', function () { this.timeout(0); + const contract = getContract(chaincodeID); it('put & get raw value', async () => { const value = Date.now().toString(); const key = 'a'; - await diagnose.putRaw(key, value); - const queryResult = await diagnose.getRaw(key); - logger.info(queryResult); + await contract.submit(['putRaw', key, value]); + const queryResult = await contract.evaluate(['getRaw', key]); assert.strictEqual(queryResult, value); }); diff --git a/cc/golang/diagnose/diagnoseInvoke.js b/cc/golang/diagnose/diagnoseInvoke.js deleted file mode 100644 index 7ae4557..0000000 --- a/cc/golang/diagnose/diagnoseInvoke.js +++ /dev/null @@ -1,162 +0,0 @@ -import {base64} from '@davidkhala/light/format.js'; -import {queryBuilder} from '../../../common/nodejs/couchdb.js'; -import * as helper from '../../../app/helper.js'; -import InvokeHelper from '../../../app/invokeHelper.js'; - -const chaincodeId = 'diagnose'; - -export class DiagnoseInvoke { - /** - * - * @param channelName - * @param clientOrg - * @param peer - */ - constructor(channelName = 'allchannel', clientOrg = 'icdd', peer = helper.newPeer(1, clientOrg)) { - this.helper = new InvokeHelper(peer, clientOrg, chaincodeId, channelName); - } - - async query(args, transientMap) { - return this.helper.query({args, transientMap}); - } - - async invoke(args, transientMap) { - return this.helper.invoke({args, transientMap}, true); - } - - async panic() { - return this.query(['panic']); - } - - async list() { - return this.query(['worldStates']); - } - - async put(key, value) { - return this.invoke(['put', key, JSON.stringify(value)]); - } - - async putRaw(key, value) { - return this.invoke(['putRaw', key, value]); - } - - async getRaw(key) { - return this.query(['getRaw', key]); - } - - async get(key) { - return this.query(['get', key]); - } - - async whoami() { - const queryResult = await this.query(['whoami']); - const {MspID, CertificatePem} = JSON.parse(queryResult); - return {MspID, CertificatePem: base64.decode(CertificatePem)}; - }; - - async history(key) { - const result = await this.query(['history', key]); - return JSON.parse(result).map(modification => { - const converted = Object.assign({}, modification); - converted.Value = base64.decode(modification.Value); - return converted; - }); - } - - async cross(targetChaincode, fcn, args) { - - return this.invoke( - ['delegate', JSON.stringify({ - ChaincodeName: targetChaincode, - Fcn: fcn, - Args: Array.isArray(args) ? args : [], - Channel: '' - })] - ); - } - - async richQuery() { - const args = ['richQuery', queryBuilder(undefined, ['Time'], 1)]; - return this.query(args); - } - - async putEndorsement(peers, orderer, key, mspids) { - - const tx = this.helper.classicTransaction(peers); - for (const peer of peers) { - await peer.connect(); - } - let result; - if (mspids) { - result = await tx.submit({ - fcn: 'putEndorsement', - args: [key, ...mspids] - }, orderer); - - } else { - result = await tx.submit({ - fcn: 'deleteEndorsement', - args: [key] - }, orderer); - } - for (const peer of peers) { - await peer.disconnect(); - } - return result; - } - - async getEndorsement(key) { - return this.query(['getEndorsement', key]); - } - - async getPage(startKey = '', endKey = '', pageSize = '1', bookMark = '') { - const args = ['listPage', startKey, endKey, pageSize.toString(), bookMark]; - return this.query(args); - } - - async putBatch(map) { - const args = ['putBatch', JSON.stringify(map)]; - return this.invoke(args); - } - - async chaincodeID() { - return this.query(['chaincodeId']); - } - - async peerMSPID() { - return this.query(['peerMSPID']); - } - - async chaincodePing() { - return this.query(['external']); - } - - async getCertID() { - return this.query(['getCertID']); - } - - async getPrivate(transientMap) { - return this.query(['getPrivate'], transientMap); - } - - async putPrivate(transientMap) { - return this.invoke(['putPrivate'], transientMap); - } - - // TODO do hack and see behavior - async putImplicit(transientMap, mspid) { - const args = ['putImplicit']; - if (mspid) { - args.push(mspid); - } - return this.invoke(args, transientMap); - }; - - async getImplicit(transientMap, mspid) { - const args = ['getImplicit']; - if (mspid) { - args.push(mspid); - } - return this.query(args, transientMap); - } -} diff --git a/cc/golang/diagnose/install.js b/cc/golang/diagnose/install.js deleted file mode 100644 index f53a3eb..0000000 --- a/cc/golang/diagnose/install.js +++ /dev/null @@ -1,116 +0,0 @@ -import * as helper from '../../../app/helper.js'; -import {ChaincodeDefinitionOperator, installAll, installs} from '../../../app/installHelper.js'; -import {consoleLogger} from '@davidkhala/logger/log4.js'; -import {allPeers} from '../../../app/helper.js'; - -const logger = consoleLogger('chaincode:diagnose'); -const chaincodeID = 'diagnose'; - - -const orderers = helper.newOrderers(); -const orderer = orderers[0]; -const gate = `AND('icddMSP.member')`; -const init_required = true; -const {channel = 'allchannel'} = process.env; - -describe(`${chaincodeID} default: green path`, function () { - this.timeout(0); - it('install', async () => { - await installAll(chaincodeID); - }); - - it('query installed', async () => { - const orgs = ['icdd', 'astri.org']; - for (const org of orgs) { - const admin = helper.getOrgAdmin(org); - const peers = helper.newPeers([0, 1], org); - const operator = new ChaincodeDefinitionOperator(channel, admin, peers, init_required); - await operator.connect(); - - await operator.queryInstalledAndApprove(chaincodeID, 1, orderer); - - - await operator.disconnect(); - } - - }); -}); -describe(`commit ${chaincodeID}`, function () { - - this.timeout(0); - const queryCommitReadiness = async (sequence, _gate) => { - for (const org of ['icdd']) { - const peers = helper.newPeers([0, 1], org); - const admin = helper.getOrgAdmin(org); - const operator = new ChaincodeDefinitionOperator(channel, admin, peers, init_required); - await operator.connect(); - const readyState = await operator.checkCommitReadiness({name: chaincodeID, sequence}, _gate); - logger.info(org, readyState); - } - }; - - it(`query commit Readiness: with gate ${gate}`, async () => { - await queryCommitReadiness(1, gate); - }); - - const commit = async (_chaincodeID, sequence, _gate) => { - const org = 'icdd'; - const peers = allPeers(); - const admin = helper.getOrgAdmin(org); - const operator = new ChaincodeDefinitionOperator(channel, admin, peers, init_required); - await operator.connect(); - - await operator.commitChaincodeDefinition({name: _chaincodeID, sequence}, orderer, _gate); - - }; - - it(`commit: with gate ${gate}`, async () => { - await commit(chaincodeID, 1, gate); - }); - - - it('query definition', async () => { - const org = 'icdd'; - const peers = [helper.newPeer(0, 'icdd')]; - const admin = helper.getOrgAdmin(org); - const operator = new ChaincodeDefinitionOperator(channel, admin, peers, init_required); - await operator.connect(); - const r1 = await operator.queryDefinition(chaincodeID); - logger.debug(r1); - logger.debug(r1[0].collections.config[0].static_collection_config); - logger.debug(r1[0].collections.config[0].static_collection_config.endorsement_policy); - const r2 = await operator.queryDefinition(chaincodeID); - operator.disconnect(); - }); - - -}); - -describe('legacy chaincode Initialize', async function () { - this.timeout(0); - it('init', async () => { - const org = 'icdd'; - const peers = helper.newPeers([0, 1], org); - const admin = helper.getOrgAdmin(org); - const operator = new ChaincodeDefinitionOperator(channel, admin, peers); - await operator.connect(); - await operator.init(chaincodeID); - operator.disconnect(); - }); -}); - -describe('upgrade:install, query,approve and commit ', function () { - this.timeout(0); - it('query installed & approve: with gate', async () => { - const sequence = 2; - const org = 'icdd'; - const admin = helper.getOrgAdmin(org); - const peers = helper.newPeers([0, 1], org); - const operator = new ChaincodeDefinitionOperator(channel, admin, peers, init_required); - await operator.connect(); - - await operator.queryInstalledAndApprove(chaincodeID, sequence, orderer, gate); - - - }); -}); \ No newline at end of file diff --git a/cc/golang/external/install.js b/cc/golang/external/install.js index 82873f2..ef88fbe 100644 --- a/cc/golang/external/install.js +++ b/cc/golang/external/install.js @@ -1,5 +1,5 @@ import * as helper from '../../../app/helper.js'; -import {ChaincodeDefinitionOperator} from '../../../app/installHelper.js'; +import {ChaincodeDefinitionOperator} from '../../../app/chaincodeOperator.js'; import {prepareInstall} from '../../../app/chaincodeHelper.js'; import {consoleLogger} from '@davidkhala/logger/log4.js'; import ChaincodeAction from '../../../common/nodejs/chaincodeOperation.js'; @@ -38,7 +38,7 @@ describe(`install and approve ${chaincodeID}`, function () { const peers = helper.newPeers([0], org); const operator = new ChaincodeDefinitionOperator(channel, admin, peers, init_required); await operator.connect(); - await operator.queryInstalledAndApprove(chaincodeID, sequence, orderer, gate); + await operator.queryInstalledAndApprove(chaincodeID, orderer, undefined, gate); console.debug(`done for org ${org}`); await operator.disconnect(); @@ -82,11 +82,11 @@ describe(`commit ${chaincodeID}`, function () { const admin = helper.getOrgAdmin(org); const operator = new ChaincodeDefinitionOperator(channel, admin, peers, init_required); await operator.connect(); - const r1 = await operator.queryDefinition('icdd', [0], chaincodeID); + const r1 = await operator.queryDefinition(chaincodeID); logger.debug(r1); logger.debug(r1[0].collections.config[0].static_collection_config); logger.debug(r1[0].collections.config[0].static_collection_config.endorsement_policy); - const r2 = await operator.queryDefinition('icdd', [0], chaincodeID); + const r2 = await operator.queryDefinition(chaincodeID); operator.disconnect(); }); diff --git a/cc/node/diagnose/install.js b/cc/node/diagnose/install.js index 1eea701..4b3822d 100644 --- a/cc/node/diagnose/install.js +++ b/cc/node/diagnose/install.js @@ -1,4 +1,4 @@ -import {installAll, ChaincodeDefinitionOperator} from '../../../app/installHelper.js'; +import {installAll, ChaincodeDefinitionOperator} from '../../../app/chaincodeOperator.js'; import * as helper from '../../../app/helper.js'; import {consoleLogger} from '@davidkhala/logger/log4.js'; @@ -31,7 +31,7 @@ describe('approve', function () { const peers = helper.newPeers([0, 1], org); const operator = new ChaincodeDefinitionOperator('allchannel', admin, peers, init_required); await operator.connect(); - await operator.queryInstalledAndApprove(chaincodeId, sequence, orderer); + await operator.queryInstalledAndApprove(chaincodeId, orderer); } }); diff --git a/cc/node/stress/install.js b/cc/node/stress/install.js index 2b78f83..3c30855 100644 --- a/cc/node/stress/install.js +++ b/cc/node/stress/install.js @@ -1,4 +1,4 @@ -import {installAll, ChaincodeDefinitionOperator} from '../../../app/installHelper.js'; +import {installAll, ChaincodeDefinitionOperator} from '../../../app/chaincodeOperator.js'; import * as helper from '../../../app/helper.js'; import {consoleLogger} from '@davidkhala/logger/log4.js'; @@ -26,7 +26,7 @@ describe('approve', () => { const admin = helper.getOrgAdmin(org); const peers = helper.newPeers([0, 1], org); const operator = new ChaincodeDefinitionOperator('allchannel', admin, peers, init_required); - await operator.queryInstalledAndApprove(chaincodeId, sequence, orderer); + await operator.queryInstalledAndApprove(chaincodeId, orderer); } }); diff --git a/cc/testutil.js b/cc/testutil.js index f81bc2d..46fbf0b 100644 --- a/cc/testutil.js +++ b/cc/testutil.js @@ -15,7 +15,7 @@ export async function dev(org, chaincodeID, init_required = false) { const [installed, uncommitted, committed] = await operator.queryInstalled(chaincodeID); const definitions = await operator.queryDefinition(chaincodeID); logger.debug({installed, uncommitted, committed, definitions}); - await operator.disconnect(); + operator.disconnect(); } export async function installAndApprove(org, chaincodeId, orderer, init_required = false) { @@ -26,7 +26,7 @@ export async function installAndApprove(org, chaincodeId, orderer, init_required await operator.connect(); const package_id = await operator.install(chaincodeId); await operator.queryInstalledAndApprove(chaincodeId, orderer, package_id); - await operator.disconnect(); + operator.disconnect(); } export async function commit(org, chaincodeID, orderer, init_required = false) { @@ -35,7 +35,7 @@ export async function commit(org, chaincodeID, orderer, init_required = false) { const operator = new ChaincodeDefinitionOperator(channel, admin, peers, init_required); await operator.connect(); await operator.queryAndCommit(chaincodeID, orderer); - await operator.disconnect(); + operator.disconnect(); } export function getContract(chaincodeID) { diff --git a/common b/common index 53f847b..e4241e8 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 53f847be4c13f0d2fde45409d78175ae8aed90c5 +Subproject commit e4241e88462bf973fdd56a9bd0a740cd50f2d152 diff --git a/config/configtx.yaml b/config/configtx.yaml index ad35601..869b4d9 100644 --- a/config/configtx.yaml +++ b/config/configtx.yaml @@ -35,7 +35,7 @@ Profiles: Organizations: - Name: hyperledger ID: hyperledgerMSP - MSPDir: /home/ubuntu/delphi-fabric/config/ca-crypto-config/ordererOrganizations/hyperledger/msp + MSPDir: /home/david/delphi-fabric/config/ca-crypto-config/ordererOrganizations/hyperledger/msp Policies: Readers: Type: Signature @@ -53,16 +53,16 @@ Profiles: Consenters: - Host: orderer0.hyperledger Port: 7050 - ClientTLSCert: /home/ubuntu/delphi-fabric/config/ca-crypto-config/ordererOrganizations/hyperledger/orderers/orderer0.hyperledger/tls/server.crt - ServerTLSCert: /home/ubuntu/delphi-fabric/config/ca-crypto-config/ordererOrganizations/hyperledger/orderers/orderer0.hyperledger/tls/server.crt + ClientTLSCert: /home/david/delphi-fabric/config/ca-crypto-config/ordererOrganizations/hyperledger/orderers/orderer0.hyperledger/tls/server.crt + ServerTLSCert: /home/david/delphi-fabric/config/ca-crypto-config/ordererOrganizations/hyperledger/orderers/orderer0.hyperledger/tls/server.crt - Host: orderer1.hyperledger Port: 7050 - ClientTLSCert: /home/ubuntu/delphi-fabric/config/ca-crypto-config/ordererOrganizations/hyperledger/orderers/orderer1.hyperledger/tls/server.crt - ServerTLSCert: /home/ubuntu/delphi-fabric/config/ca-crypto-config/ordererOrganizations/hyperledger/orderers/orderer1.hyperledger/tls/server.crt + ClientTLSCert: /home/david/delphi-fabric/config/ca-crypto-config/ordererOrganizations/hyperledger/orderers/orderer1.hyperledger/tls/server.crt + ServerTLSCert: /home/david/delphi-fabric/config/ca-crypto-config/ordererOrganizations/hyperledger/orderers/orderer1.hyperledger/tls/server.crt - Host: orderer2.hyperledger Port: 7050 - ClientTLSCert: /home/ubuntu/delphi-fabric/config/ca-crypto-config/ordererOrganizations/hyperledger/orderers/orderer2.hyperledger/tls/server.crt - ServerTLSCert: /home/ubuntu/delphi-fabric/config/ca-crypto-config/ordererOrganizations/hyperledger/orderers/orderer2.hyperledger/tls/server.crt + ClientTLSCert: /home/david/delphi-fabric/config/ca-crypto-config/ordererOrganizations/hyperledger/orderers/orderer2.hyperledger/tls/server.crt + ServerTLSCert: /home/david/delphi-fabric/config/ca-crypto-config/ordererOrganizations/hyperledger/orderers/orderer2.hyperledger/tls/server.crt Application: Policies: LifecycleEndorsement: @@ -77,7 +77,7 @@ Profiles: Organizations: - Name: astri.org ID: astriMSP - MSPDir: /home/ubuntu/delphi-fabric/config/ca-crypto-config/peerOrganizations/astri.org/msp + MSPDir: /home/david/delphi-fabric/config/ca-crypto-config/peerOrganizations/astri.org/msp Policies: Readers: Type: Signature @@ -93,7 +93,7 @@ Profiles: Rule: OR('astriMSP.member') - Name: icdd ID: icddMSP - MSPDir: /home/ubuntu/delphi-fabric/config/ca-crypto-config/peerOrganizations/icdd/msp + MSPDir: /home/david/delphi-fabric/config/ca-crypto-config/peerOrganizations/icdd/msp Policies: Readers: Type: Signature diff --git a/package.json b/package.json index b6ed6c7..b5dd982 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,8 @@ "@davidkhala/container": "latest", "@davidkhala/light": "latest", "@davidkhala/nodeutils": "latest", - "@davidkhala/axios": "latest" + "@davidkhala/axios": "latest", + "@hyperledger-twgc/fabric-formatter": "^0.0.0-dev.11" }, "devDependencies": { "@davidkhala/logger": "latest",