Skip to content

docs: add local testing instructions for Web3 interactions - #21

Merged
DengreSarthak merged 1 commit into
StabilityNexus:mainfrom
ankitkr104:docs/local-testing
Jul 30, 2026
Merged

DengreSarthak merged 1 commit into
StabilityNexus:mainfrom
ankitkr104:docs/local-testing

Conversation

@ankitkr104

@ankitkr104 ankitkr104 commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Addressed Issues:

Fixes #(TODO:issue number)

Screenshots/Recordings:

TODO: If applicable, add screenshots or recordings that demonstrate the interface before and after the changes.

Additional Notes:

AI Usage Disclosure:

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.

Check one of the checkboxes below:

  • This PR does not contain AI-generated code at all.
  • This PR contains AI-generated code. I have read the AI Usage Policy and this PR complies with this policy. I have tested the code locally and I am responsible for it.

I have used the following AI models and tools: TODO

Checklist

  • My PR addresses a single issue, fixes a single bug or makes a single improvement.
  • My code follows the project's code style and conventions
  • If applicable, I have made corresponding changes or additions to the documentation
  • If applicable, I have made corresponding changes or additions to tests
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contribution Guidelines
  • Once I submit my PR, CodeRabbit AI will automatically review it and I will address CodeRabbit's comments.
  • I have filled this PR template completely and carefully, and I understand that my PR may be closed without review otherwise.

Summary by CodeRabbit

  • Documentation
    • Added instructions for testing Web3 interactions locally.
    • Documented how to run a local blockchain node, connect MetaMask, import a funded test account, and troubleshoot network or transaction issues.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Contributor documentation now describes local blockchain setup, MetaMask test-account configuration, network connection, cache resets, and Web3 interaction testing.

Changes

Web3 testing documentation

Layer / File(s) Summary
Local Web3 testing workflow
README.md, CONTRIBUTING.md
Adds instructions for running Anvil or Hardhat, importing a pre-funded test account, connecting MetaMask to Localhost 8545, clearing network cache, and testing Web3 interactions.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

Suggested labels: Documentation

Poem

I hopped through docs with ears held high,
Beside a local chain beneath the sky.
A test key tucked in MetaMask bright,
Localhost transactions now take flight.
Binky-bounce, the setup’s right!

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding documentation for local Web3 interaction testing.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Around line 140-147: Update the “Start the local blockchain” section in
README.md by adding blank lines immediately before and after its fenced bash
code block, preserving the existing commands and surrounding text.
- Around line 148-150: Add an explicit warning to the wallet-funding
instructions near the example Anvil private key stating that it is publicly
known and localhost-only; instruct users to verify MetaMask is connected to
Localhost 8545 before signing and never use the key on testnets or mainnet.
- Line 151: Update the MetaMask troubleshooting step in the README to use
Settings → Developer tools → Clear activity and nonce data, and clarify that it
only clears history and nonces for stuck or pending transactions on the
currently selected network; state that it does not resolve wrong-network
discovery or an unfunded account.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 9fcc6898-307a-4961-a2f6-964c72cbd972

📥 Commits

Reviewing files that changed from the base of the PR and between f5f1013 and a431721.

📒 Files selected for processing (2)
  • CONTRIBUTING.md
  • README.md

