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 #359

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
petermetz committed Dec 4, 2020
1 parent 509ed53 commit 576d690
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 576d690

Please sign in to comment.