Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
fix(docs): update zksync-cli docs (#692)
Browse files Browse the repository at this point in the history
  • Loading branch information
JackHamer09 authored Sep 6, 2023
1 parent 3c49be9 commit f40d1a3
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 19 deletions.
2 changes: 1 addition & 1 deletion docs/dev/building-on-zksync/hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ yarn add global zksync-cli@latest
2. Scaffold a new project by running the command:

```sh
zksync-cli create greeter-example
zksync-cli create-project greeter-example
```

This creates a new zkSync Era project called `greeter-example` with a basic `Greeter` contract and all the zkSync plugins and configurations.
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/how-to/verify-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ yarn add global zksync-cli@latest
- Once you complete the installation, execute the command below to create a fresh project:

```sh
zksync-cli create verify-greeter-contract
zksync-cli create-project verify-greeter-contract
```

3. This function creates a fresh zkSync project titled `verify-greeter-contract` containing a `Greeter` contract. Proceed by moving into the project directory:
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/tutorials/aa-daily-spend-limit.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ yarn add global zksync-cli@latest
2. Initiate a new project by running the command:

```sh
zksync-cli create custom-spendlimit-tutorial
zksync-cli create-project custom-spendlimit-tutorial
```

:::tip
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/tutorials/api3-usd-paymaster-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ yarn add global zksync-cli@latest
2. Run the following command to create a new project:

```sh
zksync-cli create paymaster-dapi
zksync-cli create-project paymaster-dapi
```

This creates a new zkSync Era project called `paymaster-dapi` with a basic `Greeter` contract.
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/tutorials/cross-chain-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ yarn add global zksync-cli@latest
2. `cd` into `/L2-counter` and initialize the project:

```sh
zksync-cli create .
zksync-cli create-project .
```

3. For the purposes of this tutorial, we don't need the Greeter related files generated by the zkSync-CLI. So, proceed with removing `Greeter.sol` from our `/contracts` directory:
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/tutorials/custom-aa-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ yarn add global zksync-cli@latest
2. Initiate a new project by running the command:

```sh
zksync-cli create custom-aa-tutorial
zksync-cli create-project custom-aa-tutorial
```

:::tip
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/tutorials/custom-paymaster-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ yarn add global zksync-cli@latest
2. Initiate a new project by running the command:

```sh
zksync-cli create custom-paymaster-tutorial
zksync-cli create-project custom-paymaster-tutorial
```

:::tip
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/concepts/bridging-asset.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export default async function (hre: HardhatRuntimeEnvironment) {
}
```

To run this script, configure your `hardhat.config.ts` file as explained in this [guide](../../tools/hardhat/hardhat-zksync-deploy.md), or use the command `npx zksync-cli@latest create PROJECT_NAME` to scaffold a new project.
To run this script, configure your `hardhat.config.ts` file as explained in this [guide](../../tools/hardhat/hardhat-zksync-deploy.md), or use the command `npx zksync-cli@latest create-project PROJECT_NAME` to scaffold a new project.

Once your `hardhat.config.ts` file is configured, place the script files in the `deploy` folder and run them with the following command:

Expand Down
2 changes: 1 addition & 1 deletion docs/tools/hardhat/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ If you are using Vyper, check out the [Vyper plugin documentation](./hardhat-zks
To create a new project run the CLI's `create` command, passing a project name:

```sh
zksync-cli create demo
zksync-cli create-project demo
```

This command creates a `demo` folder and clones a Hardhat template project inside it. The downloaded project is already configured and contains all the required plugins.
Expand Down
2 changes: 1 addition & 1 deletion docs/tools/hardhat/hardhat-zksync-vyper.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Learn more about the latest updates in the [changelog](https://github.com/matter
Use the [zkSync Era cli](../../tools/zksync-cli/README.md) to set up a project.

```sh
npx zksync-cli@latest create greeter-vyper-example
npx zksync-cli@latest create-project greeter-vyper-example
cd greeter-vyper-example
```

Expand Down
34 changes: 25 additions & 9 deletions docs/tools/zksync-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,29 @@ The code is available [in the following repository](https://github.com/matter-la

Install the zkSync CLI globally with the following command:

```
npm i -g zksync-cli@latest
```
- Install with Yarn:

```
yarn add global zksync-cli@latest
```

- Install with NPM:

```
npm install -g zksync-cli@latest
```

You can also run this via NPX with `npx zksync-cli@latest [COMMAND]`

## Commands

- `zksync-cli create [PROJECT_NAME]`: creates a new project in a new folder with the given project name. If the project name is not provided, it creates the project in the current folder, although this requires the folder to be empty.
- `zksync-cli deposit`: deposits funds from L1 to zkSync Era. It will ask you to provide: the network (localnet, testnet, mainnet), the recipient wallet, the amount in ETH (eg 0.1) and the private key of the wallet you're sending the funds from.
- `zksync-cli withdraw`: withdraws funds from zkSync Era to L1. It will ask you to provide: the network (localnet, testnet, mainnet), the recipient wallet, the amount in ETH (eg 0.1) and the private key of the wallet you're sending the funds from.
- `zksync-cli confirm-withdraw`: confirms withdrawal of funds from zkSync Era to L1. It will ask you to enter: network, withdrawal transaction hash, and the private key of the wallet you sent the funds from.
- `zksync-cli help`: returns the version and information about the different commands.
- `zksync-cli create-project {FOLDER_NAME}`: creates project from template in the specified folder
- `zksync-cli deposit`: deposits funds from Ethereum (L1) to zkSync (L2)
- `zksync-cli withdraw`: withdraws funds from zkSync (L2) to Ethereum (L1)
- `zksync-cli withdraw-finalize`: finalizes withdrawal of funds from zkSync (L2) to Ethereum (L1)
- `zksync-cli help`: Provides information about all supported commands
- `zksync-cli help {command}`: Provides detailed information about how to use a specific command. Replace {command} with the name of the command you want help with (e.g., create-project, deposit, withdraw, withdraw-finalize)
- `zksync-cli --version`: Returns the current version

::: info Deposit and withdraw times

Expand All @@ -40,11 +50,17 @@ More commands will be added shortly but if you have any suggestions, feel free t

### Project templates

Below are the repositories of the different project templates used on the `zksync-cli create` command:
Below are the repositories of the different project templates used on the `zksync-cli create-project` command:

- [Hardhat + Solidity](https://github.com/matter-labs/zksync-hardhat-template).
- [Hardhat + Vyper](https://github.com/matter-labs/zksync-hardhat-vyper-template).

### 🔗 Supported chains

By default zkSync CLI supports Era Testnet and Era Mainnet. You can also use other networks by overwriting L1 and L2 RPC URLs. For example: `zksync-cli deposit --l2-rpc=http://... --l1-rpc=http://...`

If you're using [local setup (dockerized testing node)](../testing/dockerized-testing.md) with default L1 and L2 RPC URLs, you can select `Local Dockerized node` option in the CLI or provide option `--chain local-dockerized`.

## Troubleshooting

If you find any issues, you can [open an issue on GitHub](https://github.com/matter-labs/zksync-cli/issues/new) or report it to us [in GitHub discussions](https://github.com/zkSync-Community-Hub/zkync-developers/discussions).

0 comments on commit f40d1a3

Please sign in to comment.