Skip to content

Commit

Permalink
feat(core-api): common consortium interface
Browse files Browse the repository at this point in the history
Signed-off-by: jordigiam <[email protected]>
  • Loading branch information
jordigiam authored and petermetz committed Mar 9, 2021
1 parent e8302a1 commit aa070ad
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { ICactusPlugin } from "../i-cactus-plugin";

/**
* Common interface to be implemented by plugins which are implementing the connection to ledgers.
*/
export interface IPluginConsortium<
GetNodeJwsIn,
GetNodeJwsOut,
GetConsortiumJwsIn,
GetConsortiumJwsOut
> extends ICactusPlugin {
/**
* Returns the JSON Web Signature of the consortium metadata, as issued by the
* **current node** that the request has been issued to.
* @param req The parameters of the request, if any.
*/
getNodeJws(req?: GetNodeJwsIn): Promise<GetNodeJwsOut>;

/**
* Returns the JSON Web Signature of the consortium metadata, as issued by
* **all the nodes in the consortium** that are known to be in the consortium
* by this current node that the request has been issued to.
*
* @param req The parameters of the request, if any.
*/
getConsortiumJws(req?: GetConsortiumJwsIn): Promise<GetConsortiumJwsOut>;
}
1 change: 1 addition & 0 deletions packages/cactus-core-api/src/main/typescript/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export * from "./generated/openapi/typescript-axios/index";
export * from "./generated/openapi/typescript-axios/base";

export { IPluginLedgerConnector } from "./plugin/ledger-connector/i-plugin-ledger-connector";
export { IPluginConsortium } from "./plugin/consortium/i-plugin-consortium";
export { IPluginKeychain } from "./plugin/keychain/i-plugin-keychain";
export { IExpressRequestHandler } from "./plugin/web-service/i-express-request-handler";

Expand Down

0 comments on commit aa070ad

Please sign in to comment.