Skip to content

Commit

Permalink
feat(core-api): add consensus algorithms OpenAPI enum
Browse files Browse the repository at this point in the history
Enumerates a list of consensus algorithm families in
existence. Does not intend to be an exhaustive list, just a
practical one, meaning that we only include items here
that are relevant to Hyperledger Cactus in fulfilling its
own duties. This can be extended later as more
sophisticated features of Cactus get implemented. This
enum is meant to be first and foremest a useful
abstraction for achieving practical tasks, not an
encyclopedia and therefore we ask of everyone that this
to be extended only in ways that serve a practical
purpose for the runtime behavior of Cactus or Cactus
plugins in general. The bottom line is that we can accept
this enum being not 100% accurate as long as it 100%
satisfies what it was designed to do.

Fixes hyperledger#359

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
petermetz committed Jan 5, 2021
1 parent 57e52f4 commit 7206b85
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@
],
"components": {
"schemas": {
"ConsensusAlgorithmFamily": {
"type": "string",
"description": "Enumerates a list of consensus algorithm families in existence. Does not intend to be an exhaustive list, just a practical one, meaning that we only include items here that are relevant to Hyperledger Cactus in fulfilling its own duties. This can be extended later as more sophisticated features of Cactus get implemented. This enum is meant to be first and foremest a useful abstraction for achieving practical tasks, not an encyclopedia and therefore we ask of everyone that this to be extended only in ways that serve a practical purpose for the runtime behavior of Cactus or Cactus plugins in general. The bottom line is that we can accept this enum being not 100% accurate as long as it 100% satisfies what it was designed to do.",
"enum": [
"org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY",
"org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE",
"org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK"
]
},
"PrimaryKey": {
"type": "string",
"minLength": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,17 @@ export interface CactusNodeMeta {
*/
publicKeyPem: string;
}
/**
* Enumerates a list of consensus algorithm families in existence. Does not intend to be an exhaustive list, just a practical one, meaning that we only include items here that are relevant to Hyperledger Cactus in fulfilling its own duties. This can be extended later as more sophisticated features of Cactus get implemented. This enum is meant to be first and foremest a useful abstraction for achieving practical tasks, not an encyclopedia and therefore we ask of everyone that this to be extended only in ways that serve a practical purpose for the runtime behavior of Cactus or Cactus plugins in general. The bottom line is that we can accept this enum being not 100% accurate as long as it 100% satisfies what it was designed to do.
* @export
* @enum {string}
*/
export enum ConsensusAlgorithmFamily {
AUTHORITY = 'org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY',
STAKE = 'org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE',
WORK = 'org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK'
}

/**
*
* @export
Expand Down
22 changes: 22 additions & 0 deletions packages/cactus-core-api/src/main/typescript/openapi-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,28 @@ export const CACTUS_OPEN_API_JSON: OpenAPIV3.Document = {
],
components: {
schemas: {
ConsensusAlgorithmFamily: {
type: "string",
description:
"Enumerates a list of consensus algorithm families in " +
"existence. Does not intend to be an exhaustive list, just a " +
"practical one, meaning that we only include items here that are " +
"relevant to Hyperledger Cactus in fulfilling its own duties. " +
"This can be extended later as more sophisticated features " +
"of Cactus get implemented. " +
"This enum is meant to be first and foremest a useful abstraction " +
"for achieving practical tasks, not an encyclopedia and therefore " +
"we ask of everyone that this to be extended only in ways that " +
"serve a practical purpose for the runtime behavior of Cactus or " +
"Cactus plugins in general. The bottom line is that we can accept " +
"this enum being not 100% accurate as long as it 100% satisfies " +
"what it was designed to do.",
enum: [
"org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY",
"org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE",
"org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK",
],
},
PrimaryKey: {
type: "string",
minLength: 1,
Expand Down

0 comments on commit 7206b85

Please sign in to comment.