@dashevo/dapi-grpc 4.2.0-dev.8 → 5.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.toml +1 -1
- package/README.md +32 -0
- package/build.rs +32 -2
- package/clients/drive/v0/nodejs/drive_pbjs.js +29162 -5403
- package/clients/platform/v0/nodejs/platform_pbjs.js +29162 -5403
- package/clients/platform/v0/nodejs/platform_protoc.js +34441 -10708
- package/clients/platform/v0/web/platform_pb.d.ts +3162 -64
- package/clients/platform/v0/web/platform_pb.js +34441 -10708
- package/clients/platform/v0/web/platform_pb_service.d.ts +247 -0
- package/clients/platform/v0/web/platform_pb_service.js +520 -0
- package/codegen.json +31 -0
- package/package.json +4 -3
- package/protos/platform/v0/platform.proto +847 -3
- package/scripts/build.sh +61 -247
- package/scripts/check-packed-clients.py +32 -0
- package/scripts/patch-protobuf-js.sh +11 -6
- package/scripts/setup-codegen.py +74 -0
package/Cargo.toml
CHANGED
|
@@ -57,7 +57,7 @@ serde = ["dep:serde", "dep:serde_bytes", "tenderdash-proto/serde"]
|
|
|
57
57
|
mocks = ["serde", "dep:serde_json"]
|
|
58
58
|
|
|
59
59
|
[dependencies]
|
|
60
|
-
tenderdash-proto = { git = "https://github.com/dashpay/rs-tenderdash-abci", tag = "v1.
|
|
60
|
+
tenderdash-proto = { git = "https://github.com/dashpay/rs-tenderdash-abci", tag = "v1.8.0", default-features = false }
|
|
61
61
|
|
|
62
62
|
prost = { version = "0.14" }
|
|
63
63
|
futures-core = "0.3.30"
|
package/README.md
CHANGED
|
@@ -140,3 +140,35 @@ Feel free to dive in! [Open an issue](https://github.com/dashpay/platform/issues
|
|
|
140
140
|
## License
|
|
141
141
|
|
|
142
142
|
[MIT](LICENSE) © Dash Core Group, Inc.
|
|
143
|
+
|
|
144
|
+
## Building generated clients
|
|
145
|
+
|
|
146
|
+
From the Platform monorepo, run `yarn install`, then provision the native
|
|
147
|
+
client generators once:
|
|
148
|
+
|
|
149
|
+
```sh
|
|
150
|
+
python3 packages/dapi-grpc/scripts/setup-codegen.py --install
|
|
151
|
+
yarn workspace @dashevo/dapi-grpc build
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Installation needs Python 3.12 or newer, CMake and a C++ compiler. It builds
|
|
155
|
+
checksum-verified sources into your user cache without sudo or Docker. Linux
|
|
156
|
+
runner images provide the same tools at `/opt/client-codegen`. Set
|
|
157
|
+
`DAPI_GRPC_TOOLCHAIN` to use an explicitly provisioned installation; a missing or
|
|
158
|
+
mismatched installation fails rather than silently selecting a different protoc.
|
|
159
|
+
|
|
160
|
+
`codegen.json` pins the recipe and native generator versions. The client compiler
|
|
161
|
+
is deliberately separate from the Rust build's protoc 32.0: the existing client
|
|
162
|
+
output uses protobuf 3.18.1, gRPC 1.46.3, gRPC Java 1.42.1 and the Yarn-locked
|
|
163
|
+
`ts-protoc-gen` 0.15.0. Update the recipe, Platform lock and runner requirements
|
|
164
|
+
together, with generated-output compatibility checks. Ordinary builds never
|
|
165
|
+
install system packages or start containers.
|
|
166
|
+
|
|
167
|
+
Generation stages all languages before replacing `clients/`, so a failed plugin
|
|
168
|
+
preserves the previous output. Java, Objective-C and Python are generated for
|
|
169
|
+
repository consumers; the NPM archive continues to exclude them and ships the
|
|
170
|
+
Node and web clients. Run the generation regressions after installing the tools:
|
|
171
|
+
|
|
172
|
+
```sh
|
|
173
|
+
yarn workspace @dashevo/dapi-grpc exec python3 -m unittest discover -s tests/codegen -v
|
|
174
|
+
```
|
package/build.rs
CHANGED
|
@@ -86,10 +86,22 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
|
|
|
86
86
|
// Derive features for versioned messages
|
|
87
87
|
//
|
|
88
88
|
// "GetConsensusParamsRequest" is excluded as this message does not support proofs
|
|
89
|
-
const VERSIONED_REQUESTS: [&str;
|
|
89
|
+
const VERSIONED_REQUESTS: [&str; 69] = [
|
|
90
|
+
"GetContractModerationStatusRequest",
|
|
91
|
+
"GetContractModerationEntriesRequest",
|
|
92
|
+
"GetContractDocumentRemovalsRequest",
|
|
93
|
+
"GetContractTeamActionsRequest",
|
|
94
|
+
"GetContractTeamActionSignersRequest",
|
|
95
|
+
"GetContractModerationActionCountsRequest",
|
|
96
|
+
"GetContractFeePotsRequest",
|
|
97
|
+
"GetContractGroupInfoRequest",
|
|
98
|
+
"GetContractGroupMembersRequest",
|
|
99
|
+
"GetContractGroupsForContractRequest",
|
|
90
100
|
"GetDataContractHistoryRequest",
|
|
101
|
+
"GetDataContractsLatestVersionsRequest",
|
|
91
102
|
"GetDataContractRequest",
|
|
92
103
|
"GetDataContractsRequest",
|
|
104
|
+
"GetDataContractsByRangeRequest",
|
|
93
105
|
"GetDocumentHistoryRequest",
|
|
94
106
|
"GetDocumentsRequest",
|
|
95
107
|
"GetIdentitiesByPublicKeyHashesRequest",
|
|
@@ -97,6 +109,7 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
|
|
|
97
109
|
"GetIdentitiesBalancesRequest",
|
|
98
110
|
"GetIdentityNonceRequest",
|
|
99
111
|
"GetIdentityContractNonceRequest",
|
|
112
|
+
"GetIdentityKeysRemainingBudgetsRequest",
|
|
100
113
|
"GetIdentityBalanceAndRevisionRequest",
|
|
101
114
|
"GetIdentityBalanceRequest",
|
|
102
115
|
"GetIdentityByNonUniquePublicKeyHashRequest",
|
|
@@ -157,8 +170,19 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
|
|
|
157
170
|
// - "GetIdentityByNonUniquePublicKeyHashResponse"
|
|
158
171
|
//
|
|
159
172
|
// "GetEvonodesProposedEpochBlocksResponse" is used for 2 Requests
|
|
160
|
-
const VERSIONED_RESPONSES: [&str;
|
|
173
|
+
const VERSIONED_RESPONSES: [&str; 66] = [
|
|
174
|
+
"GetContractModerationStatusResponse",
|
|
175
|
+
"GetContractModerationEntriesResponse",
|
|
176
|
+
"GetContractDocumentRemovalsResponse",
|
|
177
|
+
"GetContractTeamActionsResponse",
|
|
178
|
+
"GetContractTeamActionSignersResponse",
|
|
179
|
+
"GetContractModerationActionCountsResponse",
|
|
180
|
+
"GetContractFeePotsResponse",
|
|
181
|
+
"GetContractGroupInfoResponse",
|
|
182
|
+
"GetContractGroupMembersResponse",
|
|
183
|
+
"GetContractGroupsForContractResponse",
|
|
161
184
|
"GetDataContractHistoryResponse",
|
|
185
|
+
"GetDataContractsLatestVersionsResponse",
|
|
162
186
|
"GetDataContractResponse",
|
|
163
187
|
"GetDataContractsResponse",
|
|
164
188
|
"GetDocumentHistoryResponse",
|
|
@@ -170,6 +194,7 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
|
|
|
170
194
|
"GetIdentityBalanceResponse",
|
|
171
195
|
"GetIdentityNonceResponse",
|
|
172
196
|
"GetIdentityContractNonceResponse",
|
|
197
|
+
"GetIdentityKeysRemainingBudgetsResponse",
|
|
173
198
|
"GetIdentityByPublicKeyHashResponse",
|
|
174
199
|
"GetIdentityKeysResponse",
|
|
175
200
|
"GetIdentityResponse",
|
|
@@ -341,10 +366,15 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
|
|
|
341
366
|
// absent (same pattern DocumentQuery's own serde defaults follow
|
|
342
367
|
// for pre-SQL-surface fixtures).
|
|
343
368
|
.field_attribute("GetDocumentsRequestV1.chained", SERDE_DEFAULT)
|
|
369
|
+
.field_attribute("GetDocumentsRequestV1.sub_queries", SERDE_DEFAULT)
|
|
344
370
|
// Same compat rule for the typed IN_TIME_RANGE operand: mock
|
|
345
371
|
// vectors captured while the operand still rode `value` carry no
|
|
346
372
|
// `time_range` key.
|
|
347
373
|
.field_attribute("GetDocumentsRequest.WhereClause.time_range", SERDE_DEFAULT)
|
|
374
|
+
.field_attribute(
|
|
375
|
+
"GetDocumentsRequest.WhereClause.integer_range",
|
|
376
|
+
SERDE_DEFAULT,
|
|
377
|
+
)
|
|
348
378
|
.field_attribute("ResponseMetadata.height", SERDE_WITH_STRING)
|
|
349
379
|
.field_attribute("ResponseMetadata.time_ms", SERDE_WITH_STRING)
|
|
350
380
|
.field_attribute("start_at_ms", SERDE_WITH_STRING)
|