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

Commit 36dd62f

Browse files
authored
fix: refactor and improve zksync-cli docs (#951)
1 parent 78e02b0 commit 36dd62f

File tree

14 files changed

+684
-119
lines changed

14 files changed

+684
-119
lines changed

cspell-zksync.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ mainchain
3030
offchain
3131
processed
3232
zcli
33+
zkcli
3334
blockchains
3435
sidechain
3536
sidechains

docs/.vuepress/sidebar/en.ts

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,44 @@ export const enSidebar = sidebar({
224224
text: "Getting Started",
225225
link: "/build/tooling/zksync-cli/getting-started.md",
226226
},
227-
"/build/tooling/zksync-cli/commands.md",
228-
"/build/tooling/zksync-cli/examples/contract-interaction.md"
227+
{
228+
text: "Commands",
229+
collapsible: false,
230+
children: [
231+
{
232+
text: "Start Node Locally",
233+
link: "/build/tooling/zksync-cli/commands/local-node.md",
234+
},
235+
{
236+
text: "Create a Project",
237+
link: "/build/tooling/zksync-cli/commands/create.md",
238+
},
239+
{
240+
text: "Contract Interaction",
241+
link: "/build/tooling/zksync-cli/commands/contract-interaction.md",
242+
},
243+
{
244+
text: "Transaction Info",
245+
link: "/build/tooling/zksync-cli/commands/transaction-info.md",
246+
},
247+
{
248+
text: "Wallet Functionality",
249+
link: "/build/tooling/zksync-cli/commands/wallet.md",
250+
},
251+
{
252+
text: "Bridge Operations",
253+
link: "/build/tooling/zksync-cli/commands/bridge.md",
254+
},
255+
{
256+
text: "Custom Chains",
257+
link: "/build/tooling/zksync-cli/commands/custom-chains.md",
258+
},
259+
]
260+
},
261+
{
262+
text: "Troubleshooting",
263+
link: "/build/tooling/zksync-cli/troubleshooting.md",
264+
},
229265
]
230266
},
231267
{

docs/build/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Find user guides, code samples, SDKs & toolkits, tutorials, API & CLI references
3737
/>
3838
<div class="content">
3939
<h3>zkSync CLI</h3>
40-
<p>Easily interact and develop applications with zkSync Era using the zkSync CLI.</p>
40+
<p>Local development, contract interaction, custom chains and more.</p>
4141
</div>
4242
</RouterLink>
4343
<RouterLink

docs/build/tooling/zksync-cli/commands.md

Lines changed: 0 additions & 83 deletions
This file was deleted.
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
---
2+
head:
3+
- - meta
4+
- name: "twitter:title"
5+
content: Bridge Operations with zksync-cli | zkSync Docs
6+
---
7+
8+
# Bridge operations with zksync-cli
9+
10+
Leverage the [zksync-cli](../../zksync-cli/getting-started.md) to facilitate bridge operations between Ethereum (L1) and zkSync (L2), including token deposits, withdrawals, and finalizing withdrawals.
11+
12+
### Prerequisites
13+
14+
Before you start, make sure you have installed:
15+
16+
- [Node.js v18+](https://nodejs.org/en)
17+
18+
### Table of contents
19+
20+
- [Bridge Deposit](#bridge-deposit)
21+
- [Deposit Options](#deposit-options)
22+
- [Depositing ERC-20 Tokens](#depositing-erc-20-tokens)
23+
- [Bridge Withdraw](#bridge-withdraw)
24+
- [Withdraw Options](#withdraw-options)
25+
- [Withdrawing ERC-20 Tokens](#withdrawing-erc-20-tokens)
26+
- [Withdraw Finalize](#withdraw-finalize)
27+
- [Finalize Withdraw Options](#finalize-withdraw-options)
28+
- [Troubleshooting](#troubleshooting)
29+
30+
## Bridge Deposit
31+
32+
Transfer ETH from L1 to L2 using the deposit command.
33+
34+
```bash
35+
npx zksync-cli bridge deposit
36+
```
37+
38+
### Deposit Options
39+
40+
If options are not specified, you will be prompted to enter them.
41+
42+
- `--to, --recipient <0x address>`: Recipient address on L2.
43+
- `--amount <0.1>`: Amount to deposit.
44+
- `--token <0x address>`: ERC-20 token address.
45+
- `--pk, --private-key <wallet private key>`: Private key of the sender.
46+
- `--chain <chain>`: Chain to use.
47+
- `--l1-rpc <URL>`: Override L1 RPC URL.
48+
- `--rpc <URL>`: Override L2 RPC URL.
49+
50+
### Depositing ERC-20 Tokens
51+
52+
To deposit ERC-20 tokens, include the `--token` option with the token's contract address:
53+
54+
```bash
55+
npx zksync-cli bridge deposit --token 0x3e622317f8C93f7328350cF0B56d9eD4C620C5d6
56+
```
57+
58+
## Bridge Withdraw
59+
60+
Transfer tokens from L2 back to L1.
61+
62+
```bash
63+
npx zksync-cli bridge withdraw
64+
```
65+
66+
### Withdraw Options
67+
68+
You will be prompted to enter options if they are not specified.
69+
70+
- `--to, --recipient <0x address>`: Recipient address on L1.
71+
- `--amount <0.1>`: Amount to withdraw.
72+
- `--token <0x address>`: ERC-20 token address (omit this option to withdraw ETH).
73+
- `--pk, --private-key <wallet private key>`: Private key of the sender.
74+
- `--chain <chain>`: Chain to use.
75+
- `--l1-rpc <URL>`: Override L1 RPC URL.
76+
- `--rpc <URL>`: Override L2 RPC URL.
77+
78+
### Withdrawing ERC-20 Tokens
79+
80+
For withdrawing ERC-20 tokens, specify the token address using the `--token` option:
81+
82+
```bash
83+
npx zksync-cli bridge withdraw --token 0x3e622317f8C93f7328350cF0B56d9eD4C620C5d6
84+
```
85+
86+
## Withdraw Finalize
87+
88+
Finalize the withdrawal of funds with the following command. This step is necessary to complete the withdrawal process initiated on L2.
89+
90+
```bash
91+
npx zksync-cli bridge withdraw-finalize
92+
```
93+
94+
### Finalize Withdraw Options
95+
96+
Options will be prompted if not specified.
97+
98+
- `--hash <transaction_hash>`: L2 withdrawal transaction hash to finalize.
99+
- `--pk, --private-key <wallet private key>`: Private key of the sender.
100+
- `--chain <chain>`: Chain to use.
101+
- `--l1-rpc <URL>`: Override L1 RPC URL.
102+
- `--rpc <URL>`: Override L2 RPC URL.
103+
104+
## Troubleshooting
105+
106+
If you encounter any issues, please consult our [troubleshooting guide](../../zksync-cli/troubleshooting.md) or report them in our [GitHub discussions](https://github.com/zkSync-Community-Hub/zksync-developers/discussions/new?category=general).

0 commit comments

Comments
 (0)