From d02b5e431784aa64733f4085964c44a4ac3dee44 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Thu, 28 Nov 2024 14:47:17 -0600 Subject: [PATCH 1/5] chore: rebrand to anvil-zksync --- .github/CODEOWNERS | 2 +- .../40.tooling/20.hardhat/00.index.md | 2 +- .../30.plugins/120.hardhat-zksync-node.md | 2 +- .../30.plugins/130.other-plugins.md | 2 +- .../60.test-and-debug/20.in-memory-node.md | 95 +++++++++++-------- .../30.continuous-integration.md | 32 +++---- .../00.build/60.test-and-debug/40.hardhat.md | 14 +-- .../95.resources/60.contribution-track.md | 2 +- .../95.resources/70.community-channels.md | 2 +- 9 files changed, 83 insertions(+), 70 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d150257f..66f7b3e1 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,4 +1,4 @@ -# This CODEOWNERS file sets the individuals responsible for code in the era-test-node repository. +# This CODEOWNERS file sets the individuals responsible for code in the zksync-docs repository. # These users are the default owners for everything in the repo. # They will be requested for review when someone opens a pull request. diff --git a/content/00.build/40.tooling/20.hardhat/00.index.md b/content/00.build/40.tooling/20.hardhat/00.index.md index 569d5353..5084ecaf 100644 --- a/content/00.build/40.tooling/20.hardhat/00.index.md +++ b/content/00.build/40.tooling/20.hardhat/00.index.md @@ -33,4 +33,4 @@ as needed in your project. This should be the primary plugin most developers wil - [@matterlabs/hardhat-zksync-upgradable](/build/tooling/hardhat/plugins/hardhat-zksync-upgradable) - used to deploy, update, and verify proxy smart contracts. - [@matterlabs/hardhat-zksync-ethers](/build/tooling/hardhat/plugins/hardhat-zksync-ethers) - wrapper around zksync-ethers with some extra Hardhat-specific functionality. -- [@matterlabs/hardhat-zksync-node](/build/tooling/hardhat/plugins/hardhat-zksync-node) - used to run the ZKsync era-test-node locally. +- [@matterlabs/hardhat-zksync-node](/build/tooling/hardhat/plugins/hardhat-zksync-node) - used to run the ZKsync anvil-zksync locally. diff --git a/content/00.build/40.tooling/20.hardhat/30.plugins/120.hardhat-zksync-node.md b/content/00.build/40.tooling/20.hardhat/30.plugins/120.hardhat-zksync-node.md index c9f11b29..95ba6621 100644 --- a/content/00.build/40.tooling/20.hardhat/30.plugins/120.hardhat-zksync-node.md +++ b/content/00.build/40.tooling/20.hardhat/30.plugins/120.hardhat-zksync-node.md @@ -80,7 +80,7 @@ The command also handles tasks such as downloading the necessary JSON-RPC server - `--port` - Port on which the server should listen. Defaults to 8011. - `--log` - Log filter level. Accepted values are: error, warn, info, and debug. Defaults to info. -- `--log-file-path` - Path to the file where logs should be written. Defaults to `era_test_node.log`. +- `--log-file-path` - Path to the file where logs should be written. Defaults to `anvil_zksync.log`. - `--cache` - Type of cache to use. Accepted values are: none, disk, and memory. Defaults to disk. - `--cache-dir` - Directory location for the `disk` cache. Defaults to `.cache`. - `--reset-cache` - Flag to reset the local `disk` cache. diff --git a/content/00.build/40.tooling/20.hardhat/30.plugins/130.other-plugins.md b/content/00.build/40.tooling/20.hardhat/30.plugins/130.other-plugins.md index 2b0cd337..23902882 100644 --- a/content/00.build/40.tooling/20.hardhat/30.plugins/130.other-plugins.md +++ b/content/00.build/40.tooling/20.hardhat/30.plugins/130.other-plugins.md @@ -83,7 +83,7 @@ such as `loadFixture` to be utilized in test files. ::callout{icon="i-heroicons-exclamation-triangle" color="amber"} Although methods like `hardhat_impersonateAccount` or `hardhat_setBalance` are supported, other RPC methods might not be supported by the In-Memory Node. -Please [check the list of suported APIs](https://github.com/matter-labs/era-test-node/blob/main/SUPPORTED_APIS.md). +Please [check the list of suported APIs](https://github.com/matter-labs/anvil-zksync/blob/main/SUPPORTED_APIS.md). :: diff --git a/content/00.build/60.test-and-debug/20.in-memory-node.md b/content/00.build/60.test-and-debug/20.in-memory-node.md index f7c812eb..059be240 100644 --- a/content/00.build/60.test-and-debug/20.in-memory-node.md +++ b/content/00.build/60.test-and-debug/20.in-memory-node.md @@ -1,13 +1,13 @@ --- title: In-Memory Node -description: Learn how to setup a local in-memory era_test_node. +description: Learn how to setup a local in-memory anvil-zksync. --- -This section provides instructions on setting up and using the In-Memory Node, `era_test_node`, for local testing. +This section provides instructions on setting up and using the In-Memory Node, `anvil-zksync`, for local testing. It covers installation, network forking, transaction details viewing, replaying transactions, and testing local bootloader and system contracts. ::callout{icon="i-heroicons-information-circle-16-solid" color="amber"} -Please keep in mind that `era-test-node` is still in its **alpha** stage, +Please keep in mind that `anvil-zksync` is still in its **alpha** stage, some features might not be fully supported yet and may not work as fully intended. It is [open-sourced](%%zk_git_repo_era-test-node%%) and contributions are welcomed. :: @@ -18,7 +18,7 @@ The In-Memory Node uses an in-memory database for storing state information and In fork mode, it retrieves missing storage data from a remote source when not available locally. Moreover it also uses the remote server (openchain) to resolve the ABI and topics to human readable names. -You can visit the `era-test-node` repository [to learn more](%%zk_git_repo_era-test-node%%). +You can visit the `anvil-zksync` repository [to learn more](%%zk_git_repo_era-test-node%%). ## Run actions with `zksync-cli` @@ -27,39 +27,52 @@ If you don't have `zksync-cli` setup, see the [Overview](/build/zksync-cli) guid Note: at the moment this method won't allow you to use additional features like forking networks or replaying transactions. -## Install and set up `era_test_node` +## Install and set up `anvil-zksync` -1. Download `era_test_node` from latest [Release](%%zk_git_repo_era-test-node%%/releases/latest). +1. Download `anvil-zksync` from latest [Release](%%zk_git_repo_era-test-node%%/releases/latest). 1. Extract the binary and mark as executable: ```bash - tar xz -f /path/to/downloaded/binary/era_test_node.tar.gz -C /usr/local/bin/ - chmod +x /usr/local/bin/era_test_node + tar xz -f /path/to/downloaded/binary/anvil-zksync.tar.gz -C /usr/local/bin/ + chmod +x /usr/local/bin/anvil-zksync ``` 1. Start the node: ```bash - era_test_node run + anvil-zksync run ``` The expected output will be as follows: ```sh -12:34:56 [INFO] Starting network with chain id: L2ChainId(260) -12:34:56 [INFO] Rich Accounts -12:34:56 [INFO] ============= -12:34:56 [INFO] Account #0: 0x36615Cf349d7F6344891B1e7CA7C72883F5dc049 (1_000_000_000_000 ETH) -12:34:56 [INFO] Private Key: 0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110 -12:34:56 [INFO] -12:34:56 [INFO] Account #1: 0xa61464658AfeAf65CccaaFD3a512b69A83B77618 (1_000_000_000_000 ETH) -12:34:56 [INFO] Private Key: 0xac1e735be8536c6534bb4f17f06f6afc73b2b5ba84ac2cfb12f7461b20c0bbe3 - + _ _ _____ _ __ + __ _ _ __ __ __(_)| | |__ /| |/ / ___ _ _ _ __ ___ + / _` || '_ \ \ \ / /| || | _____ / / | ' / / __|| | | || '_ \ / __| +| (_| || | | | \ V / | || ||_____| / /_ | . \ \__ \| |_| || | | || (__ + \__,_||_| |_| \_/ |_||_| /____||_|\_\|___/ \__, ||_| |_| \___| + |___/ + +testing +18:02:50 INFO Version: 0.1.0-alpha.34 +18:02:50 INFO Repository: https://github.com/matter-labs/era-test-node + + +18:02:50 INFO Rich Accounts +18:02:50 INFO ======================== +18:02:50 INFO (0) 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 (10000 ETH) +18:02:50 INFO (1) 0x70997970C51812dc3A010C7d01b50e0d17dc79C8 (10000 ETH) +18:02:50 INFO (2) 0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC (10000 ETH) +18:02:50 INFO (3) 0x90F79bf6EB2c4f870365E785982E1f101E93b906 (10000 ETH) +18:02:50 INFO (4) 0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65 (10000 ETH) +18:02:50 INFO (5) 0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc (10000 ETH) +18:02:50 INFO (6) 0x976EA74026E726554dB657fA54763abd0C3a0aa9 (10000 ETH) +18:02:50 INFO (7) 0x14dC79964da2C08b23698B3D3cc7Ca32193d9955 (10000 ETH) +18:02:50 INFO (8) 0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f (10000 ETH) +18:02:50 INFO (9) 0xa0Ee7A142d267C1f36714E4a8F75612F20a79720 (10000 ETH) +... ... - -12:34:56 [INFO] Account #9: 0xE90E12261CCb0F3F7976Ae611A29e84a6A85f424 (1_000_000_000_000 ETH) -12:34:56 [INFO] Private Key: 0x3eb15da85647edd9a1159a4a13b9e7c56877c4eb33f614546d4db06a51868b1c 12:34:56 [INFO] 12:34:56 [INFO] ======================================== 12:34:56 [INFO] Node is ready at 127.0.0.1:8011 @@ -67,14 +80,14 @@ The expected output will be as follows: ``` ::callout{icon="i-heroicons-information-circle-16-solid" color="amber"} -When utilizing `era_test_node` with MetaMask, it's essential to note that any restart of the in-memory node +When utilizing `anvil-zksync` with MetaMask, it's essential to note that any restart of the in-memory node will necessitate a reset of MetaMask's cached account data (nonce, etc). In the MetaMask app, navigate to 'Settings', then 'Advanced', and finally, select 'Clear activity tab data'. :: ### Network details -The `era_test_node` has the following default network configurations: +The `anvil-zksync` has the following default network configurations: - **L2 RPC:** `http://localhost:8011` - **Network Id:** 260 @@ -96,11 +109,11 @@ In-Memory node includes pre-configured "rich" accounts for testing: ## Debug Transactions & Smart Contracts -The default configuration of `era_test_node` displays minimal data in the terminal to keep the output clean. +The default configuration of `anvil-zksync` displays minimal data in the terminal to keep the output clean. However, if you are having issues with your smart contracts and need more details why a transaction is failing, try enabling `--debug-mode` (or just `-d`). ```bash -era_test_node -d +anvil-zksync -d ``` This will: @@ -116,7 +129,7 @@ This will: To fork the mainnet, use the following command, replacing `[network]` with either `mainnet` or `sepolia-testnet`: ```bash -era_test_node fork [network] +anvil-zksync fork [network] ``` ::drop-panel @@ -155,7 +168,7 @@ This command starts the node, forked at the current head of the selected network You also have the option to specify a custom http endpoint and a custom forking height: ```bash -era_test_node fork --fork-at 7000000 mainnet http://172.17.0.3:3060 +anvil-zksync fork --fork-block-number 7000000 --fork-url mainnet http://172.17.0.3:3060 ``` --- @@ -164,14 +177,14 @@ era_test_node fork --fork-at 7000000 mainnet http://172.17.0.3:3060 If you wish to replay a remote transaction locally for deep debugging, use the following command: ```bash -era_test_node replay_tx sepolia-testnet 0x7119045573862797257e4441ff48bf5a3bc4d133a00d167c18dc955eda12cfac +anvil-zksync replay_tx sepolia-testnet 0x7119045573862797257e4441ff48bf5a3bc4d133a00d167c18dc955eda12cfac ``` For more detailed transaction information, such as call traces, add the `--show-calls` flag. If you want to see ABI names, add the `--resolve-hashes` flag: ```bash -era_test_node --show-calls=user \ +anvil-zksync --show-calls=user \ --resolve-hashes replay_tx sepolia-testnet \ 0x7119045573862797257e4441ff48bf5a3bc4d133a00d167c18dc955eda12cfac ``` @@ -180,7 +193,7 @@ Alternatively (if your node is already running) you can use `config_setShowCalls to configure these values: ```bash -# era_test_node already running... +# anvil-zksync already running... # Set show-calls to User curl --request POST \ @@ -261,12 +274,12 @@ Here's an example of what you should expect to see when `show-calls` and `resolv --- ## Send network calls -You can send network calls against a running `era_test_node`. +You can send network calls against a running `anvil-zksync`. Launch the local in-memory node: ```bash - era_test_node fork sepolia-testnet + anvil-zksync fork sepolia-testnet ``` - Use curl to send a network call: @@ -362,11 +375,11 @@ This makes it possible to examine the effects of changes on already deployed con ::callout{icon="i-heroicons-information-circle-16-solid" color="amber"} These commands assume you have set `$ZKSYNC_HOME` in your shell profile file -(e.g. ~/.bash_profile, ~/.zshrc) to target your local copy of `era_test_node`. +(e.g. ~/.bash_profile, ~/.zshrc) to target your local copy of `anvil-zksync`. For instance, ```bash -export ZKSYNC_HOME=/path/to/era_test_node +export ZKSYNC_HOME=/path/to/anvil-zksync export PATH=$ZKSYNC_HOME/bin:$PATH ``` @@ -383,12 +396,12 @@ export PATH=$ZKSYNC_HOME/bin:$PATH 1. To use the locally compiled bootloader and system contracts, run: ```bash - RUST_LOG=vm=trace era_test_node --dev-use-local-contracts fork sepolia-testnet + RUST_LOG=vm=trace anvil-zksync --dev-use-local-contracts fork sepolia-testnet ``` ## Writing and running tests locally -This section demonstrates how to author and execute tests locally against `era_test_node` using the `mocha` and `chai` testing frameworks with Hardhat. +This section demonstrates how to author and execute tests locally against `anvil-zksync` using the `mocha` and `chai` testing frameworks with Hardhat. ### Project configuration @@ -427,7 +440,7 @@ This script makes it possible to run tests in a Hardhat environment with the `NO Adjust `hardhat.config.ts` to use the local node for testing: ::callout{icon="i-heroicons-information-circle-16-solid" color="amber"} -Ensure `era_test_node` is running in another process before executing the test command. +Ensure `anvil-zksync` is running in another process before executing the test command. :: ```typescript [hardhat.config.ts] @@ -508,21 +521,21 @@ To run the test file, execute: ``` :: -Well done! You've successfully run your first local tests with ZKsync Era and `era_test_node`. +Well done! You've successfully run your first local tests with ZKsync Era and `anvil-zksync`. --- ## Troubleshooting -If running `era_test_node run` provides the following error: +If running `anvil-zksync run` provides the following error: ```sh -“era_test_node” can’t be opened because Apple cannot check it for malicious software. +“anvil-zksync” can’t be opened because Apple cannot check it for malicious software. This software needs to be updated. Contact the developer for more information. ``` You may require the use of `sudo`. On macOS, the binary may need to have its quarantine attribute cleared: ```sh -xattr -d com.apple.quarantine /usr/local/bin/era_test_node +xattr -d com.apple.quarantine /usr/local/bin/anvil-zksync ``` diff --git a/content/00.build/60.test-and-debug/30.continuous-integration.md b/content/00.build/60.test-and-debug/30.continuous-integration.md index ad216599..d7a426a9 100644 --- a/content/00.build/60.test-and-debug/30.continuous-integration.md +++ b/content/00.build/60.test-and-debug/30.continuous-integration.md @@ -1,12 +1,12 @@ --- title: Continuous Integration -description: Use a GitHub Action to integrate era-test-node into your CI/CD environment. +description: Use a GitHub Action to integrate anvil-zksync into your CI/CD environment. --- -A GitHub Action is available for integrating `era-test-node` into your CI/CD environments. +A GitHub Action is available for integrating `anvil-zksync` into your CI/CD environments. This action offers high configurability and streamlines the process of testing your applications in an automated way. -You can find the GitHub Action available in the [marketplace](https://github.com/marketplace/actions/era-test-node-action). +You can find the GitHub Action available in the [marketplace](https://github.com/marketplace/actions/anvil-zksync-action). ::callout{icon="i-heroicons-light-bulb" color="blue"} In CI tests, use `127.0.0.1` as the URL in hardhat.config.ts or for the provider to avoid '**Cannot connect to network**' errors. @@ -26,9 +26,9 @@ In CI tests, use `127.0.0.1` as the URL in hardhat.config.ts or for the provider | `showGasDetails` | Gas details visibility. | No | `none` | `none`, `all` | | `resolveHashes` | Enable hash resolution. | No | `false` | - | | `log` | Log filter level. | No | `info` | `debug`, `info`, `warn`, `error` | -| `logFilePath` | Path for the log file. | No | `era_test_node.log` | - | +| `logFilePath` | Path for the log file. | No | `anvil-zksync.log` | - | | `target` | Target architecture. | No | `x86_64-unknown-linux-gnu` | `x86_64-unknown-linux-gnu`, `x86_64-apple-darwin`, `aarch64-apple-darwin` | -| `version` | Version of `era_test_node`. | No | `latest` | - | +| `version` | Version of `anvil-zksync`. | No | `latest` | - | --- @@ -53,8 +53,8 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - - name: Run Era Test Node - uses: dutterbutter/era-test-node-action@latest + - name: Run anvil-zksync + uses: dutterbutter/anvil-zksync-action@v1 ``` ### Advanced @@ -77,7 +77,7 @@ jobs: uses: actions/checkout@v3 - name: Run Era Test Node - uses: dutterbutter/era-test-node-action@latest + uses: dutterbutter/anvil-zksync-action@v1 with: mode: "run" showCalls: "user" @@ -86,7 +86,7 @@ jobs: showGasDetails: "all" resolveHashes: "true" log: "info" - logFilePath: "era_test_node.log" + logFilePath: "anvil-zksync.log" target: "x86_64-unknown-linux-gnu" ``` @@ -112,7 +112,7 @@ jobs: uses: actions/checkout@v3 - name: Run Era Test Node - uses: dutterbutter/era-test-node-action@latest + uses: dutterbutter/anvil-zksync-action@v1 with: mode: "fork" network: "mainnet" @@ -123,7 +123,7 @@ jobs: showGasDetails: "all" resolveHashes: "true" log: "info" - logFilePath: "era_test_node.log" + logFilePath: "anvil-zksync.log" target: "x86_64-unknown-linux-gnu" releaseTag: "latest" @@ -134,11 +134,11 @@ jobs: run: | yarn test:contracts - - name: Upload era_test_node log + - name: Upload anvil-zksync log uses: actions/upload-artifact@v3 with: - name: era_test_node-log - path: era_test_node.log + name: anvil-zksync-log + path: anvil-zksync.log ``` With Fork: @@ -159,7 +159,7 @@ jobs: uses: actions/checkout@v3 - name: Run Era Test Node - uses: dutterbutter/era-test-node-action@latest + uses: dutterbutter/anvil-zksync-action@v1 with: mode: "fork" network: "mainnet" @@ -170,7 +170,7 @@ jobs: showGasDetails: "all" resolveHashes: "true" log: "info" - logFilePath: "era_test_node.log" + logFilePath: "anvil-zksync.log" target: "x86_64-unknown-linux-gnu" releaseTag: "latest" ``` diff --git a/content/00.build/60.test-and-debug/40.hardhat.md b/content/00.build/60.test-and-debug/40.hardhat.md index 8f79720c..f4112cb3 100644 --- a/content/00.build/60.test-and-debug/40.hardhat.md +++ b/content/00.build/60.test-and-debug/40.hardhat.md @@ -1,21 +1,21 @@ --- title: Hardhat -description: Learn how to test on era-test-node with Hardhat. +description: Learn how to test on anvil-zksync with Hardhat. --- In the world of decentralized applications, the margin for error is remarkably narrow. A single mistake in a contract can have catastrophic implications. For those seeking an efficient method to test and refine their contracts, -this guide showcases how to utilize Hardhat and `era_test_node` for all testing needs. +this guide showcases how to utilize Hardhat and `anvil-zksync` for all testing needs. -To test our contract, we are going to use Hardhat and `era_test_node` for rapid local development. +To test our contract, we are going to use Hardhat and `anvil-zksync` for rapid local development. In our tests we're going to use `zksync-ethers` to interact with the `Greeter` contract, and we'll use [Mocha](https://mochajs.org/) as our test runner. ### Prerequisites - `zksync-cli` installed from the [zksync-cli section](/build/zksync-cli). -- `era_test_node` installed and running. See [In-memory Node](/build/test-and-debug/in-memory-node). +- `anvil-zksync` installed and running. See [In-memory Node](/build/test-and-debug/in-memory-node). --- ## Environment setup @@ -73,10 +73,10 @@ and we'll use [Mocha](https://mochajs.org/) as our test runner. The `@nomicfoundation/hardhat-chai-matchers` plugin adds Ethereum specific capabilities to the [Chai](https://www.chaijs.com/) assertion library for testing smart contracts. -1. Start `era_test_node`: +1. Start `anvil-zksync`: ```bash - ./target/release/era_test_node run + ./target/release/anvil-zksync run ``` --- @@ -288,7 +288,7 @@ This section imports all necessary utilities and configurations needed to run ou - `expect` from Chai provides assertion functionalities for our tests. - `Wallet`, `Provider`, and `Contract` from `zksync-ethers` help us with ZKsync functionalities like creating wallets and interacting with contracts. - `hre` and `Deployer` give us hardhat specific functionalities for deploying and interacting with our contract. -- `zkSyncTestnet` from our hardhat configuration provides network details of our running `era_test_node.` +- `zkSyncTestnet` from our hardhat configuration provides network details of our running `anvil-zksync.` #### Contract Deployment Utility diff --git a/content/00.build/95.resources/60.contribution-track.md b/content/00.build/95.resources/60.contribution-track.md index 682a525c..f95be616 100644 --- a/content/00.build/95.resources/60.contribution-track.md +++ b/content/00.build/95.resources/60.contribution-track.md @@ -28,7 +28,7 @@ Here's a list of our key open-source repositories that you can contribute to: ### Testing and debugging -- [**era-test-node**](https://github.com/matter-labs/era-test-node): An in-memory node designed for integration testing and debugging. +- [**anvil-zksync**](https://github.com/matter-labs/anvil-zksync): An in-memory node designed for integration testing and debugging. ### Development tools diff --git a/content/00.build/95.resources/70.community-channels.md b/content/00.build/95.resources/70.community-channels.md index 31dc3a46..bafcdf31 100644 --- a/content/00.build/95.resources/70.community-channels.md +++ b/content/00.build/95.resources/70.community-channels.md @@ -45,7 +45,7 @@ The most effective way to seek technical support is by raising an issue on GitHu relevant details, and steps to reproduce for prompt assistance. - **ZKsync Era Issues**: Address all queries and concerns related to ZKsync Era here. [Report ZKsync Era Issue](https://github.com/matter-labs/zksync-era/issues) -- **era-test-node Issues**: If you're facing challenges with the era-test-node, this is the place to raise them. [Report era-test-node Issue](https://github.com/matter-labs/era-test-node/issues) +- **anvil-zksync Issues**: If you're facing challenges with the anvil-zksync, this is the place to raise them. [Report anvil-zksync Issue](https://github.com/matter-labs/anvil-zksync/issues) - **SDKs Issues**: For any issues related to our Software Development Kits, kindly head over to this section. [Report SDKs Issue](https://github.com/zksync-sdk) --- From a1587df7b6feef0b170fdee2547a0de93aead714 Mon Sep 17 00:00:00 2001 From: romsters Date: Wed, 4 Dec 2024 15:33:45 +0200 Subject: [PATCH 2/5] chore: rename in-memory node to anvil-zksync --- .../05.start-coding/10.zksync-101/00.index.md | 14 +++++++------- .../10.zksync-101/10.hello-zksync.md | 6 +++--- .../10.zksync-101/20.contract-factory.md | 4 ++-- .../10.zksync-101/30.testing.md | 4 ++-- .../10.zksync-101/40.upgrading.md | 4 ++-- .../_beacon_proxy_contract_upgradability.md | 2 +- ...transparent_proxy_contract_upgradability.md | 2 +- .../_upgrading/_uups_contract_upgradability.md | 2 +- .../20.zksync-cli/50.configuring-chains.md | 2 +- .../20.guides/20.migrating-to-zksync.md | 14 +++++++------- .../30.plugins/120.hardhat-zksync-node.md | 18 +++++++++--------- .../20.hardhat/30.plugins/130.other-plugins.md | 4 ++-- .../30.plugins/60.hardhat-zksync-deploy.md | 4 ++-- .../30.plugins/70.hardhat-zksync-upgradable.md | 2 +- content/00.build/60.test-and-debug/00.index.md | 14 +++++++------- .../60.test-and-debug/20.in-memory-node.md | 18 +++++++++--------- .../30.continuous-integration.md | 14 +++++++------- .../00.build/60.test-and-debug/40.hardhat.md | 2 +- content/20.zksync-node/00.index.md | 2 +- examples/hardhat-sol-template/deploy/utils.ts | 2 +- .../hardhat-vyper-template/deploy/utils.ts | 2 +- 21 files changed, 68 insertions(+), 68 deletions(-) diff --git a/content/00.build/05.start-coding/10.zksync-101/00.index.md b/content/00.build/05.start-coding/10.zksync-101/00.index.md index 8b5fecd0..cd1f6471 100644 --- a/content/00.build/05.start-coding/10.zksync-101/00.index.md +++ b/content/00.build/05.start-coding/10.zksync-101/00.index.md @@ -40,13 +40,13 @@ npm install -g zksync-cli ## Setup local node -This series of guides will use an in memory node which allows for quicker testing and debugging processes. +This series of guides will use in memory anvil-zksync node which allows for quicker testing and debugging processes. A great benefit of using a local node is that you will avoid incurring any actual transaction costs. ZKsync Era node provides a set of rich wallets that come with more than enough ETH to use for development. -### Run a local in memory node +### Run a local in memory anvil-zksync node -To run a local in memory node on your machine, you will need Docker running. +To run a local in memory anvil-zksync node on your machine, you will need Docker running. The easiest way to start Docker is to run the Docker Desktop app. We are going to use the "In memory node" module for our local node setup. @@ -79,11 +79,11 @@ We are going to use the "In memory node" module for our local node setup. zksync-cli dev start ``` - The in memory node includes pre-configured rich wallets for use, see [in-memory-node rich wallets](/build/test-and-debug/in-memory-node#pre-configured-rich-wallets). + anvil-zksync node includes pre-configured rich wallets for use, see [anvil-zksync rich wallets](/build/test-and-debug/in-memory-node#pre-configured-rich-wallets). -Your in memory node is accessible at **[http://127.0.0.1:8011](http://127.0.0.1:8011/)**, ready for deployment or testing purposes. +Your in memory anvil-zksync node is accessible at **[http://127.0.0.1:8011](http://127.0.0.1:8011/)**, ready for deployment or testing purposes. You can use the Docker Desktop app to view logs from the running ZKsync Era node or use the `zksync-cli dev logs` command. -When you are done running your in memory node, you can stop it with `zksync-cli dev stop`. +When you are done running your in memory anvil-zksync node, you can stop it with `zksync-cli dev stop`. You can learn more about managing a local node with ZKsync CLI on [Running a node](/build/zksync-cli/running-a-node). ## Create the ZKsync 101 project @@ -98,7 +98,7 @@ zksync-cli create zksync-101 --template zksync-101 After you run the `create` command, the CLI will download and install packages for the project. You should see a success message and instructions to get started with your project. -Since we are using a local in memory node for development, we can use one of the +Since we are using a local in memory anvil-zksync node for development, we can use one of the rich wallets for transactions and deployments. Rename the `.env.example` to `.env` which includes the private key for the first rich wallet. diff --git a/content/00.build/05.start-coding/10.zksync-101/10.hello-zksync.md b/content/00.build/05.start-coding/10.zksync-101/10.hello-zksync.md index 9bd2cb07..937b697b 100644 --- a/content/00.build/05.start-coding/10.zksync-101/10.hello-zksync.md +++ b/content/00.build/05.start-coding/10.zksync-101/10.hello-zksync.md @@ -9,7 +9,7 @@ In this section you will learn how to: :check-icon Craft a smart contract to fund Zeek's latest adventure. -:check-icon Deploy the contract onto your local in memory node. +:check-icon Deploy the contract onto your local in memory anvil-zksync node. :check-icon Interact with the contract with ZKsync CLI @@ -94,7 +94,7 @@ Estimated deployment cost: 0.0065057128 ETH ## Interact with the contract -Now that our contract is deployed to our local in memory node, let's interact with it! +Now that our contract is deployed to our local in memory anvil-zksync node, let's interact with it! We initially set up the crowdfunding campaign with an amount of `.02 ETH` for the goal. ### Read from the contract using ZKsync CLI @@ -191,7 +191,7 @@ to interact with the deployed contract using ZKsync CLI! - **EVM Compatibility:** ZKsync is EVM compatible and you can write smart contracts in Solidity or Vyper. - **Custom Compilation:** Contracts deployed to ZKsync are compiled using `zksolc` or `zkvyper` as they generate a special bytecode for ZKsync's ZKEVM. -- **Development Tools:** In memory node is a quick and easy local node environment to deploy to, +- **Development Tools:** In memory anvil-zksync node is a quick and easy local node environment to deploy to, saving costs on deployment while developing. - **ZKsync CLI:** A powerful command line tool to interact with contracts easily. diff --git a/content/00.build/05.start-coding/10.zksync-101/20.contract-factory.md b/content/00.build/05.start-coding/10.zksync-101/20.contract-factory.md index 3d416a74..b13f04ea 100644 --- a/content/00.build/05.start-coding/10.zksync-101/20.contract-factory.md +++ b/content/00.build/05.start-coding/10.zksync-101/20.contract-factory.md @@ -27,9 +27,9 @@ numerous similar contracts efficiently. ## Setup the project Make sure to go through the setup provided in the initial [Getting started](/build/start-coding/zksync-101) section. -You will have downloaded the 101 project through ZKsync CLI `create` and started up a local in memory node for development. +You will have downloaded the 101 project through ZKsync CLI `create` and started up a local in memory anvil-zksync node for development. -If you haven't started up your local in memory node or you're not sure, run the following: +If you haven't started up your local in memory anvil-zksync node or you're not sure, run the following: ```bash zksync-cli dev restart diff --git a/content/00.build/05.start-coding/10.zksync-101/30.testing.md b/content/00.build/05.start-coding/10.zksync-101/30.testing.md index f953232d..19cec65d 100644 --- a/content/00.build/05.start-coding/10.zksync-101/30.testing.md +++ b/content/00.build/05.start-coding/10.zksync-101/30.testing.md @@ -20,9 +20,9 @@ in the second, work flawlessly. Make sure to go through the setup provided in the initial [Getting started](/build/start-coding/zksync-101) section. You will have downloaded the 101 project through ZKsync CLI `create`. Since we are using `hardhat-zksync` for testing, you do not need to have the -in memory node running for this section. +in memory anvil-zksync node running for this section. -If your local in-memory node is running, stop it with the following command: +If your local in-memory anvil-zksync node is running, stop it with the following command: ```bash zksync-cli dev stop diff --git a/content/00.build/05.start-coding/10.zksync-101/40.upgrading.md b/content/00.build/05.start-coding/10.zksync-101/40.upgrading.md index 2d3706a9..c6cae94a 100644 --- a/content/00.build/05.start-coding/10.zksync-101/40.upgrading.md +++ b/content/00.build/05.start-coding/10.zksync-101/40.upgrading.md @@ -16,9 +16,9 @@ lead you through the strategies and practices for making the `CrowdfundingCampai ## Setup the project Make sure to go through the setup provided in the initial [Getting started](/build/start-coding/zksync-101) section. -You will have downloaded the 101 project through ZKsync CLI `create` and started up a local in-memory node for development. +You will have downloaded the 101 project through ZKsync CLI `create` and started up a local in-memory anvil-zksync node for development. -If you haven't started up your local in-memory node or you're not sure, run the following: +If you haven't started up your local in-memory anvil-zksync node or you're not sure, run the following: ```bash zksync-cli dev restart diff --git a/content/00.build/05.start-coding/10.zksync-101/_upgrading/_beacon_proxy_contract_upgradability.md b/content/00.build/05.start-coding/10.zksync-101/_upgrading/_beacon_proxy_contract_upgradability.md index 4796a6f0..3caedef8 100644 --- a/content/00.build/05.start-coding/10.zksync-101/_upgrading/_beacon_proxy_contract_upgradability.md +++ b/content/00.build/05.start-coding/10.zksync-101/_upgrading/_beacon_proxy_contract_upgradability.md @@ -183,7 +183,7 @@ V2_BeaconCrowdfundingCampaign initialized. Transaction Hash: 0x5f3131c77fcac1939 ## Verify upgradeable contracts ::callout{icon="i-heroicons-exclamation-triangle" color="amber"} -Since we are using the in memory node for our smart contracts, we do not have the feature +Since we are using the in memory anvil-zksync node for our smart contracts, we do not have the feature available to verify the smart contract. The following explains how you can verify an upgraded smart contract on testnet or mainnet. diff --git a/content/00.build/05.start-coding/10.zksync-101/_upgrading/_transparent_proxy_contract_upgradability.md b/content/00.build/05.start-coding/10.zksync-101/_upgrading/_transparent_proxy_contract_upgradability.md index 1a372cd9..b6490488 100644 --- a/content/00.build/05.start-coding/10.zksync-101/_upgrading/_transparent_proxy_contract_upgradability.md +++ b/content/00.build/05.start-coding/10.zksync-101/_upgrading/_transparent_proxy_contract_upgradability.md @@ -182,7 +182,7 @@ V2CrowdfundingCampaign initialized. Transaction Hash: 0x3a7cbf9d584457bc6b452964 ## Verify upgradable contracts ::callout{icon="i-heroicons-exclamation-triangle" color="amber"} -Since we are using in memory node for our smart contracts, we do not have the feature +Since we are using in memory anvil-zksync node for our smart contracts, we do not have the feature available to verify the smart contract. The following explains how you can verify an upgraded smart contract on testnet or mainnet. diff --git a/content/00.build/05.start-coding/10.zksync-101/_upgrading/_uups_contract_upgradability.md b/content/00.build/05.start-coding/10.zksync-101/_upgrading/_uups_contract_upgradability.md index b128d2ba..d446882e 100644 --- a/content/00.build/05.start-coding/10.zksync-101/_upgrading/_uups_contract_upgradability.md +++ b/content/00.build/05.start-coding/10.zksync-101/_upgrading/_uups_contract_upgradability.md @@ -187,7 +187,7 @@ V2_UUPSCrowdfundingCampaign initialized! Transaction Hash: 0xab959f588b64dc6dee1 ## Verify upgradable contracts ::callout{icon="i-heroicons-exclamation-triangle" color="amber"} -Since we are using the in memory node for our smart contracts, we do not have the feature +Since we are using the in memory anvil-zksync node for our smart contracts, we do not have the feature available to verify the smart contract. The following explains how you can verify an upgraded smart contract on testnet or mainnet. diff --git a/content/00.build/20.zksync-cli/50.configuring-chains.md b/content/00.build/20.zksync-cli/50.configuring-chains.md index 9b2444fa..61482521 100644 --- a/content/00.build/20.zksync-cli/50.configuring-chains.md +++ b/content/00.build/20.zksync-cli/50.configuring-chains.md @@ -6,7 +6,7 @@ description: Add and manage custom chains with ZKsync CLI You can define named chains to use with ZKsync CLI to interact with when running commands. Every ZKsync CLI command requires a chain to execute transactions on, and by default, the ZKsync Mainnet, -ZKsync Sepolia Testnet, in-memory local node, and Dockerized local node are provided. +ZKsync Sepolia Testnet, in-memory local anvil-zksync node, and Dockerized local node are provided. You can add and edit additional chains using the `zksync-cli config chains` sub-command. ## Using a custom chain diff --git a/content/00.build/40.tooling/20.hardhat/20.guides/20.migrating-to-zksync.md b/content/00.build/40.tooling/20.hardhat/20.guides/20.migrating-to-zksync.md index f0a45aed..1793266d 100644 --- a/content/00.build/40.tooling/20.hardhat/20.guides/20.migrating-to-zksync.md +++ b/content/00.build/40.tooling/20.hardhat/20.guides/20.migrating-to-zksync.md @@ -189,26 +189,26 @@ See differences with EVM opcodes in [EVM instructions](/build/developer-referenc ZKSync provides different EraVM node implementations to test smart contracts locally: -- In-Memory Node: fast L2 node with non-persistent state. +- anvil-zksync (in-memory node implementation for ZKsync): fast L2 node with non-persistent state. - Dockerized setup: L1 and L2 nodes with persistent state but slower performance. -Unless your project contains L1-L2 features, testing with the In-Memory Node is recommended, which is included in the `@matterlabs/hardhat-zksync` plugin. +Unless your project contains L1-L2 features, testing with the anvil-zksync is recommended, which is included in the `@matterlabs/hardhat-zksync` plugin. ::callout{icon="i-heroicons-exclamation-triangle" color="amber"} -In version `1.0.12`, `hardhat-network-helpers` introduced support for both In-Memory Node and Dockerized setups, allowing methods +In version `1.0.12`, `hardhat-network-helpers` introduced support for both in-memory anvil-zksync node and Dockerized setups, allowing methods such as `loadFixture` to be utilized in test files. :: You can read more about each node in the [Testing section of the docs](/build/test-and-debug). -### Running unit tests on In-Memory Node +### Running unit tests on anvil-zksync node -To run tests using In-Memory Node, follow these steps: +To run tests using anvil-zksync node, follow these steps: -1. Add the `zksync:true` flag to the `hardhat` network in the `hardhat.config.ts` file to override Hardhat's default node with ZKsync In-Memory Node. +1. Add the `zksync:true` flag to the `hardhat` network in the `hardhat.config.ts` file to override Hardhat's default node with anvil-zksync node. 1. Run the test task with `npx hardhat test --network hardhat` (or make `hardhat` the default network). -You can find more info about testing with the In-Memory-Node in [Hardhat-ZKsync node](/build/tooling/hardhat/plugins/hardhat-zksync-node#running-hardhats-test-task-with-hardhat-zksync-node). +You can find more info about testing with the anvil-zksync in [Hardhat-ZKsync node](/build/tooling/hardhat/plugins/hardhat-zksync-node#running-hardhats-test-task-with-hardhat-zksync-node). ### Running tests on Dockerized setup diff --git a/content/00.build/40.tooling/20.hardhat/30.plugins/120.hardhat-zksync-node.md b/content/00.build/40.tooling/20.hardhat/30.plugins/120.hardhat-zksync-node.md index 95ba6621..5d029f70 100644 --- a/content/00.build/40.tooling/20.hardhat/30.plugins/120.hardhat-zksync-node.md +++ b/content/00.build/40.tooling/20.hardhat/30.plugins/120.hardhat-zksync-node.md @@ -4,10 +4,10 @@ description: Guide on using the hardhat-zksync-node plugin. tags: ["hardhat", "zksync", "node", "plugins", "ethereum"] --- -This plugin is used to provide a convenient way to run ZKsync Era [In-memory node](/build/test-and-debug/in-memory-node) locally using hardhat. +This plugin is used to provide a convenient way to run [In-memory anvil-zksync node](/build/test-and-debug/in-memory-node) locally using hardhat. ::callout{icon="i-heroicons-exclamation-triangle" color="amber"} -The ZKsync Era In-memory node binaries are not supported on Windows at the moment. +anvil-zksync in-memory node binaries are not supported on Windows at the moment. As an alternative, users can utilize the Windows Subsystem for Linux (WSL). :: @@ -74,7 +74,7 @@ npm run hardhat node-zksync :: -This command runs a local ZKsync In-memory node by initiating a JSON-RPC server. +This command runs a local in-memory anvil-zksync node by initiating a JSON-RPC server. It uses the provided or default configurations to set up and run the ZKsync node, allowing for blockchain operations in a local environment. The command also handles tasks such as downloading the necessary JSON-RPC server binary if it's not already present. @@ -107,14 +107,14 @@ Additionally, if either `--replay-tx` or `--fork-block-number` is specified, the ::callout{icon="i-heroicons-information-circle" color="blue"} **Node task override**: -If the network `zksync` flag is set to `true`, the `hardhat node` command will launch an era test node on port `8545`. +If the network `zksync` flag is set to `true`, the `hardhat node` command will launch the in-memory anvil-zksync node on port `8545`. :: ::callout{icon="i-heroicons-information-circle" color="blue"} **Overrides for Deploy and Run tasks**: If the Hardhat network is selected and the `zksync` flag is set to true, the plugin will override the `hardhat run` command and all deployment tasks from the `hardhat-zksync-deploy` plugin, -launching an era test node before executing the scripts. +launching the in-memory anvil-zksync node before executing the scripts. **Note**: To achieve this for deployment scripts, @@ -124,7 +124,7 @@ the `hardhat-zksync-node` plugin must be imported after the `hardhat-zksync-depl ::callout{icon="i-heroicons-information-circle" color="blue"} **Learn More**: If you wish to learn more about replaying transactions or forking, -check out the [In-memory node documentation](/build/test-and-debug/in-memory-node). +check out the [anvil-zksync documentation](/build/test-and-debug/in-memory-node). :: ::callout{icon="i-heroicons-information-circle" color="blue"} @@ -135,9 +135,9 @@ To see a list of all supported APIs, visit [this link](%%zk_git_repo_era-test-no ## Running Hardhat's test Task with hardhat-zksync-node -The `hardhat-zksync-node` plugin enhances Hardhat's test task, allowing all tests to run against an In-memory node operated in a separate process. +The `hardhat-zksync-node` plugin enhances Hardhat's test task, allowing all tests to run against anvil-zksync node operated in a separate process. By invoking the test task, ensure you are using the `hardhat` network and have set its `zksync` flag to `true`. -Doing so will initiate the plugin's In-memory node alongside the tests. After the tests conclude, the node shuts down gracefully. +Doing so will initiate the plugin's in-memory anvil-zksync node alongside the tests. After the tests conclude, the node shuts down gracefully. The plugin begins port allocation from the default 8011. ```ts @@ -157,7 +157,7 @@ The network object in the Hardhat runtime environment is also updated to match t ::callout{icon="i-heroicons-exclamation-triangle" color="amber"} **Provider URL Mismatch**: -When running tests, be aware that the In-memory node attempts to allocate free ports (starting from the default 8011). +When running tests, be aware that anvil-zksync node attempts to allocate free ports (starting from the default 8011). This can lead to situations where the provider's URL does not match your expectations. It's strongly recommended to use the network config URL from the hardhat runtime environment to instantiate the Provider instance from the JS SDK, like this: diff --git a/content/00.build/40.tooling/20.hardhat/30.plugins/130.other-plugins.md b/content/00.build/40.tooling/20.hardhat/30.plugins/130.other-plugins.md index 23902882..d781c89c 100644 --- a/content/00.build/40.tooling/20.hardhat/30.plugins/130.other-plugins.md +++ b/content/00.build/40.tooling/20.hardhat/30.plugins/130.other-plugins.md @@ -78,11 +78,11 @@ To prevent this, please include the `--no-compile` flag: `yarn hardhat verify -- This plugin adds new methods that interact with the Hardhat network used for testing. -In version `1.0.12`, `hardhat-network-helpers` introduced support for both In-Memory Node and Dockerized setups, allowing methods +In version `1.0.12`, `hardhat-network-helpers` introduced support for both in-memory anvil-zksync node and Dockerized setups, allowing methods such as `loadFixture` to be utilized in test files. ::callout{icon="i-heroicons-exclamation-triangle" color="amber"} -Although methods like `hardhat_impersonateAccount` or `hardhat_setBalance` are supported, other RPC methods might not be supported by the In-Memory Node. +Although methods like `hardhat_impersonateAccount` or `hardhat_setBalance` are supported, other RPC methods might not be supported by the in-memory anvil-zksync node. Please [check the list of suported APIs](https://github.com/matter-labs/anvil-zksync/blob/main/SUPPORTED_APIS.md). :: diff --git a/content/00.build/40.tooling/20.hardhat/30.plugins/60.hardhat-zksync-deploy.md b/content/00.build/40.tooling/20.hardhat/30.plugins/60.hardhat-zksync-deploy.md index 6776affb..f11f6d05 100644 --- a/content/00.build/40.tooling/20.hardhat/30.plugins/60.hardhat-zksync-deploy.md +++ b/content/00.build/40.tooling/20.hardhat/30.plugins/60.hardhat-zksync-deploy.md @@ -240,8 +240,8 @@ const config: HardhatUserConfig = { - `accounts` represents a list of the private keys or mnemonic object for the account used in the deployment process. ::callout{icon="i-heroicons-information-circle" color="blue"} -**Accounts on ZKsync Era Test Node or zksync-cli Local Node**: -`accounts` object will be automatically be populated with rich accounts if used network is ZKsync Era Test Node or zksync-cli Local Node +**Accounts on In-Memory anvil-zksync Node or zksync-cli Local Node**: +`accounts` object will be automatically populated with rich accounts if used network is In-Memory anvil-zksync Node or zksync-cli Local Node :: diff --git a/content/00.build/40.tooling/20.hardhat/30.plugins/70.hardhat-zksync-upgradable.md b/content/00.build/40.tooling/20.hardhat/30.plugins/70.hardhat-zksync-upgradable.md index 24fb924d..101adb7f 100644 --- a/content/00.build/40.tooling/20.hardhat/30.plugins/70.hardhat-zksync-upgradable.md +++ b/content/00.build/40.tooling/20.hardhat/30.plugins/70.hardhat-zksync-upgradable.md @@ -785,7 +785,7 @@ const config: HardhatUserConfig = { - accounts represents a list of the private keys or mnemonic object for the account used in the deployment or in the upgrade process. - accounts object will automatically be populated with rich accounts if used network is ZKsync Era Test Node or zksync-cli Local Node + accounts object will automatically be populated with rich accounts if used network is In-Memory anvil-zksync Node or zksync-cli Local Node To establish a default index per network, which is by default `0`, you can include a `deployerAccounts` section in your `hardhat.config.ts` file. ```typescript diff --git a/content/00.build/60.test-and-debug/00.index.md b/content/00.build/60.test-and-debug/00.index.md index 22a44393..cfae508f 100644 --- a/content/00.build/60.test-and-debug/00.index.md +++ b/content/00.build/60.test-and-debug/00.index.md @@ -6,13 +6,13 @@ description: Learn about the recommended paths of testing and debugging your pro ZKsync Era provides two distinct testing environments for your local development needs: - Dockerized local setup -- In-Memory Node. +- anvil-zksync (in-memory node implementation for ZKsync). Each solution boasts unique characteristics tailored to diverse use cases. This section aims to unpack the intricacies of these tools, aiding you in selecting the setup best suited for your development workflow. --- -## In-Memory node vs Dockerized local setup +## anvil-zksync vs Dockerized local setup The local testing process revolves around two principal options: @@ -20,7 +20,7 @@ The local testing process revolves around two principal options: a local Geth node functioning as Layer 1, and the ZKsync node. Opt for this setup for comprehensive simulations and testing that require interaction with both L1 and L2. -2. **In-Memory node**: A lightweight, speedy alternative, the in-memory node, supports forking the state from various networks, +2. **anvil-zksync**: A lightweight, speedy alternative, the anvil-zksync node, supports forking the state from various networks, including the mainnet and testnet. This choice is ideal for swift testing, prototyping, and bootloader and system contract testing. ### When to use each @@ -28,7 +28,7 @@ including the mainnet and testnet. This choice is ideal for swift testing, proto - Use the **Dockerized local setup** for in-depth simulations and tests that necessitate L1 and L2 interaction. This detailed setup mirrors how your contracts will function within the mainnet ZKsync Era network. -- Opt for the **In-Memory node** for swift testing, prototyping, or testing new changes via the local bootloader and system contracts. +- Opt for the **anvil-zksync** for swift testing, prototyping, or testing new changes via the local bootloader and system contracts. This setup facilitates forking the state from the mainnet or testnet, suitable for replaying transactions or observing the impact of modifications on existing contracts. @@ -36,7 +36,7 @@ or observing the impact of modifications on existing contracts. The following table highlights the key characteristics of each testing environment for a quick comparison: -| Feature | In-memory node | Dockerized local setup | +| Feature | anvil-zksync | Dockerized local setup | | --------------------------------------- | ------------------- | ---------------------- | | Quick startup | Yes | No | | Supports forking state | Yes | No | @@ -51,10 +51,10 @@ The following table highlights the key characteristics of each testing environme | Websocket support | No | Yes | Whether you're testing new contracts, debugging transactions, or prototyping, ZKsync Era provides robust options for local testing. -Both the Dockerized local setup and the In-Memory Node offer feature-rich and quick setup options, each with their distinct strengths and limitations. +Both the Dockerized local setup and the anvil-zksync offer feature-rich and quick setup options, each with their distinct strengths and limitations. Choose the most appropriate setup based on your specific needs, and happy testing! ## Use ZKsync CLI for easy setup -The [ZKsync CLI](/build/zksync-cli) makes it simple for developers to work with both the Dockerized local setup and In-Memory Node. +The [ZKsync CLI](/build/zksync-cli) makes it simple for developers to work with both the Dockerized local setup and anvil-zksync. Use `zksync-cli dev start` to get your local development environment running along with additional modules like Block Explorer, Wallet and Bridge. diff --git a/content/00.build/60.test-and-debug/20.in-memory-node.md b/content/00.build/60.test-and-debug/20.in-memory-node.md index 059be240..aa70f3a2 100644 --- a/content/00.build/60.test-and-debug/20.in-memory-node.md +++ b/content/00.build/60.test-and-debug/20.in-memory-node.md @@ -1,5 +1,5 @@ --- -title: In-Memory Node +title: anvil-zksync description: Learn how to setup a local in-memory anvil-zksync. --- @@ -12,9 +12,9 @@ some features might not be fully supported yet and may not work as fully intende It is [open-sourced](%%zk_git_repo_era-test-node%%) and contributions are welcomed. :: -## Understand the In-Memory Node +## Understand the anvil-zksync -The In-Memory Node uses an in-memory database for storing state information and simplified hashmaps for tracking blocks and transactions. +anvil-zksync uses an in-memory database for storing state information and simplified hashmaps for tracking blocks and transactions. In fork mode, it retrieves missing storage data from a remote source when not available locally. Moreover it also uses the remote server (openchain) to resolve the ABI and topics to human readable names. @@ -22,7 +22,7 @@ You can visit the `anvil-zksync` repository [to learn more](%%zk_git_repo_era-te ## Run actions with `zksync-cli` -You can setup the In-Memory Node quickly with `zksync-cli dev start`. +You can setup anvil-zksync quickly with `zksync-cli dev start`. If you don't have `zksync-cli` setup, see the [Overview](/build/zksync-cli) guide. Note: at the moment this method won't allow you to use additional features like forking networks or replaying transactions. @@ -56,7 +56,7 @@ The expected output will be as follows: testing 18:02:50 INFO Version: 0.1.0-alpha.34 -18:02:50 INFO Repository: https://github.com/matter-labs/era-test-node +18:02:50 INFO Repository: https://github.com/matter-labs/anvil-zksync 18:02:50 INFO Rich Accounts @@ -80,7 +80,7 @@ testing ``` ::callout{icon="i-heroicons-information-circle-16-solid" color="amber"} -When utilizing `anvil-zksync` with MetaMask, it's essential to note that any restart of the in-memory node +When utilizing `anvil-zksync` with MetaMask, it's essential to note that any restart of the node will necessitate a reset of MetaMask's cached account data (nonce, etc). In the MetaMask app, navigate to 'Settings', then 'Advanced', and finally, select 'Clear activity tab data'. :: @@ -101,7 +101,7 @@ As a result, an L1 RPC is not available. ### Pre-configured rich wallets -In-Memory node includes pre-configured "rich" accounts for testing: +anvil-zksync includes pre-configured "rich" accounts for testing: :display-partial{path="_partials/_rich-wallets"} @@ -276,7 +276,7 @@ Here's an example of what you should expect to see when `show-calls` and `resolv You can send network calls against a running `anvil-zksync`. -Launch the local in-memory node: +Launch the local in-memory anvil-zksync node: ```bash anvil-zksync fork sepolia-testnet @@ -370,7 +370,7 @@ forge create contracts/Greeter.sol:Greeter \ --- ## Test bootloader and system contracts -In-memory node allows testing of the currently compiled bootloader and system contracts. +anvil-zksync allows testing of the currently compiled bootloader and system contracts. This makes it possible to examine the effects of changes on already deployed contracts. ::callout{icon="i-heroicons-information-circle-16-solid" color="amber"} diff --git a/content/00.build/60.test-and-debug/30.continuous-integration.md b/content/00.build/60.test-and-debug/30.continuous-integration.md index d7a426a9..aac98bd6 100644 --- a/content/00.build/60.test-and-debug/30.continuous-integration.md +++ b/content/00.build/60.test-and-debug/30.continuous-integration.md @@ -39,7 +39,7 @@ The following are examples of configuration for your GitHub Action. ### Quickstart ```yaml -name: Run Era Test Node Action +name: Run anvil-zksync Action on: push: @@ -62,7 +62,7 @@ jobs: With configuration options: ```yaml -name: Run Era Test Node Action +name: Run anvil-zksync Action on: push: @@ -76,7 +76,7 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - - name: Run Era Test Node + - name: Run anvil-zksync uses: dutterbutter/anvil-zksync-action@v1 with: mode: "run" @@ -93,7 +93,7 @@ jobs: With upload log file to artifacts: ```yaml -name: Run Era Test Node Action +name: Run anvil-zksync Action on: pull_request: @@ -111,7 +111,7 @@ jobs: - name: Checkout Code uses: actions/checkout@v3 - - name: Run Era Test Node + - name: Run anvil-zksync uses: dutterbutter/anvil-zksync-action@v1 with: mode: "fork" @@ -144,7 +144,7 @@ jobs: With Fork: ```yaml -name: Run Era Test Node Action +name: Run anvil-zksync Action on: push: @@ -158,7 +158,7 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - - name: Run Era Test Node + - name: Run anvil-zksync uses: dutterbutter/anvil-zksync-action@v1 with: mode: "fork" diff --git a/content/00.build/60.test-and-debug/40.hardhat.md b/content/00.build/60.test-and-debug/40.hardhat.md index f4112cb3..4e07abda 100644 --- a/content/00.build/60.test-and-debug/40.hardhat.md +++ b/content/00.build/60.test-and-debug/40.hardhat.md @@ -15,7 +15,7 @@ and we'll use [Mocha](https://mochajs.org/) as our test runner. ### Prerequisites - `zksync-cli` installed from the [zksync-cli section](/build/zksync-cli). -- `anvil-zksync` installed and running. See [In-memory Node](/build/test-and-debug/in-memory-node). +- `anvil-zksync` installed and running. See [anvil-zksync](/build/test-and-debug/in-memory-node). --- ## Environment setup diff --git a/content/20.zksync-node/00.index.md b/content/20.zksync-node/00.index.md index 2345045e..eeed9bc0 100644 --- a/content/20.zksync-node/00.index.md +++ b/content/20.zksync-node/00.index.md @@ -4,7 +4,7 @@ description: --- ::callout{icon="i-heroicons-information-circle" color="blue"} -For local testing, we recommend setting up an in-memory node and forking mainnet. +For local testing, we recommend setting up an in-memory anvil-zksync node and forking mainnet. :: This documentation explains the basics of the ZKsync Era Node. diff --git a/examples/hardhat-sol-template/deploy/utils.ts b/examples/hardhat-sol-template/deploy/utils.ts index 353d5163..8f64a040 100644 --- a/examples/hardhat-sol-template/deploy/utils.ts +++ b/examples/hardhat-sol-template/deploy/utils.ts @@ -129,7 +129,7 @@ export const deployContract = async ( /** * Rich wallets can be used for testing purposes. - * Available on ZKsync In-memory node and Dockerized node. + * Available on in-memory anvil-zksync node and Dockerized node. */ export const LOCAL_RICH_WALLETS = [ { diff --git a/examples/hardhat-vyper-template/deploy/utils.ts b/examples/hardhat-vyper-template/deploy/utils.ts index aa936342..c44174ec 100644 --- a/examples/hardhat-vyper-template/deploy/utils.ts +++ b/examples/hardhat-vyper-template/deploy/utils.ts @@ -97,7 +97,7 @@ export const deployContract = async ( /** * Rich wallets can be used for testing purposes. - * Available on ZKsync In-memory node and Dockerized node. + * Available on in-memory anvil-zksync node and Dockerized node. */ export const LOCAL_RICH_WALLETS = [ { From 932582a5c0a2e0a07054ba097116583d24fbe0d4 Mon Sep 17 00:00:00 2001 From: romsters Date: Wed, 4 Dec 2024 15:41:18 +0200 Subject: [PATCH 3/5] chore: fix lint --- .../40.tooling/20.hardhat/30.plugins/130.other-plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/00.build/40.tooling/20.hardhat/30.plugins/130.other-plugins.md b/content/00.build/40.tooling/20.hardhat/30.plugins/130.other-plugins.md index d781c89c..388c565e 100644 --- a/content/00.build/40.tooling/20.hardhat/30.plugins/130.other-plugins.md +++ b/content/00.build/40.tooling/20.hardhat/30.plugins/130.other-plugins.md @@ -82,7 +82,7 @@ In version `1.0.12`, `hardhat-network-helpers` introduced support for both in-me such as `loadFixture` to be utilized in test files. ::callout{icon="i-heroicons-exclamation-triangle" color="amber"} -Although methods like `hardhat_impersonateAccount` or `hardhat_setBalance` are supported, other RPC methods might not be supported by the in-memory anvil-zksync node. +Although methods like `hardhat_impersonateAccount` or `hardhat_setBalance` are supported, other RPC methods might not be supported by anvil-zksync node. Please [check the list of suported APIs](https://github.com/matter-labs/anvil-zksync/blob/main/SUPPORTED_APIS.md). :: From ea4de60cc059cc513b83c22686bf5214717e6e14 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Thu, 19 Dec 2024 13:38:27 -0600 Subject: [PATCH 4/5] chore: resolve conflicts --- .../40.tooling/20.hardhat/00.index.md | 36 ------------ .../95.resources/70.community-channels.md | 57 ------------------- .../20.guides/20.migrating-to-zksync.md | 2 +- 3 files changed, 1 insertion(+), 94 deletions(-) delete mode 100644 content/00.build/40.tooling/20.hardhat/00.index.md delete mode 100644 content/00.build/95.resources/70.community-channels.md diff --git a/content/00.build/40.tooling/20.hardhat/00.index.md b/content/00.build/40.tooling/20.hardhat/00.index.md deleted file mode 100644 index 5084ecaf..00000000 --- a/content/00.build/40.tooling/20.hardhat/00.index.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: Overview -description: An introduction to hardhat-zksync. -tags: ["zksync", "hardhart", "plugins"] ---- - -ZKsync Era offers a robust set of official plugins tailored for Hardhat, allowing developers to seamlessly compile, deploy, and interact with smart -contracts optimized for zkRollups. Whether you're working with Solidity or Vyper, ZKsync's plugins provide the tools to take full advantage of -zkRollup technology, ensuring faster and cheaper transactions without compromising Ethereum's security. - -### Key Features - -- **Comprehensive plugin suite:** Easily extend your Hardhat projects with ZKsync-specific functionality, from contract compilation to deployment and verification. -- **Optimized for zkRollups:** Deploy contracts that leverage the scalability and security of zkRollups, reducing gas costs while maintaining -trustless security. -- **Seamless integration:** ZKsync plugins are designed to work out-of-the-box with Hardhat, simplifying the setup and management of your Layer 2 projects. - -::callout{icon="i-heroicons-light-bulb"} -To use `hardhat-zksync`, visit the [Getting Started page](/build/tooling/hardhat/guides/getting-started). -:: - -## ZKsync Hardhat Plugins - -ZKsync Era has the following official plugins for Hardhat: - -- [@matterlabs/hardhat-zksync](/build/tooling/hardhat/plugins/hardhat-zksync) - used to access to all of the supported plugins and to use them -as needed in your project. This should be the primary plugin most developers will need to use. -- [@matterlabs/hardhat-zksync-solc](/build/tooling/hardhat/plugins/hardhat-zksync-solc) - used to compile contracts written in Solidity. -- [@matterlabs/hardhat-zksync-vyper](/build/tooling/hardhat/plugins/hardhat-zksync-vyper) - used to compile contracts written in Vyper. -- [@matterlabs/hardhat-zksync-deploy](/build/tooling/hardhat/plugins/hardhat-zksync-deploy) - used to deploy smart contracts. -- [@matterlabs/hardhat-zksync-verify](/build/tooling/hardhat/plugins/hardhat-zksync-verify) - used to verify smart contracts. -- [@matterlabs/hardhat-zksync-verify-vyper](/build/tooling/hardhat/plugins/hardhat-zksync-verify-vyper) - used to verify vyper smart contracts. -- [@matterlabs/hardhat-zksync-upgradable](/build/tooling/hardhat/plugins/hardhat-zksync-upgradable) - used to deploy, update, and verify proxy smart contracts. -- [@matterlabs/hardhat-zksync-ethers](/build/tooling/hardhat/plugins/hardhat-zksync-ethers) - wrapper around zksync-ethers with some extra -Hardhat-specific functionality. -- [@matterlabs/hardhat-zksync-node](/build/tooling/hardhat/plugins/hardhat-zksync-node) - used to run the ZKsync anvil-zksync locally. diff --git a/content/00.build/95.resources/70.community-channels.md b/content/00.build/95.resources/70.community-channels.md deleted file mode 100644 index bafcdf31..00000000 --- a/content/00.build/95.resources/70.community-channels.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: Community Channels -description: ---- - -Engage with our vibrant community and stay updated on the latest news, insights, and discussions through our diverse channels. Here's a quick overview: - -## **1. Developer Discussions** - -A dedicated space in GitHub for developers to discuss, collaborate, and brainstorm on technical topics. - -[Engage in GitHub Discussions](https://github.com/ZKsync-Community-Hub/zksync-developers/discussions) - ---- - -## **2. Discord** - -Join real-time conversations, ask questions, and connect with both the team and fellow community members. - -[Join our Discord server](https://join.zksync.dev/) - ---- - -## **3. Twitter/X** - -Follow us for quick updates, announcements, and trends related to our platform, updates for developers, and the broader industry. - -[Follow us on Twitter](https://x.com/zksync) - -[Follow our developer-focused Twitter](https://x.com/zkSyncDevs) - ---- - -## **4. Blog** - -Delve deep into comprehensive articles, tutorials, and insights penned by our team. - -[Read our Blog](https://zksync.mirror.xyz/) - ---- - -## **5. GitHub Issues** - -The most effective way to seek technical support is by raising an issue on GitHub. Ensure you provide a comprehensive description, -relevant details, and steps to reproduce for prompt assistance. - -- **ZKsync Era Issues**: Address all queries and concerns related to ZKsync Era here. [Report ZKsync Era Issue](https://github.com/matter-labs/zksync-era/issues) -- **anvil-zksync Issues**: If you're facing challenges with the anvil-zksync, this is the place to raise them. [Report anvil-zksync Issue](https://github.com/matter-labs/anvil-zksync/issues) -- **SDKs Issues**: For any issues related to our Software Development Kits, kindly head over to this section. [Report SDKs Issue](https://github.com/zksync-sdk) - ---- - -## **6. Telegram** - -Get instant updates and participate in mobile-friendly discussions on our official Telegram channel. - -[Join us on Telegram](https://t.me/zksync) diff --git a/content/00.zksync-era/40.tooling/20.hardhat/20.guides/20.migrating-to-zksync.md b/content/00.zksync-era/40.tooling/20.hardhat/20.guides/20.migrating-to-zksync.md index 44c35985..006bbb54 100644 --- a/content/00.zksync-era/40.tooling/20.hardhat/20.guides/20.migrating-to-zksync.md +++ b/content/00.zksync-era/40.tooling/20.hardhat/20.guides/20.migrating-to-zksync.md @@ -208,7 +208,7 @@ To run tests using anvil-zksync node, follow these steps: 1. Add the `zksync:true` flag to the `hardhat` network in the `hardhat.config.ts` file to override Hardhat's default node with anvil-zksync node. 1. Run the test task with `npx hardhat test --network hardhat` (or make `hardhat` the default network). -You can find more info about testing with the `anvil-zksync` in [Hardhat-ZKsync node](/build/tooling/hardhat/plugins/hardhat-zksync-node#running-hardhats-test-task-with-hardhat-zksync-node). +You can find more info about testing with the `anvil-zksync` in [Hardhat-ZKsync node](/plugins/hardhat-zksync-node.md). ### Running tests on Dockerized setup From 6e19386a13d24837b01528c53dd2d563605b2c61 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Thu, 19 Dec 2024 13:56:39 -0600 Subject: [PATCH 5/5] chore: resolve conflicts --- .../10.guides/20.zksync-101/30.testing.md | 2 +- .../10.guides/20.zksync-101/40.upgrading.md | 2 +- .../10.local-setup/10.anvil-zksync-node.md | 4 +- .../20.guides/20.migrating-to-zksync.md | 2 +- .../30.plugins/120.hardhat-zksync-node.md | 8 +- .../30.plugins/130.other-plugins.md | 2 +- .../30.plugins/60.hardhat-zksync-deploy.md | 4 +- .../70.hardhat-zksync-upgradable.md | 2 +- content/20.zksync-node/00.index.md | 162 ------------------ examples/hardhat-sol-template/deploy/utils.ts | 2 +- .../hardhat-vyper-template/deploy/utils.ts | 2 +- 11 files changed, 15 insertions(+), 177 deletions(-) delete mode 100644 content/20.zksync-node/00.index.md diff --git a/content/00.zksync-era/10.guides/20.zksync-101/30.testing.md b/content/00.zksync-era/10.guides/20.zksync-101/30.testing.md index c8e80892..14d127a1 100644 --- a/content/00.zksync-era/10.guides/20.zksync-101/30.testing.md +++ b/content/00.zksync-era/10.guides/20.zksync-101/30.testing.md @@ -22,7 +22,7 @@ You will have downloaded the 101 project through ZKsync CLI `create`. Since we are using `hardhat-zksync` for testing, you do not need to have the in memory anvil-zksync node running for this section. -If your local in-memory anvil-zksync node is running, stop it with the following command: +If your local `anvil-zksync` node is running, stop it with the following command: ```bash zksync-cli dev stop diff --git a/content/00.zksync-era/10.guides/20.zksync-101/40.upgrading.md b/content/00.zksync-era/10.guides/20.zksync-101/40.upgrading.md index 1a064f23..50c655da 100644 --- a/content/00.zksync-era/10.guides/20.zksync-101/40.upgrading.md +++ b/content/00.zksync-era/10.guides/20.zksync-101/40.upgrading.md @@ -18,7 +18,7 @@ lead you through the strategies and practices for making the `CrowdfundingCampai Make sure to go through the setup provided in the initial [Getting started](/build/start-coding/zksync-101) section. You will have downloaded the 101 project through ZKsync CLI `create` and started up a local anvil-zksync node for development. -If you haven't started up your local in-memory anvil-zksync node or you're not sure, run the following: +If you haven't started up your local `anvil-zksync` node or you're not sure, run the following: ```bash zksync-cli dev restart diff --git a/content/00.zksync-era/40.tooling/10.local-setup/10.anvil-zksync-node.md b/content/00.zksync-era/40.tooling/10.local-setup/10.anvil-zksync-node.md index 76be7818..4e25c050 100644 --- a/content/00.zksync-era/40.tooling/10.local-setup/10.anvil-zksync-node.md +++ b/content/00.zksync-era/40.tooling/10.local-setup/10.anvil-zksync-node.md @@ -1,6 +1,6 @@ --- title: anvil-zksync -description: Learn how to setup a local in-memory anvil-zksync. +description: Learn how to setup a local anvil-zksync node. --- This section provides instructions on setting up and using the In-Memory Node, `anvil-zksync`, for local testing. @@ -276,7 +276,7 @@ Here's an example of what you should expect to see when `show-calls` and `resolv You can send network calls against a running `anvil-zksync`. -Launch the local in-memory anvil-zksync node: +Launch the local `anvil-zksync` node: ```bash anvil-zksync fork sepolia-testnet diff --git a/content/00.zksync-era/40.tooling/20.hardhat/20.guides/20.migrating-to-zksync.md b/content/00.zksync-era/40.tooling/20.hardhat/20.guides/20.migrating-to-zksync.md index 006bbb54..23808ac2 100644 --- a/content/00.zksync-era/40.tooling/20.hardhat/20.guides/20.migrating-to-zksync.md +++ b/content/00.zksync-era/40.tooling/20.hardhat/20.guides/20.migrating-to-zksync.md @@ -195,7 +195,7 @@ ZKSync provides different EraVM node implementations to test smart contracts loc Unless your project contains L1-L2 features, testing with the anvil-zksync is recommended, which is included in the `@matterlabs/hardhat-zksync` plugin. ::callout{icon="i-heroicons-exclamation-triangle" color="amber"} -In version `1.0.12`, `hardhat-network-helpers` introduced support for both in-memory anvil-zksync node and Dockerized setups, allowing methods +In version `1.0.12`, `hardhat-network-helpers` introduced support for both anvil-zksync node and Dockerized setups, allowing methods such as `loadFixture` to be utilized in test files. :: diff --git a/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/120.hardhat-zksync-node.md b/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/120.hardhat-zksync-node.md index 141f99b6..b51c8789 100644 --- a/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/120.hardhat-zksync-node.md +++ b/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/120.hardhat-zksync-node.md @@ -74,7 +74,7 @@ npm run hardhat node-zksync :: -This command runs a local in-memory anvil-zksync node by initiating a JSON-RPC server. +This command runs a local `anvil-zksync` node by initiating a JSON-RPC server. It uses the provided or default configurations to set up and run the ZKsync node, allowing for blockchain operations in a local environment. The command also handles tasks such as downloading the necessary JSON-RPC server binary if it's not already present. @@ -107,14 +107,14 @@ Additionally, if either `--replay-tx` or `--fork-block-number` is specified, the ::callout{icon="i-heroicons-information-circle" color="blue"} **Node task override**: -If the network `zksync` flag is set to `true`, the `hardhat node` command will launch the in-memory anvil-zksync node on port `8545`. +If the network `zksync` flag is set to `true`, the `hardhat node` command will launch the `anvil-zksync` node on port `8545`. :: ::callout{icon="i-heroicons-information-circle" color="blue"} **Overrides for Deploy and Run tasks**: If the Hardhat network is selected and the `zksync` flag is set to true, the plugin will override the `hardhat run` command and all deployment tasks from the `hardhat-zksync-deploy` plugin, -launching the in-memory anvil-zksync node before executing the scripts. +launching the `anvil-zksync` node before executing the scripts. **Note**: To achieve this for deployment scripts, @@ -137,7 +137,7 @@ To see a list of all supported APIs, visit [this link](%%zk_git_repo_era-test-no The `hardhat-zksync-node` plugin enhances Hardhat's test task, allowing all tests to run against anvil-zksync node operated in a separate process. By invoking the test task, ensure you are using the `hardhat` network and have set its `zksync` flag to `true`. -Doing so will initiate the plugin's in-memory anvil-zksync node alongside the tests. After the tests conclude, the node shuts down gracefully. +Doing so will initiate the plugin's `anvil-zksync` node alongside the tests. After the tests conclude, the node shuts down gracefully. The plugin begins port allocation from the default 8011. ```ts diff --git a/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/130.other-plugins.md b/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/130.other-plugins.md index 73e57faf..420533b0 100644 --- a/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/130.other-plugins.md +++ b/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/130.other-plugins.md @@ -78,7 +78,7 @@ To prevent this, please include the `--no-compile` flag: `yarn hardhat verify -- This plugin adds new methods that interact with the Hardhat network used for testing. -In version `1.0.12`, `hardhat-network-helpers` introduced support for both in-memory anvil-zksync node and Dockerized setups, allowing methods +In version `1.0.12`, `hardhat-network-helpers` introduced support for both anvil-zksync node and Dockerized setups, allowing methods such as `loadFixture` to be utilized in test files. ::callout{icon="i-heroicons-exclamation-triangle" color="amber"} diff --git a/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/60.hardhat-zksync-deploy.md b/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/60.hardhat-zksync-deploy.md index bee9bf4f..29d70512 100644 --- a/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/60.hardhat-zksync-deploy.md +++ b/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/60.hardhat-zksync-deploy.md @@ -240,8 +240,8 @@ const config: HardhatUserConfig = { - `accounts` represents a list of the private keys or mnemonic object for the account used in the deployment process. ::callout{icon="i-heroicons-information-circle" color="blue"} -**Accounts on In-Memory anvil-zksync Node or zksync-cli Local Node**: -`accounts` object will be automatically populated with rich accounts if used network is In-Memory anvil-zksync Node or zksync-cli Local Node +**Accounts on anvil-zksync node or zksync-cli Local Node**: +`accounts` object will be automatically populated with rich accounts if used network is anvil-zksync Node or zksync-cli Local Node :: diff --git a/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/70.hardhat-zksync-upgradable.md b/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/70.hardhat-zksync-upgradable.md index 13229e7f..0559a989 100644 --- a/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/70.hardhat-zksync-upgradable.md +++ b/content/00.zksync-era/40.tooling/20.hardhat/30.plugins/70.hardhat-zksync-upgradable.md @@ -785,7 +785,7 @@ const config: HardhatUserConfig = { - accounts represents a list of the private keys or mnemonic object for the account used in the deployment or in the upgrade process. - accounts object will automatically be populated with rich accounts if used network is In-Memory anvil-zksync Node or zksync-cli Local Node + accounts object will automatically be populated with rich accounts if used network is anvil-zksync node or zksync-cli Local Node To establish a default index per network, which is by default `0`, you can include a `deployerAccounts` section in your `hardhat.config.ts` file. ```typescript diff --git a/content/20.zksync-node/00.index.md b/content/20.zksync-node/00.index.md deleted file mode 100644 index eeed9bc0..00000000 --- a/content/20.zksync-node/00.index.md +++ /dev/null @@ -1,162 +0,0 @@ ---- -title: Introduction -description: ---- - -::callout{icon="i-heroicons-information-circle" color="blue"} -For local testing, we recommend setting up an in-memory anvil-zksync node and forking mainnet. -:: - -This documentation explains the basics of the ZKsync Era Node. - -## Disclaimers - -- The ZKsync node software is provided "as-is" without any express or implied warranties. -- The ZKsync node is in the beta phase, and should be used with caution. -- The ZKsync node is a read-only replica of the main node. -- The ZKsync node is not going to be the consensus node. -- Running a sequencer node is currently not possible and there is no option to vote on blocks as part of the consensus mechanism - or [fork-choice](https://eth2book.info/capella/part3/forkchoice/#whats-a-fork-choice) like on Ethereum. - -## What is the ZKsync Node? - -The ZKsync node is a read-replica of the main (centralized) node that can be run by anyone. It -functions by fetching data from the ZKsync API and re-applying transactions locally, starting from the genesis block. -The ZKsync node shares most of its codebase with the main node. Consequently, when it re-applies transactions, it does -so exactly as the main node did in the past. - -In Ethereum terms, the current state of the ZKsync node represents an archive node, providing access to the entire history of the blockchain. - -## High-level Overview - -At a high level, the ZKsync node can be seen as an application that has the following modules: - -- API server that provides the publicly available Web3 interface. -- Synchronization layer that interacts with the main node and retrieves transactions and blocks to re-execute. -- Sequencer component that actually executes and persists transactions received from the synchronization layer. -- Several checker modules that ensure the consistency of the ZKsync node state. - -With the ZKsync node, you are able to: - -- Locally recreate and verify the ZKsync Era mainnet/testnet state. -- Interact with the recreated state in a trustless way (in a sense that the validity is locally verified, and you should - not rely on a third-party API ZKsync Era provides). -- Use the Web3 API without having to query the main node. -- Send L2 transactions (that will be proxied to the main node). - -With the ZKsync node, you _can not_: - -- Create L2 blocks or L1 batches on your own. -- Generate proofs. -- Submit data to L1. - -A more detailed overview of the ZKsync node's components is provided in the components section. - -## API Overview - -API exposed by the ZKsync node strives to be Web3-compliant. -If some method is exposed but behaves differently compared to -Ethereum, it should be considered a bug. -Please [report](https://zksync.io/contact) such cases. - -### `eth_` Namespace - -Data getters in this namespace operate in the L2 space: require/return L2 block numbers, check balances in L2, etc. - -Available methods: - -| Method | Notes | -|-------------------------------------------|---------------------------------------------------------------------------| -| `eth_blockNumber` | | -| `eth_chainId` | | -| `eth_call` | | -| `eth_estimateGas` | | -| `eth_gasPrice` | | -| `eth_newFilter` | Maximum amount of installed filters is configurable | -| `eth_newBlockFilter` | Same as above | -| `eth_newPendingTransactionsFilter` | Same as above | -| `eth_uninstallFilter` | | -| `eth_getLogs` | Maximum amount of returned entities can be configured | -| `eth_getFilterLogs` | Same as above | -| `eth_getFilterChanges` | Same as above | -| `eth_getBalance` | | -| `eth_getBlockByNumber` | | -| `eth_getBlockByHash` | | -| `eth_getBlockTransactionCountByNumber` | | -| `eth_getBlockTransactionCountByHash` | | -| `eth_getCode` | | -| `eth_getStorageAt` | | -| `eth_getTransactionCount` | | -| `eth_getTransactionByHash` | | -| `eth_getTransactionByBlockHashAndIndex` | | -| `eth_getTransactionByBlockNumberAndIndex` | | -| `eth_getTransactionReceipt` | | -| `eth_protocolVersion` | | -| `eth_sendRawTransaction` | | -| `eth_syncing` | EN is considered synced if it's less than 11 blocks behind the main node. | -| `eth_coinbase` | Always returns a zero address | -| `eth_accounts` | Always returns an empty list | -| `eth_getCompilers` | Always returns an empty list | -| `eth_hashrate` | Always returns zero | -| `eth_getUncleCountByBlockHash` | Always returns zero | -| `eth_getUncleCountByBlockNumber` | Always returns zero | -| `eth_mining` | Always returns false | - -### PubSub - -Only available on the WebSocket servers. - -Available methods: - -| Method | Notes | -| ------------------ | ----------------------------------------------- | -| `eth_subscribe` | Maximum amount of subscriptions is configurable | -| `eth_subscription` | | - -### `net_` Namespace - -Available methods: - -| Method | Notes | -| ---------------- | -------------------- | -| `net_version` | | -| `net_peer_count` | Always returns 0 | -| `net_listening` | Always returns false | - -### `web3_` Namespace - -Available methods: - -| Method | Notes | -| -------------------- | ----- | -| `web3_clientVersion` | | - -### `debug` namespace - -The `debug` namespace gives access to several non-standard RPC methods, which will allow developers to inspect and debug -calls and transactions. - -This namespace is disabled by default and can be configured via setting `EN_API_NAMESPACES` as described in the example config. - -Available methods: - -| Method | Notes | -| -------------------------- | ----- | -| `debug_traceBlockByNumber` | | -| `debug_traceBlockByHash` | | -| `debug_traceCall` | | -| `debug_traceTransaction` | | - -### `zks` namespace - -This namespace contains rollup-specific extensions to the Web3 API. -Note that _only methods_ specified in the documentation are considered public. -There may be other methods exposed in this namespace, but undocumented -methods come without any kind of stability guarantees and can be changed or removed without notice. - -Always refer to the documentation linked above and [API reference documentation](/build/api-reference) to see the list of stabilized methods in this namespace. - -### `en` namespace - -This namespace contains methods that ZKsync nodes call on the main node while syncing. If this namespace is enabled -other ZKsync nodes can sync from this node. diff --git a/examples/hardhat-sol-template/deploy/utils.ts b/examples/hardhat-sol-template/deploy/utils.ts index 8f64a040..b6982ba4 100644 --- a/examples/hardhat-sol-template/deploy/utils.ts +++ b/examples/hardhat-sol-template/deploy/utils.ts @@ -129,7 +129,7 @@ export const deployContract = async ( /** * Rich wallets can be used for testing purposes. - * Available on in-memory anvil-zksync node and Dockerized node. + * Available on anvil-zksync node and Dockerized node. */ export const LOCAL_RICH_WALLETS = [ { diff --git a/examples/hardhat-vyper-template/deploy/utils.ts b/examples/hardhat-vyper-template/deploy/utils.ts index c44174ec..feca2193 100644 --- a/examples/hardhat-vyper-template/deploy/utils.ts +++ b/examples/hardhat-vyper-template/deploy/utils.ts @@ -97,7 +97,7 @@ export const deployContract = async ( /** * Rich wallets can be used for testing purposes. - * Available on in-memory anvil-zksync node and Dockerized node. + * Available on anvil-zksync node and Dockerized node. */ export const LOCAL_RICH_WALLETS = [ {