Skip to content

Commit 7206b85

Browse files
committed
feat(core-api): add consensus algorithms OpenAPI enum
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-cacti#359 Signed-off-by: Peter Somogyvari <[email protected]>
1 parent 57e52f4 commit 7206b85

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

packages/cactus-core-api/src/main/json/generated/openapi-spec.json

+9
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@
2727
],
2828
"components": {
2929
"schemas": {
30+
"ConsensusAlgorithmFamily": {
31+
"type": "string",
32+
"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.",
33+
"enum": [
34+
"org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY",
35+
"org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE",
36+
"org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK"
37+
]
38+
},
3039
"PrimaryKey": {
3140
"type": "string",
3241
"minLength": 1,

packages/cactus-core-api/src/main/typescript/generated/openapi/typescript-axios/api.ts

+11
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,17 @@ export interface CactusNodeMeta {
124124
*/
125125
publicKeyPem: string;
126126
}
127+
/**
128+
* 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.
129+
* @export
130+
* @enum {string}
131+
*/
132+
export enum ConsensusAlgorithmFamily {
133+
AUTHORITY = 'org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY',
134+
STAKE = 'org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE',
135+
WORK = 'org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK'
136+
}
137+
127138
/**
128139
*
129140
* @export

packages/cactus-core-api/src/main/typescript/openapi-spec.ts

+22
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,28 @@ export const CACTUS_OPEN_API_JSON: OpenAPIV3.Document = {
3535
],
3636
components: {
3737
schemas: {
38+
ConsensusAlgorithmFamily: {
39+
type: "string",
40+
description:
41+
"Enumerates a list of consensus algorithm families in " +
42+
"existence. Does not intend to be an exhaustive list, just a " +
43+
"practical one, meaning that we only include items here that are " +
44+
"relevant to Hyperledger Cactus in fulfilling its own duties. " +
45+
"This can be extended later as more sophisticated features " +
46+
"of Cactus get implemented. " +
47+
"This enum is meant to be first and foremest a useful abstraction " +
48+
"for achieving practical tasks, not an encyclopedia and therefore " +
49+
"we ask of everyone that this to be extended only in ways that " +
50+
"serve a practical purpose for the runtime behavior of Cactus or " +
51+
"Cactus plugins in general. The bottom line is that we can accept " +
52+
"this enum being not 100% accurate as long as it 100% satisfies " +
53+
"what it was designed to do.",
54+
enum: [
55+
"org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY",
56+
"org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE",
57+
"org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK",
58+
],
59+
},
3860
PrimaryKey: {
3961
type: "string",
4062
minLength: 1,

0 commit comments

Comments
 (0)