Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 24, 2025

This PR enhances the fork mode documentation to make blockchain forking concepts more accessible to developers by adding plain-English explanations, real-world examples, and comprehensive guidance.

Key Improvements

Enhanced Code Examples

  • Added missing import statements (BaseActionType) in documentation examples
  • Improved code comments to explain real-world interactions with DeFi protocols like Aave and Uniswap
  • Added proper balance configuration with explanations for gas and transaction costs
  • Made examples more descriptive about how tests interact with actual mainnet contracts and data

Beginner-Friendly Guidance

  • Added "Getting Started Tips" section in docs/node/configuration.mdx with practical advice for newcomers
  • Provided step-by-step guidance on chain ID matching, balance configuration, and RPC provider selection
  • Included beginner-friendly fork setup example using demo endpoints

Expanded RPC Provider Information

  • Enhanced RPC provider section with specific endpoints and recommendations
  • Added detailed comparison of providers (Alchemy, Infura, QuickNode, public endpoints)
  • Included guidance on choosing providers for different use cases (testing vs production)

GitHub Actions Integration

  • Added Copilot setup workflow at .github/workflows/copilot-setup-steps.yml
  • Configured automatic dependency installation and Node.js setup for Copilot operations
  • Supports manual workflow triggers through the GitHub Actions tab

Files Enhanced

README.md: Improved the main fork mode example with better comments explaining real blockchain interactions

docs/node/overview.mdx: Enhanced DeFi and NFT testing examples with missing imports and clearer explanations of real-world usage

docs/node/configuration.mdx: Added comprehensive beginner guidance and expanded RPC provider recommendations

.github/workflows/copilot-setup-steps.yml: New GitHub Actions workflow for automated Copilot setup steps

Example of Improvements

Before:

// Fork from Ethereum mainnet
const test = createOnchainTest(
  configure()
    .withLocalNode({
      fork: 'https://eth-mainnet.g.alchemy.com/v2/your-api-key',
      chainId: 1,
    })

After:

// Fork Ethereum mainnet for testing with real contracts and data
const test = createOnchainTest(
  configure()
    .withLocalNode({
      fork: 'https://eth-mainnet.g.alchemy.com/v2/your-api-key',
      forkBlockNumber: 18500000, // Optional: fork from specific block for reproducible tests
      chainId: 1,
      // Fund test accounts with sufficient ETH for transactions
      balance: '100000000000000000000', // 100 ETH per account
    })

The documentation now provides a much more accessible entry point for developers new to blockchain forking while maintaining comprehensive technical depth for advanced use cases. The added GitHub Actions workflow ensures proper setup for Copilot operations.

Fixes #2.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] ## Pull Request Overview Enhance fork mode documentation with improved examples and clearer explanations Sep 24, 2025
Copilot AI requested a review from joe10832 September 24, 2025 09:16
Copy link
Member

@joe10832 joe10832 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joe10832 joe10832 marked this pull request as ready for review September 24, 2025 11:10
Copilot AI review requested due to automatic review settings September 24, 2025 11:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances fork mode documentation to make blockchain forking more accessible by adding clearer explanations, improved code examples, and beginner-friendly guidance. The documentation now better explains how fork mode enables testing with real blockchain data and contracts.

  • Added comprehensive beginner guidance with practical setup tips and step-by-step instructions
  • Enhanced code examples with missing imports, better comments explaining real-world blockchain interactions, and proper balance configurations
  • Expanded RPC provider information with specific recommendations and comparisons between different services

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
docs/node/overview.mdx Enhanced DeFi and NFT testing examples with missing imports, clearer comments about real blockchain interactions, and improved balance configurations
docs/node/configuration.mdx Added comprehensive "Getting Started Tips" section with beginner-friendly examples and expanded RPC provider recommendations
README.md Improved main fork mode example with better comments explaining real blockchain interactions and balance configuration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get - [ ] started. @copilot

Copilot AI requested a review from joe10832 September 24, 2025 11:11
@joe10832 joe10832 linked an issue Sep 24, 2025 that may be closed by this pull request
Copy link
Member

@joe10832 joe10832 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@joe10832 joe10832 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joe10832
Copy link
Member

/.github/copilot-instructions.md
/.github/instructions/**/*.instructions.md
**/AGENTS.md
/CLAUDE.md
/GEMINI.md
This pull request improves the documentation and setup experience for using fork mode with real mainnet data in on-chain testing. It adds a dedicated GitHub Actions workflow for validating Copilot setup steps, enhances the clarity and depth of fork mode documentation, and provides practical tips and beginner-friendly configuration examples.

Documentation improvements for fork mode:

  • Expanded code examples in README.md and docs/node/overview.mdx to clarify how to configure fork mode with real mainnet contracts, set up sufficient ETH balances for test accounts, and interact with actual DeFi and NFT contracts. [1] [2] [3] [4] [5] [6]
  • Added a new "Getting Started Tips" section and a beginner-friendly fork setup example in docs/node/configuration.mdx to help new users quickly get started with fork mode.
  • Improved provider selection guidance in docs/node/configuration.mdx, detailing the pros and cons of Alchemy, Infura, QuickNode, public endpoints, and local archive nodes.

Workflow and setup automation:

  • Introduced a new GitHub Actions workflow (.github/workflows/copilot-setup-steps.yml) to automatically validate Copilot setup steps on changes and enable manual testing via the Actions tab. This ensures that setup steps remain correct and reproducible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment