Skip to content

Commit 04c0f89

Browse files
pdp2121mvadarickniffen
authored
feat: add amendments/vote endpoint (#134)
## High Level Overview of Change <!-- Please include a summary/list of the changes. If too broad, please consider splitting into multiple PRs. If a relevant Asana task, please link it here. --> Add an api endpoint to retrieve lists of enabled and voting amendments for a network. Also, add functionality to manually edit amendments from db. Cache time for APIs are now controlled by a constant `CACHE_INTERVAL_MILLIS`. ### Type of Change <!-- Please check relevant options, delete irrelevant ones. --> - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Refactor (non-breaking change that only restructures code) - [ ] Tests (You added tests for code that already exists, or your new feature included in this PR) - [ ] Documentation Updates - [ ] Release ## Test Plan <!-- Please describe the tests that you ran to verify your changes and provide instructions so that others can reproduce. --> Test on staging for a few days. --------- Co-authored-by: Mayukha Vadari <[email protected]> Co-authored-by: Caleb Kniffen <[email protected]>
1 parent 8a691f8 commit 04c0f89

13 files changed

+505
-104
lines changed

ARCHITECTURE.md

+14-10
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ There are 3 folders in `src`, corresponding to the 3 processes that the VHS runs
77
* `connection-manager` manages the connections to rippled, and listens to validation and manifest streams.
88
* `crawler` finds validators and overlay nodes.
99

10-
1110
## API Endpoints
1211

1312
* `/`: Information about the endpoints.
@@ -24,8 +23,9 @@ There are 3 folders in `src`, corresponding to the 3 processes that the VHS runs
2423
* `/network/validator/:publicKey/manifests`: Returns the manifests of a specific validator.
2524
* `/network/validator/:publicKey/reports`: Returns more detailed information about the reliability of a specific validator.
2625
* `/network/amendments/info`: Returns general information about known amendments.
27-
* `/network/amendments/info/:param`: Returns general information about a specific amendment by name or ID.
28-
26+
* `/network/amendments/vote/:network`: Returns list of enabled and in voting amendments on a specific network.
27+
* `/network/amendment/info/:nameOrID`: Returns general information about a specific amendment by name or ID.
28+
* `/network/amendment/vote/:network/:nameOrID`: Returns the voting status of a specific amendment by name or ID.
2929

3030
## SQL Table Schemas
3131

@@ -75,6 +75,7 @@ This table keeps track of how reliable validators have been, on an hourly level.
7575
| `start` |The time that the data starts. |
7676
| `agreement` |Data about the reliability of the node.|
7777

78+
7879
### `location`
7980

8081
This table keeps track of the physical location of all of the nodes that the network is aware of.
@@ -108,6 +109,7 @@ This table keeps track of the manifests of the validators.
108109
| `revoked` |Whether the manifest has been revoked. |
109110
| `seq` |The sequence number of this manifest. |
110111

112+
111113
### `amendments_enabled`
112114

113115
This table keeps track of the amendments enabled on each network.
@@ -120,6 +122,7 @@ This table keeps track of the amendments enabled on each network.
120122
| `tx_hash` |The transaction hash where the amendment has been enabled.|
121123
| `date` |The date and time when the amendment has been enabled. |
122124

125+
123126
### `amendments_info`
124127

125128
This table keeps track of the general information of all known amendments.
@@ -131,17 +134,18 @@ This table keeps track of the general information of all known amendments.
131134
| `rippled_version` |The rippled version when the amendment is first enabled |
132135
| `deprecated` |Whether the amendment has been deprecated/retired |
133136

137+
134138
### `ballot`
135139

136140
This table keeps track of the most current voting data for the validators.
137141

138-
| Key | Definition |
139-
|----------------------|-------------------------------------------------------------------|
140-
| `signing_key` |The signing key of the validator. |
141-
| `ledger_index` |The most recent ledger index where voting data was retrieved. |
142-
| `amendments` |The amendments this validator wants to be added to the protocol. |
143-
| `base_fee` |The unscaled transaction cost this validator wants to set. |
144-
| `reserve_base` |The minimum reserve requirement this validator wants to set. |
142+
| Key | Definition |
143+
|----------------------|---------------------------------------------------------------------|
144+
| `signing_key` |The signing key of the validator. |
145+
| `ledger_index` |The most recent ledger index where voting data was retrieved. |
146+
| `amendments` |The amendments this validator wants to be added to the protocol. |
147+
| `base_fee` |The unscaled transaction cost this validator wants to set. |
148+
| `reserve_base` |The minimum reserve requirement this validator wants to set. |
145149
| `reserve_inc` |The increment in the reserve requirement this validator wants to set.|
146150

147151

0 commit comments

Comments
 (0)