Skip to content

Commit

Permalink
feat: all in one local setup (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
JackHamer09 authored Oct 3, 2023
1 parent 2913e73 commit e980375
Show file tree
Hide file tree
Showing 60 changed files with 14,530 additions and 8,435 deletions.
4 changes: 2 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"extends": ["@matterlabs/eslint-config-typescript"],
"rules": {
"no-console": "off",
"no-multiple-empty-lines": ["error", { "max": 1 }],
"@typescript-eslint/no-namespace": "off"
"@typescript-eslint/no-namespace": "off",
"import/no-named-as-default-member": "off"
}
}
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-cli 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
6 changes: 0 additions & 6 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ Hello, contributor! Thanks for thinking about helping with the `zkSync Era CLI`
- **Write your code.** Keep your code clear and easy to understand. It helps everyone.
- **Test your code.** Make sure your code is covered with tests and all tests are passing:
```bash
npm run test
```
- **Build and check your code.** Before you ask others to look at your code, make sure it works well. You can use these commands:
```bash
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,3 @@ jobs:
run: npm ci
- name: Lint
run: npm run lint && npm run typecheck
- name: Test
run: npm run test -- --ci --reporters=default --reporters=jest-junit
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/composite@v1
if: always()
with:
files: "junit.xml"
check_run_annotations: all tests, skipped tests
report_individual_runs: "true"
54 changes: 31 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,47 +14,55 @@ This CLI tool simplifies the process of developing applications and interacting

## 🛠 Prerequisites

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

## 📥 Installation
## 📥 Usage

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}`.
You can run the commands directly via NPX with `npx zksync-cli {COMMAND}`.
Or you can install the CLI globally with `npm i -g zksync-cli` and run the commands with `zksync-cli {COMMAND}`.

## 💻 Commands

- `zksync-cli deposit`: deposits funds from Ethereum (L1) to zkSync (L2)
### Local development commands
`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.

- `zksync-cli withdraw`: withdraws funds from zkSync (L2) to Ethereum (L1)
**General:**
- `zksync-cli dev start` - start local development environment (will ask to configure if starting for the first time)
- `zksync-cli dev clean` - clean data for configured modules
- `zksync-cli dev config` - select modules to run in local development environment

**Modules:**

In addition to default modules, you can install custom modules from NPM.

- `zksync-cli dev install [module-name]` - install module with NPM (e.g. `zksync-cli dev i zkcli-dummy-module`)
- `zksync-cli dev modules` - displays list of installed modules

Run `zksync-cli dev` to see the full list of commands.

### Bridge commands
- `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)

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

### Other commands
- `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

- `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:
- `zksync-cli localnet up`: Bootstrap L1 and L2 localnets.
- `zksync-cli localnet down`: clear L1 and L2 localnets.
- `zksync-cli localnet start`: start L1 and L2 localnets.
- `zksync-cli localnet stop`: stop L1 and L2 localnets.
- `zksync-cli localnet logs`: Display logs.
- `zksync-cli localnet help`: Display this message and quit.
- `zksync-cli localnet wallets`: Display seeded wallet keys.

### 🔗 Supported chains
### 🔗 Supported bridge 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://...`
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://...`

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`.

### ⚙️ Options (flags)
- `--zeek`: zeek, the dev cat, will search for an inspirational quote and provide to you at the end of any command.

## 👩‍💻 Developing new features

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

### Testing

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

### 📊 Tracking

Expand Down
3 changes: 1 addition & 2 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/* eslint-env node */
module.exports = { extends: ["@commitlint/config-conventional"] };
export default { extends: ["@commitlint/config-conventional"] };
5 changes: 0 additions & 5 deletions jest.config.ts

This file was deleted.

Loading

0 comments on commit e980375

Please sign in to comment.