-
Notifications
You must be signed in to change notification settings - Fork 62
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
docs/node: Switch Archive Snapshots to new Multipart ones #523
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
📝 Walkthrough📝 WalkthroughWalkthroughThe pull request introduces modifications to the Changes
Sequence DiagramsequenceDiagram
participant User
participant NodeSnapshots
participant API
User->>NodeSnapshots: Request Snapshots
NodeSnapshots->>API: Fetch Snapshot Data
API-->>NodeSnapshots: Return Snapshot Details
NodeSnapshots->>User: Display Snapshots
User->>NodeSnapshots: Toggle Dropdown
NodeSnapshots->>User: Show/Hide Additional Links
User->>NodeSnapshots: Select Download
NodeSnapshots->>API: Retrieve Snapshot Part
API-->>User: Provide Snapshot Download
The sequence diagram illustrates the interaction between the user, the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 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 (
|
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: 1
🧹 Nitpick comments (3)
src/pages/nodes/start-here/syncing.mdx (1)
29-32
: Fix typo in "Snaphhots"There's a typo in the warning message that should be corrected.
- Snaphhots database backend is **pebbledb**. Ensure that your node is configured to + Snapshots database backend is **pebbledb**. Ensure that your node is configured tosrc/components/Docs/components/NodeSnapshots.tsx (2)
128-135
: Enhance size formatting for better readabilityThe size formatting logic could be improved for maintainability and readability.
- { - snapshot.size - ? snapshot.size >= 1024 ** 4 - ? (snapshot.size / (1024 ** 4)).toFixed(1) + "TB" - : (snapshot.size / (1024 ** 3)).toFixed(1) + "GB" - : "" - } + {formatSize(snapshot.size)}Consider extracting the formatting logic into a utility function:
const formatSize = (size?: number): string => { if (!size) return ""; const TB = 1024 ** 4; const GB = 1024 ** 3; return size >= TB ? `${(size / TB).toFixed(1)}TB` : `${(size / GB).toFixed(1)}GB`; };🧰 Tools
🪛 eslint
[error] 128-129: Delete
⏎····················
(prettier/prettier)
[error] 131-131: Replace
······················?·(snapshot.size·/·(1024·**·4)
with························?·(snapshot.size·/·1024·**·4
(prettier/prettier)
[error] 132-132: Replace
······················:·(snapshot.size·/·(1024·**·3)
with························:·(snapshot.size·/·1024·**·3
(prettier/prettier)
[error] 133-134: Delete
⏎····················
(prettier/prettier)
161-167
: Consider enhancing script copy feedbackThe copy functionality should provide visual feedback to users when the script is copied.
<CopyToClipboard getValue={() => snapshot.instructions || "No instructions available" } + onCopy={() => { + // Consider adding a toast notification or temporary visual feedback + console.log('Script copied to clipboard'); + }} />🧰 Tools
🪛 eslint
[error] 161-161: Insert
··
(prettier/prettier)
[error] 162-166: Replace
····························<CopyToClipboard⏎······························getValue={()·=>⏎································snapshot.instructions·||·"No·instructions·available"⏎······························}⏎···························
with······························<CopyToClipboard·getValue={()·=>·snapshot.instructions·||·"No·instructions·available"}
(prettier/prettier)
[error] 167-167: Insert
··
(prettier/prettier)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/components/Docs/components/NodeSnapshots.tsx
(5 hunks)src/pages/nodes/start-here/syncing.mdx
(1 hunks)
🧰 Additional context used
🪛 eslint
src/components/Docs/components/NodeSnapshots.tsx
[error] 128-129: Delete ⏎····················
(prettier/prettier)
[error] 131-131: Replace ······················?·(snapshot.size·/·(1024·**·4)
with ························?·(snapshot.size·/·1024·**·4
(prettier/prettier)
[error] 132-132: Replace ······················:·(snapshot.size·/·(1024·**·3)
with ························:·(snapshot.size·/·1024·**·3
(prettier/prettier)
[error] 133-134: Delete ⏎····················
(prettier/prettier)
[error] 136-136: Delete ··
(prettier/prettier)
[error] 137-137: Insert ··
(prettier/prettier)
[error] 138-138: Insert ··
(prettier/prettier)
[error] 139-139: Insert ··
(prettier/prettier)
[error] 140-140: Replace ····················
with ······················
(prettier/prettier)
[error] 141-141: Insert ··
(prettier/prettier)
[error] 142-142: Insert ··
(prettier/prettier)
[error] 143-143: Insert ··
(prettier/prettier)
[error] 144-144: Replace ························
with ··························
(prettier/prettier)
[error] 145-145: Insert ··
(prettier/prettier)
[error] 146-146: Insert ··
(prettier/prettier)
[error] 147-147: Insert ··
(prettier/prettier)
[error] 148-148: Insert ··
(prettier/prettier)
[error] 149-149: Insert ··
(prettier/prettier)
[error] 150-150: Insert ··
(prettier/prettier)
[error] 151-151: Insert ··
(prettier/prettier)
[error] 152-152: Insert ··
(prettier/prettier)
[error] 153-153: Insert ··
(prettier/prettier)
[error] 154-154: Insert ··
(prettier/prettier)
[error] 155-155: Replace ··································
with ····································
(prettier/prettier)
[error] 156-156: Insert ··
(prettier/prettier)
[error] 157-157: Insert ··
(prettier/prettier)
[error] 158-158: Insert ··
(prettier/prettier)
[error] 159-159: Replace ··························
with ····························
(prettier/prettier)
[error] 160-160: Insert ··
(prettier/prettier)
[error] 161-161: Insert ··
(prettier/prettier)
[error] 162-166: Replace ····························<CopyToClipboard⏎······························getValue={()·=>⏎································snapshot.instructions·||·"No·instructions·available"⏎······························}⏎···························
with ······························<CopyToClipboard·getValue={()·=>·snapshot.instructions·||·"No·instructions·available"}
(prettier/prettier)
[error] 167-167: Insert ··
(prettier/prettier)
[error] 168-168: Replace ························
with ··························
(prettier/prettier)
[error] 169-169: Insert ··
(prettier/prettier)
[error] 170-170: Insert ··
(prettier/prettier)
[error] 171-171: Insert ··
(prettier/prettier)
🔇 Additional comments (3)
src/pages/nodes/start-here/syncing.mdx (1)
22-27
: LGTM! Clear and comprehensive instructions for multipart snapshots.
The alert effectively communicates the new multipart snapshot functionality and provides clear guidance for both manual and automated approaches.
src/components/Docs/components/NodeSnapshots.tsx (2)
19-23
: LGTM! Well-structured interface updates.
The Snapshot interface has been properly extended to support multipart functionality with clear, optional properties.
37-37
: LGTM! Endpoint updates align with new architecture.
The endpoint URLs have been correctly updated to use the new multipart archive structure.
Also applies to: 39-39
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: 2
🧹 Nitpick comments (1)
src/components/Docs/components/NodeSnapshots.tsx (1)
30-30
: Consider parameterizing snapshot typesThe endpoint paths contain hardcoded strings like "fullnode" and "archive-multipart". Consider extracting these as constants or configuration values for better maintainability.
+const SNAPSHOT_TYPES = { + FULLNODE: 'fullnode', + ARCHIVE_MULTIPART: 'archive-multipart' +} as const; const endpoints = [ - `${apiUrl}/testnet/fullnode/latest.json`, - `${apiUrl}/testnet/archive-multipart/latest.json`, - `${apiUrl}/mainnet/fullnode/latest.json`, - `${apiUrl}/mainnet/archive-multipart/latest.json`, + `${apiUrl}/testnet/${SNAPSHOT_TYPES.FULLNODE}/latest.json`, + `${apiUrl}/testnet/${SNAPSHOT_TYPES.ARCHIVE_MULTIPART}/latest.json`, + `${apiUrl}/mainnet/${SNAPSHOT_TYPES.FULLNODE}/latest.json`, + `${apiUrl}/mainnet/${SNAPSHOT_TYPES.ARCHIVE_MULTIPART}/latest.json`, ];Also applies to: 36-36, 38-38
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/components/Docs/components/NodeSnapshots.tsx
(5 hunks)src/pages/nodes/start-here/syncing.mdx
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/pages/nodes/start-here/syncing.mdx
🔇 Additional comments (3)
src/components/Docs/components/NodeSnapshots.tsx (3)
5-7
: LGTM: Clean interface updates for multipart support
The new interface fields and imports are well-structured and properly typed to support the multipart archive functionality.
Also applies to: 18-22
91-91
: LGTM: Simplified date formatting
The date formatting change appropriately simplifies the display to show only the date portion.
167-174
: Hardcoded base URL needs to be parameterized
The snapshot API URL is still hardcoded. This issue was previously identified and should be addressed.
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: 0
🧹 Nitpick comments (2)
src/pages/nodes/start-here/syncing.mdx (2)
22-27
: Enhance clarity of snapshot download instructionsWhile the instructions are generally clear, consider adding these essential details for a more complete user experience:
- Mention the expected total download size
- Indicate where the POSIX script will save the downloaded files
- Add a note about disk space requirements for both download and extraction
Our **archive snapshots** are now available in a **multipart** format. You can download each part individually by clicking **"Show Parts"** and selecting the desired one. Alternatively, you can streamline the process by copying the provided **POSIX download script**. This script automates **downloading, packing, and extracting** the full snapshot. Simply click the **"Copy to Clipboard"** icon below the parts list to copy the one-liner command and run it on a - terminal. + terminal. Ensure you have sufficient disk space for both downloading (~SIZE GB) and extraction (~SIZE GB) in your + ~/.zetacored directory.
29-31
: Add context about database backend compatibilityThe warning about the database backend is clear but could benefit from additional context about potential issues if mismatched.
<Alert variant="warning"> Snapshots database backend is **pebbledb**. Ensure that your node is configured to use the same backend to utilize our - snapshots. + snapshots. Using a different backend will result in snapshot restoration failure and may require you to start the sync + process from scratch. </Alert>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/pages/nodes/start-here/syncing.mdx
(1 hunks)
🔇 Additional comments (1)
src/pages/nodes/start-here/syncing.mdx (1)
22-27
: Verify UI element references
Let's verify that the UI elements mentioned in the documentation match the actual implementation in the NodeSnapshots component.
✅ Verification successful
The previous search was too specific. Let's try a broader search to find the relevant UI components and their text content. The new search will:
- Locate files containing NodeSnapshots component
- Search for case-insensitive patterns related to the UI elements mentioned in the docs
Let's examine the actual implementation of the NodeSnapshots component to verify the UI elements mentioned in the documentation. The previous command revealed the location of the component, now we'll inspect its contents.
UI elements match implementation
The documentation accurately reflects the actual UI implementation in the NodeSnapshots component:
- The "Show Parts" button is present (toggles to "Hide Parts" when clicked)
- The "Copy to Clipboard" functionality is implemented via the CopyToClipboard component
- Both elements appear in the correct context of the multipart snapshot download interface
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify UI elements in NodeSnapshots component
# Search for UI elements in the NodeSnapshots component
ast-grep --pattern 'Show Parts'
ast-grep --pattern 'Copy to Clipboard'
Length of output: 74
Script:
#!/bin/bash
# Search for files containing NodeSnapshots component
fd -e tsx -e jsx -e ts -e js NodeSnapshots
# Search for text patterns in the codebase that might indicate UI elements
rg -i "show.*parts|copy.*clipboard" --type ts --type tsx --type jsx
Length of output: 191
Script:
#!/bin/bash
# Let's examine the NodeSnapshots component content
cat src/components/Docs/components/NodeSnapshots.tsx
# Also search for any text content in the component using ripgrep
# Note: Using --type-add to properly handle TypeScript files
rg -i "show.*parts|copy.*clipboard" --type-add 'typescript:*.{ts,tsx}' --type typescript
Length of output: 7970
We have transitioned to a Multipart Archive schema to address static storage limitations.
The syncing page has been refactored to support and display these new multipart archive snapshots.
Summary by CodeRabbit
New Features
NodeSnapshots
component with new functionality for displaying snapshot sizes and links.Documentation