Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* @param {object} message The message object.
* @return {Promise} The initialized adapter instance.
* @async
*/
async function initHandler(context, message) {
const blockchain = new FabricClient(context.networkConfigPath, context.workspacePath);
// reload the profiles silently
await blockchain._initializeRegistrars(false);
await blockchain._initializeAdmins(false);
await blockchain._initializeUsers(false);
return blockchain;
}
const handlerContext = new MessageHandler({
init: initHandler
});
/**
* Message handler
*/
process.on('message', async (message) => {
await MessageHandler.handle(handlerContext, message);
});
const { MessageHandler } = require('@hyperledger/caliper-core');
const BurrowClient = require('./burrow');
/**
* Handles the init message. Constructs the Burrow adapter.
* @param {object} context The context of the message handler object.
* @param {object} message The message object.
* @return {Promise} The initialized adapter instance.
* @async
*/
async function initHandler(context, message) {
return new BurrowClient(context.networkConfigPath, context.workspacePath);
}
const handlerContext = new MessageHandler({
init: initHandler
});
/**
* Message handler
*/
process.on('message', async (message) => {
await MessageHandler.handle(handlerContext, message);
});
const { MessageHandler } = require('@hyperledger/caliper-core');
const SawtoothClient = require('./sawtooth');
/**
* Handles the init message. Constructs the Sawtooth adapter.
* @param {object} context The context of the message handler object.
* @param {object} message The message object.
* @return {Promise} The initialized adapter instance.
* @async
*/
async function initHandler(context, message) {
return new SawtoothClient(context.networkConfigPath, context.workspacePath);
}
const handlerContext = new MessageHandler({
init: initHandler
});
/**
* Message handler
*/
process.on('message', async (message) => {
await MessageHandler.handle(handlerContext, message);
});
const { MessageHandler } = require('@hyperledger/caliper-core');
const IrohaClient = require('./iroha');
/**
* Handles the init message. Constructs the Iroha adapter.
* @param {object} context The context of the message handler object.
* @param {object} message The message object.
* @return {Promise} The initialized adapter instance.
* @async
*/
async function initHandler(context, message) {
return new IrohaClient(context.networkConfigPath, context.workspacePath);
}
const handlerContext = new MessageHandler({
init: initHandler
});
/**
* Message handler
*/
process.on('message', async (message) => {
await MessageHandler.handle(handlerContext, message);
});
const { MessageHandler } = require('@hyperledger/caliper-core');
const EthereumClient = require('./ethereum');
/**
* Handles the init message. Constructs the Ethereum adapter.
* @param {object} context The context of the message handler object.
* @param {object} message The message object.
* @return {Promise} The initialized adapter instance.
* @async
*/
async function initHandler(context, message) {
return new EthereumClient(context.networkConfigPath, context.workspacePath);
}
const handlerContext = new MessageHandler({
init: initHandler
});
/**
* Message handler
*/
process.on('message', async (message) => {
await MessageHandler.handle(handlerContext, message);
});
const { MessageHandler } = require('@hyperledger/caliper-core');
const ComposerClient = require('./composer');
/**
* Handles the init message. Constructs the Composer adapter.
* @param {object} context The context of the message handler object.
* @param {object} message The message object.
* @return {Promise} The initialized adapter instance.
* @async
*/
async function initHandler(context, message) {
return new ComposerClient(context.networkConfigPath, context.workspacePath);
}
const handlerContext = new MessageHandler({
init: initHandler
});
/**
* Message handler
*/
process.on('message', async (message) => {
await MessageHandler.handle(handlerContext, message);
});
const { MessageHandler } = require('@hyperledger/caliper-core');
const FiscoBcosClient = require('./fiscoBcos');
/**
* Handles the init message. Constructs the FISCO-BCOS adapter.
* @param {object} context The context of the message handler object.
* @param {object} message The message object.
* @return {Promise} The initialized adapter instance.
* @async
*/
async function initHandler(context, message) {
return new FiscoBcosClient(context.networkConfigPath, context.workspacePath);
}
const handlerContext = new MessageHandler({
init: initHandler
});
/**
* Message handler
*/
process.on('message', async (message) => {
await MessageHandler.handle(handlerContext, message);
});