Skip to content

Commit e980375

Browse files
authored
feat: all in one local setup (#55)
1 parent 2913e73 commit e980375

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+14530
-8435
lines changed

β€Ž.eslintrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"extends": ["@matterlabs/eslint-config-typescript"],
33
"rules": {
4-
"no-console": "off",
54
"no-multiple-empty-lines": ["error", { "max": 1 }],
6-
"@typescript-eslint/no-namespace": "off"
5+
"@typescript-eslint/no-namespace": "off",
6+
"import/no-named-as-default-member": "off"
77
}
88
}

β€Ž.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This CODEOWNERS file sets the individuals responsible for code in the era-test-node repository.
1+
# This CODEOWNERS file sets the individuals responsible for code in the zksync-cli repository.
22

33
# These users are the default owners for everything in the repo.
44
# They will be requested for review when someone opens a pull request.

β€Ž.github/CONTRIBUTING.md

-6
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@ Hello, contributor! Thanks for thinking about helping with the `zkSync Era CLI`
2424

2525
- **Write your code.** Keep your code clear and easy to understand. It helps everyone.
2626

27-
- **Test your code.** Make sure your code is covered with tests and all tests are passing:
28-
29-
```bash
30-
npm run test
31-
```
32-
3327
- **Build and check your code.** Before you ask others to look at your code, make sure it works well. You can use these commands:
3428

3529
```bash

β€Ž.github/workflows/pr-validation.yml

-9
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,3 @@ jobs:
2222
run: npm ci
2323
- name: Lint
2424
run: npm run lint && npm run typecheck
25-
- name: Test
26-
run: npm run test -- --ci --reporters=default --reporters=jest-junit
27-
- name: Publish Test Results
28-
uses: EnricoMi/publish-unit-test-result-action/composite@v1
29-
if: always()
30-
with:
31-
files: "junit.xml"
32-
check_run_annotations: all tests, skipped tests
33-
report_individual_runs: "true"

β€ŽREADME.md

+31-23
Original file line numberDiff line numberDiff line change
@@ -14,47 +14,55 @@ This CLI tool simplifies the process of developing applications and interacting
1414

1515
## πŸ›  Prerequisites
1616

17-
- Node.js v18.x
18-
- NPM / Yarn
17+
- [Node.js v18 or higher](https://nodejs.org/en)
18+
- [Git](https://git-scm.com/downloads)
19+
- [Docker](https://www.docker.com/get-started/) (for `zksync-cli dev` commands)
20+
- [Yarn](https://v3.yarnpkg.com/getting-started/install) (for `zksync-cli create-project`)
1921

20-
## πŸ“₯ Installation
22+
## πŸ“₯ Usage
2123

22-
You can install this program globally with `npm i -g zksync-cli` or run the commands directly via NPX with `npx zksync-cli@latest {COMMAND}`.
24+
You can run the commands directly via NPX with `npx zksync-cli {COMMAND}`.
25+
Or you can install the CLI globally with `npm i -g zksync-cli` and run the commands with `zksync-cli {COMMAND}`.
2326

2427
## πŸ’» Commands
2528

26-
- `zksync-cli deposit`: deposits funds from Ethereum (L1) to zkSync (L2)
29+
### Local development commands
30+
`zksync-cli dev` - All-in-one tool for local zkSync development. It allows to easily start zkSync stack locally, for example: local Ethereum and zkSync nodes, Wallet and Bridge.
2731

28-
- `zksync-cli withdraw`: withdraws funds from zkSync (L2) to Ethereum (L1)
32+
**General:**
33+
- `zksync-cli dev start` - start local development environment (will ask to configure if starting for the first time)
34+
- `zksync-cli dev clean` - clean data for configured modules
35+
- `zksync-cli dev config` - select modules to run in local development environment
36+
37+
**Modules:**
38+
39+
In addition to default modules, you can install custom modules from NPM.
40+
41+
- `zksync-cli dev install [module-name]` - install module with NPM (e.g. `zksync-cli dev i zkcli-dummy-module`)
42+
- `zksync-cli dev modules` - displays list of installed modules
43+
44+
Run `zksync-cli dev` to see the full list of commands.
2945

46+
### Bridge commands
47+
- `zksync-cli deposit`: deposits funds from Ethereum (L1) to zkSync (L2)
48+
- `zksync-cli withdraw`: withdraws funds from zkSync (L2) to Ethereum (L1)
3049
- `zksync-cli withdraw-finalize`: finalizes withdrawal of funds from zkSync (L2) to Ethereum (L1)
3150

51+
### Create project commands
3252
- `zksync-cli create-project {FOLDER_NAME}`: creates project from template in the specified folder
3353

54+
### Other commands
3455
- `zksync-cli help`: Provides information about all supported commands
35-
3656
- `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)
37-
3857
- `zksync-cli --version`: Returns the current version
3958

40-
- `zksync-cli localnet`: Manages a local zkSync Era and Ethereum L1 testnet (it requires docker running on your system). It supports a set of sub-subcommands:
41-
- `zksync-cli localnet up`: Bootstrap L1 and L2 localnets.
42-
- `zksync-cli localnet down`: clear L1 and L2 localnets.
43-
- `zksync-cli localnet start`: start L1 and L2 localnets.
44-
- `zksync-cli localnet stop`: stop L1 and L2 localnets.
45-
- `zksync-cli localnet logs`: Display logs.
46-
- `zksync-cli localnet help`: Display this message and quit.
47-
- `zksync-cli localnet wallets`: Display seeded wallet keys.
4859

49-
### πŸ”— Supported chains
60+
### πŸ”— Supported bridge chains
5061

51-
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://...`
62+
By default zkSync CLI bridge commands support 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://...`
5263

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

55-
### βš™οΈ Options (flags)
56-
- `--zeek`: zeek, the dev cat, will search for an inspirational quote and provide to you at the end of any command.
57-
5866
## πŸ‘©β€πŸ’» Developing new features
5967

6068
### Run in development mode
@@ -70,8 +78,8 @@ If you're using [local setup (dockerized testing node)](https://github.com/matte
7078

7179
### Testing
7280

73-
1. Make sure you have all dependencies installed with `npm i`.
74-
2. Run `npm run test` to run all tests.
81+
At the moment, we don't have any tests, but we are working on it.
82+
In the meantime, you can test the code manually by running the code in [development mode](#run-in-development-mode).
7583

7684
### πŸ“Š Tracking
7785

β€Žcommitlint.config.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
/* eslint-env node */
2-
module.exports = { extends: ["@commitlint/config-conventional"] };
1+
export default { extends: ["@commitlint/config-conventional"] };

β€Žjest.config.ts

-5
This file was deleted.

0 commit comments

Comments
Β (0)