-
Notifications
You must be signed in to change notification settings - Fork 6
docs: add local testing instructions for Web3 interactions #21
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -133,6 +133,23 @@ Open: | |
| http://localhost:3000 | ||
| ``` | ||
|
|
||
| ### Web3 Local Testing (Hardhat / Foundry) | ||
|
|
||
| When testing smart contract interactions locally, you need to run a local blockchain node (Anvil or Hardhat Node) alongside this Web UI. | ||
|
|
||
| 1. **Start the local blockchain** (in your smart contracts directory): | ||
| ```bash | ||
| # If using Foundry | ||
| anvil | ||
|
|
||
| # Or if using Hardhat | ||
| npx hardhat node | ||
| ``` | ||
| 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. | ||
|
Comment on lines
+148
to
+150
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 || trueRepository: StabilityNexus/Tectonic-EVM-WebUI Length of output: 2045 🌐 Web query:
💡 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 🧰 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 AgentsSource: Linters/SAST tools |
||
| 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`). | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🌐 Web query:
💡 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:
💡 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:
💡 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 🤖 Prompt for AI Agents |
||
|
|
||
| ## Build & Deployment | ||
|
|
||
| ### Production Build | ||
|
|
||
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.
📐 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
Source: Linters/SAST tools