caliper icon indicating copy to clipboard operation
caliper copied to clipboard

Add support to use discovery in the 1.4 non gateway fabric connector

Open davidkel opened this issue 3 years ago • 1 comments

Please share the technical limitation of Caliper that you encountered.

Currently you have to use a static connection profile with the 1.4 non gateway fabric connector. Ideally we want all the connectors to support and encourage the use of discovery

Please detail your feature idea that could alleviate the limitation.

We need to add some parameters to the channel.initialize call in FabricNonGateway to use discovery. Shouldn't be too much of a change.

const initOptions = {
	discover: discovery_enabled
};
if (typeof discovery.asLocalhost !== 'undefined') {
	initOptions.asLocalhost = discovery_asLocalhost;
}

await this.channel.initialize(initOptions);

However if discovery is enabled then what do we do about peer and orderer selection done by the connector ? we should let the sdk decide because the point of using discovery is to allow it to ensure the endorsement policy is satisfied and to choose an appropriate orderer. Trying to keep the same logic for when a static connection profile is used is actually going to be more work as we need to extract the peers and orderers in order to select them explicitly.

The code will need to provide peer targets and an orderer only if discovery is not used, the workload would still be able to do peer and orderer targeting (I hope, although orderer targeting is of no real value and should never be used)

Please share some details about your use case if possible, and how the new feature would make Caliper a better performance benchmarking framework.

No response

Please share any suggestions about the new feature's code/configuration API (using formatted YAML segments or pseudo-code).

No response

davidkel avatar Feb 21 '22 15:02 davidkel