Skip to content

Latest commit

 

History

History
195 lines (122 loc) · 3.83 KB

setup-dev.md

File metadata and controls

195 lines (122 loc) · 3.83 KB

Prerequisites

Docker

Install docker. It is recommended to follow the instructions from the official site.

Installing docker via snap or from the default repository can cause troubles.

You need to install both docker and docker-compose.

Note: On linux you may encounter the following error when you'll try to work with zksync:

ERROR: Couldn't connect to Docker daemon - you might need to run `docker-machine start default`.

If so, you do not need to install docker-machine. Most probably, it means that your user is not added to the docker group. You can check it as follows:

docker-compose up # Should raise the same error.
sudo docker-compose up # Should start doing things.

If the first command fails, but the second succeeds, then you need to add your user to the docker group:

sudo usermod -a -G docker your_user_name

After that, you should logout and login again (user groups are refreshed after the login). The problem should be solved at this step.

Node & Yarn

  1. Install Node. Be sure to install Node v10.20.1 or higher. Lower 10x versions (e.g. v10.16.1) can cause mysterious errors, which won't look related to the Node itself.

  2. Install yarn. Instructions can be found on the official site.

  3. Run yarn global add @vue/cli-service

Axel

Install axel for downloading keys:

On mac:

brew install axel

On debian-based linux:

sudo apt-get install axel

gnu-sed

On mac:

brew install gnu-sed

On linux sed is available by default in most cases.

Envsubst (to transpile k8s yaml files)

On mac:

brew install gettext
brew link --force gettext 

On debian-based linux it should be available by default, if not, run:

sudo apt-get install gettext

Rust

Install the latest rust version.

Instructions can be found on the official site.

Verify the rust installation:

rustc --version
rustc 1.41.0 (5e1a79984 2020-01-27)

JQ

jq is used to work with JSON when managing DigitalOcean.

On mac:

brew install jq

On debian-based linux:

sudo apt-get install jq

PSQL

Install psql CLI tool to interact with postgres.

On debian-based linux:

sudo apt-get install postgresql

Diesel

Install diesel CLI:

cargo install diesel_cli --no-default-features --features postgres

If at the install step you get the linkage errors, install the development version of libpq.

On debian-based linux:

sudo apt-get install libpq-dev

solc

You have to install solc v0.5.16. Instructions can be found at readthedocs.

The simplest option for linux is to use snap.

For mac you can install it as follows:

brew update
brew upgrade
brew tap ethereum/ethereum
brew install solidity@5

drone cli

drone cli used to create promotion jobs described here https://docs.drone.io/cli/install/

Environment

Edit the lines below and add them to your shell profile file (e.g. ~/.bash_profile):

# Add path here:
export ZKSYNC_HOME=/path/to/zksync

export PATH=$ZKSYNC_HOME/bin:$PATH

# If you're like me, uncomment:
# cd $ZKSYNC_HOME

Autocomplete configuration:

  • bash:

    complete -W "\`grep -oE '^[a-zA-Z0-9_.-]+:([^=]|$)' $ZKSYNC_HOME/Makefile | sed 's/[^a-zA-Z0-9_.-]*$//'\`" zksync
  • zsh:

    echo "fpath=(~/.zsh_comp $fpath)" >> ~/.zshrc
    
    mkdir -p ~/.zsh_comp

    add ~/.zsh_comp/_zksync:

    #compdef zksync
    
    cmds=( ${(uf)"$(grep -oE '^[a-zA-Z0-9_.-]+:([^=]|$)' $ZKSYNC_HOME/Makefile | sed 's/[^a-zA-Z0-9_.-]*$//')"} )
    
    _describe 'zksync make cmds' cmds