-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gateway): CIP15/36 Registration and staked ADA DB schemas Done b…
…ut untested.
- Loading branch information
Showing
8 changed files
with
498 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,8 @@ | |
"sshuser", | ||
"cexplorer", | ||
"Cardano", | ||
"jormungandr" | ||
"jormungandr", | ||
"dbsync" | ||
] | ||
} | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
catalyst-gateway/event-db/json_schemas/config/registration.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$comment": "Custom URI schema: catalyst_schema://<uuid>/<group>/<name>", | ||
"$id": "catalyst_schema://62d614c0-97a7-41ec-a976-91294b8f4384/config/loadtest", | ||
"title": "Registration Configuration", | ||
"description": "Registration configuration", | ||
"type": "object", | ||
"properties": { | ||
"common": { | ||
"$comment": "This provides the base settings for all networks. Anything thats common to all networks should be defined here.", | ||
"$ref": "#/definitions/registration" | ||
}, | ||
"networks": { | ||
"$comment": "Individual networks defined here. Only need to define settings which differ from the common settings. Must define at least 1 network.", | ||
"type": "object", | ||
"properties": { | ||
"mainnet": { | ||
"$ref": "#/definitions/registration" | ||
}, | ||
"preprod": { | ||
"$ref": "#/definitions/registration" | ||
}, | ||
"preview": { | ||
"$ref": "#/definitions/registration" | ||
}, | ||
"local": { | ||
"$ref": "#/definitions/registration" | ||
} | ||
}, | ||
"anyOf": [ | ||
{ | ||
"required": [ | ||
"mainnet" | ||
] | ||
}, | ||
{ | ||
"required": [ | ||
"preprod" | ||
] | ||
}, | ||
{ | ||
"required": [ | ||
"preview" | ||
] | ||
}, | ||
{ | ||
"required": [ | ||
"local" | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
"required": [ | ||
"common", | ||
"networks" | ||
], | ||
"additionalProperties": false, | ||
"definitions": { | ||
"registration": { | ||
"$comment": "Registration Configuration", | ||
"type": "object", | ||
"properties": { | ||
"loadtest": { | ||
"type": "boolean", | ||
"description": "Do we create LoadTest registrations when we import registrations for this network?", | ||
"example": true, | ||
"default": false | ||
}, | ||
"rollback_window": { | ||
"type": "integer", | ||
"description": "How many hours do we check for potential rollbacks when importing registrations for the network? Default is 7 Days, or 1 full clear Epoch.", | ||
"example": 48, | ||
"default": 168 | ||
}, | ||
"metadata_retention": { | ||
"type": "integer", | ||
"description": "How many days do we keep metadata for registrations in the database? Default is 6 months. 0 = Forever.", | ||
"example": 30, | ||
"default": 180 | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
119 changes: 119 additions & 0 deletions
119
catalyst-gateway/event-db/json_schemas/registration/cip36_stats.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$comment": "Custom URI schema: catalyst_schema://<uuid>/<group>/<name>", | ||
"$id": "catalyst_schema://fd5a2f8f-afb4-4cf7-ae6b-b7a370c85c82/registration/cip36_stats", | ||
"title": "Individual Registration Statistics", | ||
"description": "Statistical data associated with an individual CIP15/36 registration.", | ||
"type": "object", | ||
"properties": { | ||
"loadtest": { | ||
"type": "string", | ||
"contentEncoding": "base16", | ||
"contentMediaType": "application/octet-stream", | ||
"description": "If present, then this is a Loadtest Synthetic registration. The field itself is the Private key used in a Loadtest to vote with this registration." | ||
}, | ||
"type": { | ||
"type": "string", | ||
"description": "The type of registration.", | ||
"enum": [ | ||
"Unknown", | ||
"CIP-15", | ||
"CIP-36" | ||
] | ||
}, | ||
"rollback": { | ||
"type": "object", | ||
"description": "Data about the last rollback that affected this registration. If not defined, this registration has never suffered from a rollback. Invalid registrations could be invalid because they were rolledback, and not re-included in the blockchain.", | ||
"properties": { | ||
"slot": { | ||
"type": "integer", | ||
"format": "int64", | ||
"description": "The slot number the transaction was in, that got rolledback." | ||
}, | ||
"tip": { | ||
"type": "integer", | ||
"format": "int64", | ||
"description": "The slot number of tip at the time of the rollback." | ||
} | ||
}, | ||
"required": [ | ||
"slot", | ||
"tip" | ||
], | ||
"additionalProperties": false | ||
}, | ||
"warnings": { | ||
"type": "object", | ||
"description": "List of warnings associated with the registration. These do not make it invalid but are signs of potential problems.", | ||
"properties": { | ||
"nonce_exceeds_slot": { | ||
"type": "boolean", | ||
"description": "Nonce is larger than the slot the registration appears in. This could make it difficult or impossible to supersede as registration.", | ||
"default": false | ||
}, | ||
"reward_address_present": { | ||
"type": "boolean", | ||
"description": "The Payment address is a reward address. Payments are impossible to rewards type addresses.", | ||
"default": false | ||
} | ||
} | ||
}, | ||
"errors": { | ||
"type": "object", | ||
"description": "List of errors associated with the registration which make it invalid.", | ||
"properties": { | ||
"registration": { | ||
"type": "object", | ||
"description": "List of errors associated with the registration itself.", | ||
"properties": { | ||
"missing": { | ||
"type": "boolean", | ||
"description": "No 61284 registration metadata found for the registration." | ||
}, | ||
"format": { | ||
"type": "boolean", | ||
"description": "Registration metadata was not formatted correctly and could not be parsed." | ||
}, | ||
"invalid_voting_key": { | ||
"type": "boolean", | ||
"description": "Voting key was not formatted correctly." | ||
}, | ||
"invalid_payment_address": { | ||
"type": "boolean", | ||
"description": "Payment address was not valid." | ||
}, | ||
"invalid_purpose": { | ||
"type": "boolean", | ||
"description": "The registration purpose was something other than 0." | ||
}, | ||
"multiple_voting_keys": { | ||
"type": "boolean", | ||
"description": "CIP-36 style multiple voting keys are not supported." | ||
} | ||
} | ||
}, | ||
"signature": { | ||
"type": "object", | ||
"description": "List of errors associated with the signature.", | ||
"properties": { | ||
"missing": { | ||
"type": "boolean", | ||
"description": "No 61285 signature metadata found for the registration." | ||
}, | ||
"format": { | ||
"type": "boolean", | ||
"description": "Signature metadata was not formatted correctly and could not be parsed." | ||
}, | ||
"invalid": { | ||
"type": "boolean", | ||
"description": "Signature failed to validate?" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"type" | ||
] | ||
} |
45 changes: 45 additions & 0 deletions
45
catalyst-gateway/event-db/json_schemas/registration/update_stats.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$comment": "Custom URI schema: catalyst_schema://<uuid>/<group>/<name>", | ||
"$id": "catalyst_schema://0f917b13-afac-40d2-8263-b17ca8219914/registration/update_stats", | ||
"title": "Registration Update Statistics", | ||
"description": "Statistical data associated with the registration update.", | ||
"type": "object", | ||
"properties": { | ||
"registrations_lost": { | ||
"type": "integer", | ||
"format": "int64", | ||
"description": "The number of registrations that were lost during the update due to a rollback." | ||
}, | ||
"cip15_added": { | ||
"type": "integer", | ||
"format": "int64", | ||
"description": "The number of CIP-15 registrations that were added during the update." | ||
}, | ||
"cip36_added": { | ||
"type": "integer", | ||
"format": "int64", | ||
"description": "The number of CIP-36 registrations that were added during the update." | ||
}, | ||
"total_valid_registrations": { | ||
"type": "integer", | ||
"format": "int64", | ||
"description": "The total number of registrations in the system as at this update." | ||
}, | ||
"total_unregistered_stake_addresses": { | ||
"type": "integer", | ||
"format": "int64", | ||
"description": "The total number of stake_addresses not currently registered during this update." | ||
}, | ||
"total_staked_lovelace": { | ||
"type": "integer", | ||
"format": "int64", | ||
"description": "The total of all staked lovelace in the system as at this update. This includes the total number of stake_addresses not currently registered during this update." | ||
}, | ||
"total_registered_lovelace": { | ||
"type": "integer", | ||
"format": "int64", | ||
"description": "The total of all registered staked lovelace in the system as at this update." | ||
} | ||
} | ||
} |
Oops, something went wrong.