diff --git a/docs/development.md b/docs/development.md index 479a465db4..2d03f2662b 100644 --- a/docs/development.md +++ b/docs/development.md @@ -178,7 +178,8 @@ zk test db zk run loadtest # Has to be run in the 3rd terminal ``` - **Note**. If you have compilation issues with `sqlx`, then make sure to run `zk up` before running the tests. + **Note**. If you have compilation issues with `sqlx`, then make sure to run `zk up` before running the tests. Also, if + you see some tests fail, might need to call `zk db reset` and restart the tests. ## Developing circuit diff --git a/docs/launch.md b/docs/launch.md index 65ee4b16fe..094d997ab7 100644 --- a/docs/launch.md +++ b/docs/launch.md @@ -18,7 +18,8 @@ zk init During the first initialization you have to download around 8 GB of setup files, this should be done once. If you have a problem on this step of the initialization, see help for the `zk run plonk-setup` command. -If you any other problems with the `zk init` command, go to the `Troubleshooting` section at the end of this file. There are solutions for some common error cases. +If you any other problems with the `zk init` command, go to the `Troubleshooting` section at the end of this file. There +are solutions for some common error cases. To completely reset the dev environment: @@ -93,18 +94,22 @@ output. ## Troubleshooting ### Invalid mount config for type "bind" + **Problem.** `zk init` failes with the following error: + ```sh Cannot create container for service geth: invalid mount config for type "bind": bind source path does not exist: /home/stanislav/matter-labs/zksync-dev/volumes/geth -``` +``` You might also see these errors not only for geth, but also for `postgres` and `tesseracts`. -**Solution**. In the repository folder there should be a folder `volumes`, with three folders inside of it: `geth`, `tesseracts`, `postgres`. If some of these are missing, you must create them on your own. +**Solution**. In the repository folder there should be a folder `volumes`, with three folders inside of it: `geth`, +`tesseracts`, `postgres`. If some of these are missing, you must create them on your own. ### SSL error: certificate verify failed **Problem**. `zk init` failes with the following error: + ```sh Initializing download: https://universal-setup.ams3.digitaloceanspaces.com/setup_2%5E20.key SSL error: certificate verify failed @@ -115,6 +120,7 @@ SSL error: certificate verify failed ### rmSync is not a function **Problem**. `zk init` failes with the following error: + ```sh fs_1.default.rmSync is not a function ``` diff --git a/docs/setup-dev.md b/docs/setup-dev.md index 7b4a0e443f..3d3658be2b 100644 --- a/docs/setup-dev.md +++ b/docs/setup-dev.md @@ -36,8 +36,9 @@ If logging out does not help, restarting the computer should. ## `Node` & `Yarn` -1. Install `node` (requires version 14.14.0 or higher). -Since our team tries to always use the latest LTS version of `node.js`, we suggest you to install [nvm](https://github.com/nvm-sh/nvm). It will allow you to update the node version quickly in the future. +1. Install `Node` (requires version 14.14.0 or higher). Since our team attempts to always use the latest LTS version of + `Node.js`, we suggest you to install [nvm](https://github.com/nvm-sh/nvm). It will allow you to update `Node.js` + version easily in the future. 2. Install `yarn`. Instructions can be found on the [official site](https://classic.yarnpkg.com/en/docs/install/). @@ -47,7 +48,9 @@ Check if yarn is installed by running the following command: $ yarn -v ``` -If you face any problems when installing `yarn`, it might be the case that your package manager installed the wrong package. Make sure to thoroughly follow the instructions above on the official website. It has a lot of troubleshooting guides in it. +If you face any problems when installing `yarn`, it might be the case that your package manager installed the wrong +package. Make sure to thoroughly follow the instructions above on the official website. It has a lot of troubleshooting +guides in it. 3. Run `yarn global add @vue/cli-service` @@ -143,18 +146,27 @@ Also, we need [`sqlx`](https://github.com/launchbadge/sqlx) CLI (it is used to g cargo install --version=0.2.0 sqlx-cli ``` -If you face an error `Could not find directory of OpenSSL installation`, then you should do the following. The instruction is targeted on debian-based Linux, but generally the steps are similar for all OS. +If you face an error `Could not find directory of OpenSSL installation`, then you should do the following. The +instruction is targeted on debian-based Linux, but generally the steps are similar for all OS. - Install `libssl-dev`: + ```sh sudo apt install libssl-dev ``` -- Install OpenSSL. Here is [the instruction for Ubuntu](https://www.notion.so/matterlabs/Setup-checklist-056a2e5c3a104608a5a25788520ef0ff#5f34729bdffe496f9d38c46787c640d7), but the steps should be similar for the debian-based Linux distros. -- Add `OPENSSL_DIR` variable to your environment. This would typically be `/usr/local/ssl`. You can do this by adding the following line to your shell profile file (e.g. `~/.bash_profile`): + +- Install OpenSSL. Here is + [the instruction for Ubuntu](https://www.notion.so/matterlabs/Setup-checklist-056a2e5c3a104608a5a25788520ef0ff#5f34729bdffe496f9d38c46787c640d7), + but the steps should be similar for the debian-based Linux distros. +- Add `OPENSSL_DIR` variable to your environment. This would typically be `/usr/local/ssl`. You can do this by adding + the following line to your shell profile file (e.g. `~/.bash_profile`): + ```sh export OPENSSL_DIR=/usr/local/ssl ``` + - Install `package-config`: + ```sh sudo apt-get install -y pkg-config ``` diff --git a/infrastructure/zk/src/init.ts b/infrastructure/zk/src/init.ts index 04126f4ec9..7fc0051119 100644 --- a/infrastructure/zk/src/init.ts +++ b/infrastructure/zk/src/init.ts @@ -33,6 +33,8 @@ async function checkEnv() { } await utils.exec('cargo sqlx --version'); const { stdout: version } = await utils.exec('node --version'); + // Node v.14.14 is required because + // the `fs.rmSync` function was added in v14.14.0 if ('v14.14' >= version) { throw new Error('Error, node.js version 14.14.0 or higher is required'); }