Comment thread README.md
Comment on lines +140 to +147
1. **Start the local blockchain** (in your smart contracts directory):
```bash
# If using Foundry
anvil

# Or if using Hardhat
npx hardhat node
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add blank lines around the fenced code block.

This block triggers markdownlint MD031. Insert a blank line before Line 141 and after Line 147 so the documentation passes the configured Markdown checks.

🧰 Tools
🪛 markdownlint-cli2 (0.23.0)

[warning] 141-141: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


[warning] 147-147: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 140 - 147, Update the “Start the local blockchain”
section in README.md by adding blank lines immediately before and after its
fenced bash code block, preserving the existing commands and surrounding text.

Source: Linters/SAST tools

Comment thread README.md
Comment on lines +148 to +150
2. **Fund your wallet**: The local node generates pre-funded test accounts with 10,000 ETH. Since your personal MetaMask address has 0 ETH on the local network, you must import one of the test private keys to interact with the dApp.
- Example private key: `0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80`
- In MetaMask: `Accounts` -> `Add account or hardware wallet` -> `Import account` -> Paste the private key.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== README snippet =="
sed -n '130,160p' README.md || true

echo
echo "== repo contains matching key / references =="
rg -n "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80|localhost|mainnet|testnet|localhost network|public network|MetaMask" README.md || true

Repository: StabilityNexus/Tectonic-EVM-WebUI

Length of output: 2045


🌐 Web query:

Foundry Anvil default private keys publicly known localhost only documentation

💡 Result:

The default private keys used by Anvil, the local Ethereum development node included with Foundry, are publicly known and are intended solely for local development and testing purposes [1][2]. Key facts regarding Anvil's security and default configuration: 1. Known Default Keys: When Anvil starts, it generates 10 pre-funded accounts with 10,000 ETH each using a deterministic, well-known BIP39 mnemonic: test test test test test test test test test test test junk [1][3]. Consequently, the private keys for these accounts are the same every time Anvil is launched in its default state [2]. 2. Development Use Only: These default keys are explicitly documented as insecure for any use outside of local development [4][2]. You should never use these keys, or any other keys derived from the default mnemonic, on mainnet or any other public network, as they are accessible to anyone [2]. 3. Localhost Binding: By default, Anvil binds its RPC server to the local loopback interface (typically 127.0.0.1) [2][5]. This restricts access to the node—and by extension, the ability to use its pre-funded accounts—to processes running on the same machine [2][5]. 4. Security Recommendations: The standard practice is to use these default keys only for testing environments [4][2]. For production-ready environments or any situation involving real assets, you should use secure key management practices, such as hardware wallets, encrypted keystores, or other secure storage solutions, and ensure that different keys are used for different environments [4][2].

Citations:


Mark the imported Anvil key as localhost-only and publicly known.

This is a well-known Anvil default key, not a production secret. Add an explicit warning at README.md:149 to verify MetaMask is on Localhost 8545 before signing and never use this key on testnets or mainnet.

🧰 Tools
🪛 Betterleaks (1.6.1)

[high] 149-149: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 148 - 150, Add an explicit warning to the
wallet-funding instructions near the example Anvil private key stating that it
is publicly known and localhost-only; instruct users to verify MetaMask is
connected to Localhost 8545 before signing and never use the key on testnets or
mainnet.

Source: Linters/SAST tools

Comment thread README.md
2. **Fund your wallet**: The local node generates pre-funded test accounts with 10,000 ETH. Since your personal MetaMask address has 0 ETH on the local network, you must import one of the test private keys to interact with the dApp.
- Example private key: `0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80`
- In MetaMask: `Accounts` -> `Add account or hardware wallet` -> `Import account` -> Paste the private key.
3. Make sure MetaMask is connected to `Localhost 8545`. If your balance still shows 0 or transactions fail, try resetting the network cache in MetaMask (`Settings` -> `Advanced` -> `Clear activity tab data`).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

MetaMask reset account Settings Developer tools Delete activity and nonce data Clear activity tab data

💡 Result:

The "Clear activity and nonce data" feature (formerly known as "Reset account" in the extension) is a function in MetaMask that wipes your transaction history and resets the account's nonce for the current network [1][2][3]. It is primarily intended to resolve stuck or pending transactions by clearing the wallet's internal queue of transactions that have not yet been confirmed on the blockchain [4][1][5]. Key points regarding this feature: Functionality: It clears the transaction history and resets the nonce only for the network you are currently viewing [4][6]. It does not affect your account balances, your Secret Recovery Phrase, or your private keys [6][7][8]. Transactions on other networks remain unaffected [4][3]. Terminology: In the MetaMask Extension (since version 10.28.1), this feature is explicitly labeled "Clear activity and nonce data" [1][2]. On MetaMask Mobile, it may still be referred to as "Reset account" [1][2]. Access: You can generally find this by navigating to Settings, then Advanced [9][3]. While some documentation or third-party guides may refer to a "Developer tools" section or "Clear activity tab data" button, the standard path is usually through the Advanced settings menu [4][7][3]. Cautions: MetaMask recommends only using this feature if strictly necessary or when instructed by a support agent [4][1]. Because it is irreversible, users are often advised to download their state logs beforehand for troubleshooting purposes [4][3]. It is important to distinguish this from "Resetting your wallet," which is a separate process that removes all wallets and accounts from the MetaMask instance, requiring you to restore them using your Secret Recovery Phrase [1][8].

Citations:


🌐 Web query:

site:support.metamask.io Clear activity and nonce data Developer tools

💡 Result:

The Clear activity and nonce data function is a feature in the MetaMask extension designed to wipe an account's transaction history, including any locally stored knowledge of pending transactions [1][2]. This feature is primarily intended for developers who may need to clear activity on a test network while maintaining the same account [3][4]. Key details regarding this feature include: Usage: It is generally used to resolve stuck or pending transactions [3][1]. Because the action is irreversible and affects only the current network, it should be used with caution and only when necessary [3][4]. Location: In the MetaMask extension, this can be found by navigating to Settings followed by Developer tools [3][4]. Distinction from Reset Wallet: Clearing activity and nonce data does not remove your wallet from the software or affect your Secret Recovery Phrase; it only clears transaction history [1][5]. This is distinct from resetting your wallet, which removes all accounts and wallets from the application entirely, requiring a restoration via Secret Recovery Phrase [5]. Important Considerations: - It only impacts the specific network currently selected (e.g., if you are on BNB Chain, it does not affect Ethereum transactions) [3][4]. - It is recommended to download your state logs before performing this action to assist in troubleshooting if needed [3][4]. - As of version 10.28.1, the feature in the extension was renamed from Reset account to Clear activity and nonce data [1][2]. On MetaMask Mobile, the feature may still be labeled as Reset account [1][2].

Citations:


🌐 Web query:

site:support.metamask.io Clear activity tab data MetaMask

💡 Result:

To clear your activity history in MetaMask, you must use the "Clear activity and nonce data" feature (formerly known as "Reset account") [1][2]. This process wipes your transaction history from the MetaMask interface, including the application's knowledge of pending transactions [1][2]. MetaMask recommends using this feature only when strictly necessary, such as when dealing with stuck or pending transactions that are not visible on a block explorer [3][1][2]. It is strongly advised to perform this only when instructed by a MetaMask support agent [3][1][2]. To perform this action: 1. Open your MetaMask Extension or Mobile app [3]. 2. Navigate to the Settings menu [3]. 3. Locate the "Developer tools" section [3]. 4. Click or tap the "Clear activity and nonce data" button (or "Reset account" on some mobile versions) [3][1][2]. Important Considerations: - Irreversibility: Clearing your activity is an irreversible action [3]. - Data Preservation: This process does not delete your wallet, funds, or account access; it only removes the local record of your transaction history [4][5]. - Troubleshooting: Before clearing activity, MetaMask recommends downloading your state logs to help support agents troubleshoot any issues [3]. - Distinguish from Wallet Reset: Do not confuse this with "Reset Wallet," which completely removes your wallets and accounts from the device and requires your Secret Recovery Phrase to restore [4][2][5].

Citations:


Update the MetaMask activity reset instructions.

Replace Settings → Advanced → Clear activity tab data with Settings → Developer tools → Clear activity and nonce data, and clarify that this only clears history/nonces for a stuck or pending transaction on the currently selected network; it will not fix wrong-network discovery or an unfunded account.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` at line 151, Update the MetaMask troubleshooting step in the
README to use Settings → Developer tools → Clear activity and nonce data, and
clarify that it only clears history and nonces for stuck or pending transactions
on the currently selected network; state that it does not resolve wrong-network
discovery or an unfunded account.

@DengreSarthak
DengreSarthak merged commit 323efa7 into StabilityNexus:main Jul 30, 2026
5 checks passed
@ankitkr104 ankitkr104 added the GSoC 2026 Work completed under GSoC 2026 label Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GSoC 2026 Work completed under GSoC 2026

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants