Skip to content
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

chore: rebrand to anvil-zksync #277

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
14 changes: 7 additions & 7 deletions content/00.build/05.start-coding/10.zksync-101/00.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion content/00.build/20.zksync-cli/50.configuring-chains.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion content/00.build/40.tooling/20.hardhat/00.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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).
::

Expand Down Expand Up @@ -74,13 +74,13 @@ 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.

- `--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.
Expand All @@ -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,
Expand All @@ -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"}
Expand All @@ -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
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ 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.
Please [check the list of suported APIs](https://github.com/matter-labs/era-test-node/blob/main/SUPPORTED_APIS.md).
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).

::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading
Loading