migrate from alchemy guide & migration section addition#742
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. WalkthroughAdds a new HyperIndex migration doc for migrating Alchemy Subgraphs to Envio’s HyperIndex and updates the HyperIndex sidebar to include a new "Migration" category. Changes
Sequence Diagram(s)(omitted — changes are documentation and sidebar configuration only; no runtime/control-flow modifications) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (3)
docs/HyperIndex/migrate-from-alchemy.md (3)
146-158: Convert indented code block to fenced code block.This code block uses indentation instead of fenced backticks, which is inconsistent with the rest of the document.
Based on static analysis hints
Apply this diff:
- The Graph - `eventHandler.ts` - - ```typescript - export function handleSubscription(event: SubscriptionEvent): void { - const subscription = new Subscribe(event.transaction.hash + event.logIndex); - - subscription.tokenId = event.params.tokenId; - subscription.address = event.params.subscriber.toHexString(); - subscription.logIndex = event.logIndex; - subscription.blockNumber = event.block.number; - subscription.position = event.params.tokenId; - - subscription.save(); - } - ``` +The Graph - `eventHandler.ts` + +```typescript +export function handleSubscription(event: SubscriptionEvent): void { + const subscription = new Subscribe(event.transaction.hash + event.logIndex); + + subscription.tokenId = event.params.tokenId; + subscription.address = event.params.subscriber.toHexString(); + subscription.logIndex = event.logIndex; + subscription.blockNumber = event.block.number; + subscription.position = event.params.tokenId; + + subscription.save(); +} +```
15-15: Consider hyphenating compound modifier."developer friendly" should be hyphenated as "developer-friendly" when used as a compound modifier before a noun.
Based on static analysis hints
-Migrating Alchemy Subgraphs to Envio's HyperIndex is a simple and developer friendly process. +Migrating Alchemy Subgraphs to Envio's HyperIndex is a simple and developer-friendly process.
20-20: Consider hyphenating compound modifier."High Speed Performance" should be hyphenated as "High-Speed Performance" when used as a compound modifier.
Based on static analysis hints
-- **High Speed Performance**: 143x faster than Subgraphs +- **High-Speed Performance**: 143x faster than Subgraphs
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
docs/HyperIndex/migrate-from-alchemy.md(1 hunks)sidebarsHyperIndex.js(1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/HyperIndex/migrate-from-alchemy.md
[grammar] ~15-~15: Use a hyphen to join words.
Context: ...o’s HyperIndex is a simple and developer friendly process. Alchemy Subgraphs foll...
(QB_NEW_EN_HYPHEN)
[grammar] ~20-~20: Use a hyphen to join words.
Context: ... Migrate to Envio’s HyperIndex? - High Speed Performance: 143x faster than Su...
(QB_NEW_EN_HYPHEN)
🪛 markdownlint-cli2 (0.18.1)
docs/HyperIndex/migrate-from-alchemy.md
146-146: Code block style
Expected: fenced; Actual: indented
(MD046, code-block-style)
| Start by spinning up a basic HyperIndex project with this command: | ||
|
|
||
| ```bash | ||
| pnpx envio init template --name alchemy-migration --directory alchemy-migration --template greeter --api-token "YOUR_ENVIO_API_KEY" |
There was a problem hiding this comment.
Remove extra space in command.
There's an extra space between "greeter" and "--api-token".
Apply this diff:
-pnpx envio init template --name alchemy-migration --directory alchemy-migration --template greeter --api-token "YOUR_ENVIO_API_KEY"
+pnpx envio init template --name alchemy-migration --directory alchemy-migration --template greeter --api-token "YOUR_ENVIO_API_KEY"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| pnpx envio init template --name alchemy-migration --directory alchemy-migration --template greeter --api-token "YOUR_ENVIO_API_KEY" | |
| pnpx envio init template --name alchemy-migration --directory alchemy-migration --template greeter --api-token "YOUR_ENVIO_API_KEY" |
🤖 Prompt for AI Agents
In docs/HyperIndex/migrate-from-alchemy.md around line 45, the CLI command
contains an extra space between the template name "greeter" and the
"--api-token" flag; remove that extra space so the flag is directly after the
template name (i.e., change "... --template greeter --api-token ..." to "...
--template greeter --api-token ...").
| <div className="row"> | ||
| <div className="col col--6"> | ||
| The Graph - `subgraph.yaml` | ||
| ```yaml | ||
| specVersion: 0.0.4 | ||
| description: Uniswap is a decentralized protocol for automated token exchange on Ethereum. | ||
| repository: https://github.com/Uniswap/v4-subgraph | ||
| schema: | ||
| file: ./schema.graphql | ||
| features: | ||
| - nonFatalErrors | ||
| - grafting | ||
| - kind: ethereum/contract | ||
| name: PositionManager | ||
| network: mainnet | ||
| source: | ||
| abi: PositionManager | ||
| address: "0xbD216513d74C8cf14cf4747E6AaA6420FF64ee9e" | ||
| startBlock: 21689089 | ||
| mapping: | ||
| kind: ethereum/events | ||
| apiVersion: 0.0.7 | ||
| language: wasm/assemblyscript | ||
| file: ./src/mappings/index.ts | ||
| entities: | ||
| - Position | ||
| abis: | ||
| - name: PositionManager | ||
| file: ./abis/PositionManager.json | ||
| eventHandlers: | ||
| - event: Subscription(indexed uint256,indexed address) | ||
| handler: handleSubscription | ||
| - event: Unsubscription(indexed uint256,indexed address) | ||
| handler: handleUnsubscription | ||
| - event: Transfer(indexed address,indexed address,indexed uint256) | ||
| handler: handleTransfer | ||
| ``` | ||
| </div> | ||
| <div className="col col--6"> | ||
| HyperIndex - `config.yaml` | ||
| ```yaml | ||
| # yaml-language-server: $schema=./node_modules/envio/evm.schema.json | ||
| name: uni-v4-indexer | ||
| networks: | ||
| - id: 1 | ||
| start_block: 21689089 | ||
| contracts: | ||
| - name: PositionManager | ||
| address: 0xbD216513d74C8cf14cf4747E6AaA6420FF64ee9e | ||
| handler: src/EventHandlers.ts | ||
| events: | ||
| - event: Subscription(uint256 indexed tokenId, address indexed subscriber) | ||
| - event: Unsubscription(uint256 indexed tokenId, address indexed subscriber) | ||
| - event: Transfer(address indexed from, address indexed to, uint256 indexed id) | ||
| ``` | ||
| </div> | ||
| </div> |
There was a problem hiding this comment.
Fix code block formatting in side-by-side comparison.
The code blocks in both columns have formatting issues. Lines 92 and 110 show closing backticks that appear misaligned. Ensure proper indentation and formatting for the markdown code blocks.
Based on static analysis hints
The closing code block markers should be properly indented to match the column structure:
- event: Transfer(indexed address,indexed address,indexed uint256)
handler: handleTransfer
- ```
+```
</div>And similarly for line 110:
- event: Transfer(address indexed from, address indexed to, uint256 indexed id)
- ```
+```
</div>🤖 Prompt for AI Agents
In docs/HyperIndex/migrate-from-alchemy.md around lines 56 to 112, the Markdown
code blocks inside the two side-by-side columns have their closing
triple-backtick markers misaligned (the closing backticks are placed inline with
the closing divs), which breaks rendering; move each closing ``` to its own line
immediately after the code block content and before the closing </div>, ensuring
the backticks are at the same indentation level as the opening backticks and
separated by a newline so each column's code block is properly closed.
| <div className="col col--6"> | ||
| HyperIndex - `eventHandler.ts` | ||
| ```typescript | ||
| PoolManager.Subscription.handler( async (event, context) => { |
There was a problem hiding this comment.
Fix contract name inconsistency.
The event handler uses PoolManager.Subscription.handler but the configuration example above uses PositionManager as the contract name. This inconsistency may confuse readers.
Apply this diff to match the config example:
- PoolManager.Subscription.handler( async (event, context) => {
+ PositionManager.Subscription.handler( async (event, context) => {📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| PoolManager.Subscription.handler( async (event, context) => { | |
| PositionManager.Subscription.handler( async (event, context) => { |
🤖 Prompt for AI Agents
In docs/HyperIndex/migrate-from-alchemy.md around line 164, update the event
handler to match the config example: replace the incorrect
PoolManager.Subscription.handler usage with PositionManager.Subscription.handler
so the contract name is consistent with the configuration shown above; ensure
any surrounding references to the contract name in nearby code examples are also
adjusted to PositionManager if needed.
| "migration-guide", | ||
| { | ||
| type: "category", | ||
| label: "Migration", | ||
| collapsed: false, | ||
| items: ["migration-guide", "migrate-from-alchemy"], | ||
| }, |
There was a problem hiding this comment.
Remove duplicate "migration-guide" entry.
The migration-guide appears twice in the sidebar: once as a standalone item on line 44 and again inside the Migration category on line 49. This creates duplicate navigation entries.
Apply this diff to remove the duplicate:
- "migration-guide",
{
type: "category",
label: "Migration",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "migration-guide", | |
| { | |
| type: "category", | |
| label: "Migration", | |
| collapsed: false, | |
| items: ["migration-guide", "migrate-from-alchemy"], | |
| }, | |
| { | |
| type: "category", | |
| label: "Migration", | |
| collapsed: false, | |
| items: ["migration-guide", "migrate-from-alchemy"], | |
| }, |
🤖 Prompt for AI Agents
In sidebarsHyperIndex.js around lines 44 to 50, there is a duplicate
"migration-guide" entry appearing once as a standalone item and again inside the
"Migration" category; remove the standalone "migration-guide" line (the first
occurrence) so it only appears once inside the Migration category to eliminate
the duplicate sidebar entry.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.
✏️ Tip: You can customize this high-level summary in your review settings.