-
Notifications
You must be signed in to change notification settings - Fork 43
docs(dapi): document architecture and implementation #2539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis set of changes primarily restructures and expands the documentation for the DAPI (Dash API) package. It introduces detailed new markdown documentation files covering DAPI's architecture, endpoint overviews, and in-depth descriptions of core, platform, stream, and JSON-RPC endpoints. Several older documentation files, including configuration guides and API references, are removed or replaced. Minor source code changes include a reduction in the size of versioned gRPC message arrays in a Rust build script, reordering of method ID constants in a Java gRPC client, and a duplicate trait implementation in a Rust service. No core logic or exported code interfaces are modified. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant DAPI gRPC/JSON-RPC Server
participant Dash Core Node
participant Drive
participant Tenderdash
%% Example: Core endpoint (getBestBlockHeight)
Client->>DAPI gRPC/JSON-RPC Server: Request getBestBlockHeight
alt Cache valid
DAPI gRPC/JSON-RPC Server-->>Client: Return cached block height
else Cache invalid
DAPI gRPC/JSON-RPC Server->>Dash Core Node: getBlockCount RPC
Dash Core Node-->>DAPI gRPC/JSON-RPC Server: Block height
DAPI gRPC/JSON-RPC Server-->>Client: Return block height
end
%% Example: Platform endpoint (broadcastStateTransition)
Client->>DAPI gRPC Server: broadcastStateTransition(stateTransition)
DAPI gRPC Server->>Tenderdash: broadcast_tx(stateTransition)
alt Success
DAPI gRPC Server-->>Client: Success (empty response)
else Error
Tenderdash-->>DAPI gRPC Server: Error details
DAPI gRPC Server-->>Client: Error mapped to gRPC code
end
%% Example: Stream endpoint (subscribeToTransactionsWithProofs)
Client->>DAPI gRPC Server: subscribeToTransactionsWithProofs(bloomFilter)
DAPI gRPC Server->>Dash Core Node: Subscribe to ZMQ events
Dash Core Node-->>DAPI gRPC Server: New block/transaction events
DAPI gRPC Server-->>Client: Stream matching transactions/proofs
Possibly related PRs
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
# Conflicts: # packages/dapi-grpc/Cargo.toml # packages/dapi-grpc/clients/drive/v0/nodejs/drive_pbjs.js # packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py # packages/dapi-grpc/protos/platform/v0/platform.proto # packages/rs-drive-abci/src/query/proofs/v0/mod.rs # packages/rs-drive-abci/src/query/service.rs
# Conflicts: # packages/dapi-grpc/build.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
🔭 Outside diff range comments (1)
packages/dapi-grpc/build.rs (1)
76-124
: 💡 Verification agent🧩 Analysis chain
Verify VERSIONED_REQUESTS and VERSIONED_RESPONSES alignment with proto definitions.
Ensure the updatedVERSIONED_REQUESTS
(lines 76–117) andVERSIONED_RESPONSES
(lines 124–164) arrays accurately reflect the message types inprotos/platform/v0/platform.proto
and the method IDs inPlatformGrpc.java
.Run this script from the repository root to confirm all entries exist in the proto file:
🏁 Script executed:
#!/bin/bash # Check Versioned Request/Response messages exist in proto definitions code_file="packages/dapi-grpc/build.rs" proto_file="protos/platform/v0/platform.proto" missing=0 for prefix in "Request" "Response"; do # Extract message names msgs=$(grep -oE "\"[A-Za-z0-9]+${prefix}\"" "$code_file" | tr -d '"' | sort | uniq) for msg in $msgs; do if ! grep -R "message $msg\\b" "$proto_file"; then echo "Missing ${prefix} message in proto: $msg" missing=1 fi done done exit $missingLength of output: 29394
🏁 Script executed:
#!/bin/bash # Locate all .proto files to identify the correct path for platform.proto find . -type f -name "*.proto"Length of output: 240
🏁 Script executed:
#!/bin/bash # Verify VERSIONED_REQUESTS and VERSIONED_RESPONSES against the correct proto path code_file="packages/dapi-grpc/build.rs" proto_file="packages/dapi-grpc/protos/platform/v0/platform.proto" missing=0 for prefix in "Request" "Response"; do msgs=$(grep -oE "\"[A-Za-z0-9]+${prefix}\"" "$code_file" | tr -d '"' | sort | uniq) for msg in $msgs; do if ! grep -qE "message ${msg}\b" "$proto_file"; then echo "Missing ${prefix} message in proto: ${msg}" missing=1 fi done done exit $missingLength of output: 13787
Mismatch Detected in VERSIONED_REQUESTS/RESPONSES
The following entries inpackages/dapi-grpc/build.rs
are not defined in
packages/dapi-grpc/protos/platform/v0/platform.proto
:• VERSIONED_REQUESTS:
– GetIdentitiesByPublicKeyHashesRequest
– GetIdentitiesRequest• VERSIONED_RESPONSES:
– GetIdentitiesByPublicKeyHashesResponse
– GetIdentitiesResponsePlease either remove/rename these entries in the
VERSIONED_*
arrays or add matchingmessage
definitions inplatform.proto
(and updatePlatformGrpc.java
method IDs).
🧹 Nitpick comments (19)
packages/dapi/README.md (1)
16-16
: Fix typo in documentation link text.
The word “documentaion” is misspelled. Change it to “documentation”.packages/dapi/doc/endpoints/core/subscribeToMasternodeList.md (1)
53-53
: Specify language for fenced code block.
The code block starting at line 53 has no language identifier, which triggers markdownlint’s MD040. Add a language label (e.g., ```text) to satisfy the linter.🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
53-53: Fenced code blocks should have a language specified
null(MD040, fenced-code-language)
packages/dapi/doc/index.md (1)
1-74
: Well-structured main documentation page!This comprehensive overview of DAPI provides excellent context and navigation. The hierarchical structure with clear sections for architecture, endpoints by category, and client libraries creates a logical flow for readers.
One minor suggestion:
Consider adding a comma before "so" in line 11 to improve readability:
-DAPI supports both layer 1 (Core blockchain) and layer 2 (Dash Platform) functionality so all developers can interact with Dash via a single interface. +DAPI supports both layer 1 (Core blockchain) and layer 2 (Dash Platform) functionality, so all developers can interact with Dash via a single interface.🧰 Tools
🪛 LanguageTool
[uncategorized] ~11-~11: Use a comma before ‘so’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...nd layer 2 (Dash Platform) functionality so all developers can interact with Dash v...(COMMA_COMPOUND_SENTENCE_2)
packages/dapi/doc/endpoints/index.md (1)
47-66
: Consider explaining why these endpoints are served by Drive ABCI directlyThe documentation lists numerous platform endpoints that are "served by Drive ABCI directly" without explaining the significance of this distinction to developers.
Consider adding a brief explanation of what Drive ABCI is and how this implementation detail might affect developers (if at all). For example, are there any performance implications or usage differences compared to regular DAPI endpoints?
packages/dapi/doc/endpoints/json-rpc/getBlockHash.md (1)
73-82
: Add language specifier to code blockThe code flow diagram is missing a language specifier in the fenced code block.
Add a language specifier to the fenced code block by changing:
-``` +```text Client Request → JSON-RPC Server → getBlockHash Handler → Validate Height Parameter → If Invalid: Return Error Response → Call Core RPC getBlockHash with height → If Successful: Return Block Hash → If Error: Map to JSON-RPC Error Response🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
73-73: Fenced code blocks should have a language specified
null(MD040, fenced-code-language)
packages/dapi/doc/endpoints/core/broadcastTransaction.md (1)
48-60
: Suggest adding a language specifier to the code block.The internal code flow diagram uses fenced code blocks without a language.
Consider changing:``` Client Request ... ```
to:
- ``` + ```text Client Request ...</blockquote></details> <details> <summary>packages/dapi/doc/endpoints/core/getBestBlockHeight.md (1)</summary><blockquote> `45-54`: **Suggest specifying code block language.** The code flow diagram lacks a fence language; add `text` or `none` for clarity: ```diff - ``` + ```text Client Request ...
</blockquote></details> <details> <summary>packages/dapi/doc/endpoints/core/getBlockchainStatus.md (1)</summary><blockquote> `56-68`: **Suggest adding a language to the code flow block.** Replace:
Client Request ...
with: ```diff - ``` + ```text Client Request ...
</blockquote></details> <details> <summary>packages/dapi/doc/endpoints/core/getTransaction.md (2)</summary><blockquote> `1-17`: **Suggest refining InstantLock description.** Replace:
isInstantLocked
: Whether transaction is instant lockedwith:
isInstantLocked
: Whether the transaction has been locked by InstantSendThis clarifies the security mechanism and fixes the adverb/adjective usage. <details> <summary>🧰 Tools</summary> <details> <summary>🪛 LanguageTool</summary> [misspelling] ~15-~15: The word “instant” is an adjective and doesn’t fit in this context. Did you mean the adverb “instantly”? Context: ...sInstantLocked`: Whether transaction is instant locked - `isChainLocked`: Whether trans... (ADJECTIVE_ADVERB) </details> </details> --- `53-68`: **Suggest adding a language specifier to the code flow block.** Use: ```diff - ``` + ```text Client Request ...
to improve readability. <details> <summary>🧰 Tools</summary> <details> <summary>🪛 markdownlint-cli2 (0.17.2)</summary> 55-55: Fenced code blocks should have a language specified null (MD040, fenced-code-language) </details> </details> </blockquote></details> <details> <summary>packages/dapi/doc/endpoints/platform/broadcastStateTransition.md (1)</summary><blockquote> `51-65`: **Suggest specifying code block language for the flow diagram.** Update: ```diff - ``` + ```text Client Request ...
to ensure proper rendering. </blockquote></details> <details> <summary>packages/dapi/doc/endpoints/streams/subscribeToBlockHeadersWithChainLocks.md (1)</summary><blockquote> `8-9`: **Clarify parameter requirements for historical vs. streaming modes.** The doc currently says both `fromBlockHash` and `fromBlockHeight` are optional, but it’s not clear when at least one must be provided. Consider specifying that: - For historical mode (`count > 0`), exactly one of `fromBlockHash` or `fromBlockHeight` is required. - For real-time streaming (`count = 0`), both can be omitted. </blockquote></details> <details> <summary>packages/dapi/doc/endpoints/platform/getStatus.md (1)</summary><blockquote> `43-44`: **Link the handler implementation file for easier navigation.** Consider turning the plain filename into a relative markdown link so readers can jump directly to the code: ```diff - The `getStatus` endpoint is implemented in the `getStatusHandlerFactory.js` file. + The `getStatus` endpoint is implemented in [getStatusHandlerFactory.js](../handlers/getStatusHandlerFactory.js).
packages/dapi/doc/endpoints/platform/getConsensusParams.md (2)
10-18
: Consider grouping response parameters by categoryTo improve readability, split the response list into subheadings (e.g., Block Parameters, Evidence Parameters, Validator Parameters) matching the logical grouping in the architecture overview.
32-33
: Link internal implementation fileYou may link
getConsensusParamsFactory.js
to its source path to help users navigate directly to the implementation (e.g.,[getConsensusParamsFactory.js](../path/to/getConsensusParamsFactory.js)
).packages/dapi/doc/architecture.md (2)
49-54
: Remove trailing punctuation from headings and fix list indentationMultiple headings end with colons (
Responsibilities:
,Connections:
,Startup Sequence:
,Endpoints Served:
,Dependencies:
). Please remove trailing colons (e.g., change#### Responsibilities:
to#### Responsibilities
). Also adjust nested list indentation from 3 spaces to 2 spaces per level to satisfy markdownlint MD007.Also applies to: 55-60, 61-69, 70-84, 89-96, 105-109, 111-115, 116-124, 126-131, 133-135
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
49-49: Trailing punctuation in heading
Punctuation: ':'(MD026, no-trailing-punctuation)
13-41
: Specify language for architecture diagram code blockThe ASCII diagram block should specify a language (e.g.,
text
) for the fenced code block:- ``` + ```textThis addresses MD040.
packages/dapi/doc/endpoints/platform/waitForStateTransitionResult.md (1)
64-80
: Specify language for code flow blockThe code flow block should indicate a language (e.g.,
text
):- ``` + ```textThis satisfies MD040 for fenced code blocks.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
64-64: Fenced code blocks should have a language specified
null(MD040, fenced-code-language)
packages/dapi/doc/endpoints/streams/subscribeToTransactionsWithProofs.md (1)
85-109
: Specify language for code flow blockAdd a language identifier (e.g.,
text
) to the fenced code block starting at line 85:- ``` + ```textThis satisfies MD040.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
85-85: Fenced code blocks should have a language specified
null(MD040, fenced-code-language)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (26)
packages/dapi-grpc/build.rs
(2 hunks)packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java
(1 hunks)packages/dapi/README.md
(1 hunks)packages/dapi/doc/CONFIGURATION.md
(0 hunks)packages/dapi/doc/README.md
(0 hunks)packages/dapi/doc/REFERENCE.md
(0 hunks)packages/dapi/doc/architecture.md
(1 hunks)packages/dapi/doc/dependencies_configs/dash.conf
(0 hunks)packages/dapi/doc/endpoints/core/broadcastTransaction.md
(1 hunks)packages/dapi/doc/endpoints/core/getBestBlockHeight.md
(1 hunks)packages/dapi/doc/endpoints/core/getBlockchainStatus.md
(1 hunks)packages/dapi/doc/endpoints/core/getTransaction.md
(1 hunks)packages/dapi/doc/endpoints/core/subscribeToMasternodeList.md
(1 hunks)packages/dapi/doc/endpoints/index.md
(1 hunks)packages/dapi/doc/endpoints/json-rpc/getBestBlockHash.md
(1 hunks)packages/dapi/doc/endpoints/json-rpc/getBlockHash.md
(1 hunks)packages/dapi/doc/endpoints/platform/broadcastStateTransition.md
(1 hunks)packages/dapi/doc/endpoints/platform/getConsensusParams.md
(1 hunks)packages/dapi/doc/endpoints/platform/getStatus.md
(1 hunks)packages/dapi/doc/endpoints/platform/waitForStateTransitionResult.md
(1 hunks)packages/dapi/doc/endpoints/streams/subscribeToBlockHeadersWithChainLocks.md
(1 hunks)packages/dapi/doc/endpoints/streams/subscribeToTransactionsWithProofs.md
(1 hunks)packages/dapi/doc/index.md
(1 hunks)packages/dapi/doc/swaggerDef.js
(0 hunks)packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs
(4 hunks)packages/rs-drive-abci/src/query/service.rs
(2 hunks)
💤 Files with no reviewable changes (5)
- packages/dapi/doc/README.md
- packages/dapi/doc/CONFIGURATION.md
- packages/dapi/doc/swaggerDef.js
- packages/dapi/doc/dependencies_configs/dash.conf
- packages/dapi/doc/REFERENCE.md
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
packages/dapi/doc/endpoints/json-rpc/getBlockHash.md
73-73: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
packages/dapi/doc/endpoints/streams/subscribeToTransactionsWithProofs.md
85-85: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
packages/dapi/doc/endpoints/platform/waitForStateTransitionResult.md
64-64: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
packages/dapi/doc/endpoints/streams/subscribeToBlockHeadersWithChainLocks.md
66-66: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
packages/dapi/doc/architecture.md
12-12: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
49-49: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
55-55: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
61-61: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
70-70: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
73-73: Unordered list indentation
Expected: 2; Actual: 3
(MD007, ul-indent)
74-74: Unordered list indentation
Expected: 2; Actual: 3
(MD007, ul-indent)
75-75: Unordered list indentation
Expected: 2; Actual: 3
(MD007, ul-indent)
76-76: Unordered list indentation
Expected: 2; Actual: 3
(MD007, ul-indent)
79-79: Unordered list indentation
Expected: 2; Actual: 3
(MD007, ul-indent)
80-80: Unordered list indentation
Expected: 2; Actual: 3
(MD007, ul-indent)
81-81: Unordered list indentation
Expected: 2; Actual: 3
(MD007, ul-indent)
82-82: Unordered list indentation
Expected: 2; Actual: 3
(MD007, ul-indent)
83-83: Unordered list indentation
Expected: 2; Actual: 3
(MD007, ul-indent)
86-86: Unordered list indentation
Expected: 2; Actual: 3
(MD007, ul-indent)
87-87: Unordered list indentation
Expected: 2; Actual: 3
(MD007, ul-indent)
89-89: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
105-105: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
111-111: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
116-116: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
126-126: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
129-129: Unordered list indentation
Expected: 2; Actual: 3
(MD007, ul-indent)
130-130: Unordered list indentation
Expected: 2; Actual: 3
(MD007, ul-indent)
131-131: Unordered list indentation
Expected: 2; Actual: 3
(MD007, ul-indent)
133-133: Trailing punctuation in heading
Punctuation: ':'
(MD026, no-trailing-punctuation)
packages/dapi/doc/endpoints/core/getTransaction.md
55-55: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
packages/dapi/doc/endpoints/core/subscribeToMasternodeList.md
53-53: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
🪛 LanguageTool
packages/dapi/doc/endpoints/index.md
[style] ~3-~3: Consider using a synonym to be more concise.
Context: # DAPI Endpoints Overview DAPI offers a variety of endpoints through two main interfaces: ...
(A_VARIETY_OF)
packages/dapi/doc/index.md
[uncategorized] ~11-~11: Use a comma before ‘so’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...nd layer 2 (Dash Platform) functionality so all developers can interact with Dash v...
(COMMA_COMPOUND_SENTENCE_2)
packages/dapi/doc/endpoints/platform/broadcastStateTransition.md
[grammar] ~36-~36: You’ve repeated a verb. Did you mean to only write one of them?
Context: ...c validation error messages 3. Error Handling - Handles various error scenarios with specialize...
(REPEATED_VERBS)
packages/dapi/doc/endpoints/platform/waitForStateTransitionResult.md
[grammar] ~47-~47: You’ve repeated a verb. Did you mean to only write one of them?
Context: ...tion without trusting DAPI 3. Result Processing - Processes both successful and unsuccessful state ...
(REPEATED_VERBS)
[grammar] ~52-~52: You’ve repeated a verb. Did you mean to only write one of them?
Context: ... detailed error information 4. Error Handling - Handles timeout errors with `DeadlineExceededGr...
(REPEATED_VERBS)
[grammar] ~86-~86: You’ve repeated a verb. Did you mean to only write one of them?
Context: ...nitor transaction status: 1. Initial Check - Checks if the transaction is already confirmed...
(REPEATED_VERBS)
packages/dapi/doc/endpoints/core/getTransaction.md
[misspelling] ~15-~15: The word “instant” is an adjective and doesn’t fit in this context. Did you mean the adverb “instantly”?
Context: ...sInstantLocked: Whether transaction is instant locked -
isChainLocked`: Whether trans...
(ADJECTIVE_ADVERB)
packages/dapi/doc/endpoints/core/subscribeToMasternodeList.md
[grammar] ~46-~46: You’ve repeated a verb. Did you mean to only write one of them?
Context: ...tSync for maintaining state 5. Error Handling - Handles disconnections from Core - Provides ...
(REPEATED_VERBS)
🔇 Additional comments (35)
packages/dapi/doc/endpoints/json-rpc/getBestBlockHash.md (1)
1-85
: Endpoint documentation is clear and comprehensive.
ThegetBestBlockHash
JSON‑RPC endpoint is well‑documented with request/response examples, implementation details, and code flow. No issues found.packages/dapi/doc/endpoints/index.md (1)
1-110
: Great endpoint organization and comprehensive categorization!This document effectively categorizes DAPI endpoints into logical groups with clear explanations of each interface type. The inclusion of direct access examples alongside client library recommendations provides valuable guidance for developers.
The explanation of gRPC as the recommended interface and JSON-RPC as legacy helps guide developers toward the preferred implementation path.
🧰 Tools
🪛 LanguageTool
[style] ~3-~3: Consider using a synonym to be more concise.
Context: # DAPI Endpoints Overview DAPI offers a variety of endpoints through two main interfaces: ...(A_VARIETY_OF)
packages/dapi/doc/endpoints/json-rpc/getBlockHash.md (1)
1-108
: Thorough and well-structured endpoint documentation!This documentation provides excellent coverage of both the client-facing API and internal implementation details. The inclusion of example code, schema validation, and error handling considerations makes this particularly useful for both users and maintainers.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
73-73: Fenced code blocks should have a language specified
null(MD040, fenced-code-language)
packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs (2)
1-1
: Clean import organizationThe imports have been well organized, with token configuration accessors and localization imports grouped together.
Also applies to: 28-31
56-109
: Improved function signature formattingThe function parameter lists have been reformatted from multi-line to a more compact single-line style, which improves code readability while maintaining the same functionality.
Also applies to: 117-149
packages/dapi/doc/endpoints/core/broadcastTransaction.md (5)
1-12
: Approve: CorebroadcastTransaction
API documentation is clear and accurate.The introduction and parameter descriptions concisely explain the purpose and usage of the endpoint.
13-19
: Approve: Example usage demonstrates client-side invocation.The JavaScript snippet correctly shows how to call
broadcastTransaction
and log the result.
20-29
: Approve: Implementation Details section is thorough.Step-by-step breakdown of validation and RPC interaction aligns with handler behavior.
30-42
: Approve: Error handling details are comprehensive.Common Core RPC error codes are mapped appropriately to gRPC errors with helpful descriptions.
61-83
: Approve: Common Error Scenarios mapping is clear.Each RPC error case is documented with the correct gRPC mapping and rationale.
packages/dapi/doc/endpoints/core/getBestBlockHeight.md (4)
1-11
: Approve:getBestBlockHeight
header and parameter docs.The overview, absence of request parameters, and response field are clearly documented.
12-17
: Approve: Example usage is correct.Demonstrates asynchronous call and logging of the block height.
20-28
: Approve: Caching and handler flow explained well.Implementation Details describe cache invalidation and RPC fallback clearly.
29-38
: Approve: Dependencies are correctly listed.Dash Core RPC and ZMQ dependencies are noted for full context.
packages/dapi/doc/endpoints/core/getBlockchainStatus.md (4)
1-20
: Approve: Overview and client API section.The request/response parameters capture all fields in
getBlockchainStatus
.
21-25
: Approve: Example usage snippet.Correctly illustrates invocation and logging of key response fields.
29-49
: Approve: Implementation Details are comprehensive.Data collection, parallel RPC calls, cache strategy, status determination, and dependencies are well documented.
70-82
: Approve: Response Construction section.Aggregates multiple data sources into a cohesive snapshot; descriptions are clear.
packages/dapi/doc/endpoints/core/getTransaction.md (6)
19-23
: Approve: Example usage is clear.Demonstrates how to pass a transaction ID and access the returned height.
25-34
: Approve: Input validation step is well described.Specifies hex-string requirements and error handling for invalid formats.
35-43
: Approve: RPC interaction and response transformation.Details on
getrawtransaction
usage and mapping to gRPC response are accurate.
44-48
: Approve: Error handling mapping.Covers
-5
not-found scenario and general RPC errors appropriately.
49-52
: Approve: Dependencies listed correctly.Mentions Core RPC and optional InsightAPI fallback.
71-82
: Approve: Transaction Lock Status details are informative.The distinction between InstantLock and ChainLock is well captured.
packages/dapi/doc/endpoints/platform/broadcastStateTransition.md (7)
1-12
: Approve: Broadcast State Transition client API section.Endpoint purpose, request, and response definitions are clear.
13-18
: Approve: Example usage snippet.Illustrates how to submit a state transition and handle the response.
20-29
: Approve: State Transition Processing steps.Covers base64 conversion and RPC invocation clearly.
31-35
: Approve: Validation flow explanation.Describes both
broadcast_tx
and optionalcheck_tx
calls accurately.
36-45
: Approve: Detailed error handling scenarios.Common Tenderdash error cases are mapped to gRPC codes appropriately.
🧰 Tools
🪛 LanguageTool
[grammar] ~36-~36: You’ve repeated a verb. Did you mean to only write one of them?
Context: ...c validation error messages 3. Error Handling - Handles various error scenarios with specialize...(REPEATED_VERBS)
46-49
: Approve: Dependencies are correctly noted.Mention of Tenderdash RPC and Drive is complete.
67-89
: Approve: Common Error Scenarios documentation.Each failure mode (mempool, validation, capacity, timeout) is clearly described with correct gRPC mappings.
packages/dapi/doc/endpoints/platform/getConsensusParams.md (1)
1-28
: Documentation is comprehensiveThe
getConsensusParams.md
file provides a clear API description, parameter details, examples, and implementation notes.packages/dapi/doc/architecture.md (1)
97-100
: Approve code block usageThe
bash
code block for the startup script is correctly formatted.packages/dapi/doc/endpoints/platform/waitForStateTransitionResult.md (1)
1-32
: Documentation is clearThe
waitForStateTransitionResult.md
document comprehensively covers request parameters, response structure, internal implementation details, and usage example.packages/dapi/doc/endpoints/streams/subscribeToTransactionsWithProofs.md (1)
1-42
: Documentation looks solidThe endpoint doc clearly defines request params, response types, example usage, internal implementation, and response types.
``` | ||
Client Request | ||
→ gRPC Server | ||
→ subscribeToBlockHeadersWithChainLocksHandler | ||
→ Validate Parameters | ||
→ If Historical Data Requested (count > 0): | ||
→ Create Historical Headers Iterator | ||
→ Stream Headers Until Count Reached | ||
→ If Streaming Requested (count = 0 or all historical sent): | ||
→ Subscribe to ZMQ Events | ||
→ On New Block: | ||
→ Format Block Header | ||
→ Send to Client | ||
→ On New ChainLock: | ||
→ Format ChainLock | ||
→ Send to Client | ||
→ On Client Disconnect: | ||
→ Clean Up Subscriptions | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a language identifier to the code block for syntax highlighting.
The block outlining the code flow starts with triple backticks but no language. To improve readability and linting, specify a language (e.g., text
or mermaid
) or simply bash
/plaintext
if it’s a diagram:
- ```
+ ```text
Client Request
→ gRPC Server
→ subscribeToBlockHeadersWithChainLocksHandler
→ Validate Parameters
…
→ On Client Disconnect:
→ Clean Up Subscriptions
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
66-66: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
``` | ||
Client Request | ||
→ gRPC Server | ||
→ getStatusHandler | ||
→ Check Cache | ||
→ If Valid: Return Cached Status | ||
→ If Invalid: | ||
→ Parallel Requests (Promise.allSettled): | ||
→ Drive Status | ||
→ Tenderdash Status | ||
→ Tenderdash Network Info | ||
→ Process All Results | ||
→ Handle Any Failed Requests | ||
→ Calculate Derived Fields | ||
→ Cache Response | ||
→ Return Complete Status | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specify a language for the code‐flow block.
The “Code Flow” diagram uses a fenced block without a language. Adding text
(or another appropriate identifier) will satisfy lint rules and improve readability:
- ```
+ ```text
Client Request
→ gRPC Server
→ getStatusHandler
→ Check Cache
…
→ Return Complete Status
packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thephez says I can merge this one in.
Issue being fixed or feature implemented
We need to share knoweldge about DAPI internal implementation.
What was done?
How Has This Been Tested?
None
Breaking Changes
None
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit