Skip to content
This repository has been archived by the owner on Feb 15, 2021. It is now read-only.

Commit

Permalink
update readme with better setup guide
Browse files Browse the repository at this point in the history
  • Loading branch information
furkhat committed Oct 20, 2019
1 parent 158e870 commit 1a48963
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 5 deletions.
33 changes: 30 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ Prepare dev environment prerequisites: see [docs/setup-dev.md](docs/setup-dev.md

## Setup local dev environment

First-time setup:

(TODO(furkhat): remove when this step is implented and merged with https://github.com/matter-labs/franklin/pull/104) On a fresh copy of a project, run this once to generate test contracts:
```./bin/prepare-test-contracts.sh```

Setup:

```franklin init```

Expand Down Expand Up @@ -62,13 +66,36 @@ Blockscout will be available at http://localhost:4000/txs

## Build and run server + prover locally:

Run server:
```
franklin server
```

By default block chunk size set to `100`. For testing & development purposes you
ca change it to smaller values. Two places requires a change:
1. Environment variable value in `./etc/env/dev.env` `BLOCK_SIZE_CHUNKS`
2. Rust constant at `./core/models/params.rs` `BLOCK_SIZE_CHUNKS`
If you apply changes, do not forget to redeploy contracts `franklin redeploy`.

You must prepare keys. This only needs to be done once:
```
./bin/gen-keys
franklin redeploy
```
Run prover:
```
franklin prover
franklin client
```

Client UI will be available at http://localhost:8080
Run client
```
franklin dist-config
cd js/client_js && yarn all_serve
```

Client UI will be available at http://localhost:8080.
Make sure you have environment variables set right, you can check it by running:
```franklin env```. You should see `* dev` in output.

## Start server and prover as local docker containers:

Expand Down
30 changes: 29 additions & 1 deletion docs/setup-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,18 @@ Install Node.

Install yarn.

`yarn global add @vue/cli-service`

## Axel

Install axel for downloading keys:

```brew install axel```

## gnu-sed for MAC

`brew install gnu-sed`

## Envsubst for mac (to transpile k8s yaml files)

```
Expand Down Expand Up @@ -62,8 +68,30 @@ Edit the lines below and add them to your shell profile file (e.g. `~/.bash_prof
export FRANKLIN_HOME=/path/to/franklin
export PATH=$FRANKLIN_HOME/bin:$PATH
complete -W "\`grep -oE '^[a-zA-Z0-9_.-]+:([^=]|$)' $FRANKLIN_HOME/Makefile | sed 's/[^a-zA-Z0-9_.-]*$//'\`" franklin
# If you're like me, uncomment:
# cd $FRANKLIN_HOME
```

Autocomplete configuration.

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

`zsh`:
```
echo "fpath=(~/.zsh_comp $fpath)" >> ~/.zshrc
mkdir -p ~/.zsh_comp
```
add `~/.zsh_comp/_franklin`:
```
#compdef franklin
cmds=( ${(uf)"$(grep -oE '^[a-zA-Z0-9_.-]+:([^=]|$)' $FRANKLIN_HOME/Makefile | sed 's/[^a-zA-Z0-9_.-]*$//')"} )
_describe 'franklin make cmds' cmds
```

2 changes: 1 addition & 1 deletion js/client_js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"serve": "f ../../bin/.gen_js_config > src/env-config.js && vue-cli-service serve",
"build": "f ../../bin/.gen_js_config > src/env-config.js && vue-cli-service build",
"all_serve": "cd ../franklin_lib && yarn tsc && cd ../client_js && rm -r node_modules && yarn && yarn serve",
"all_serve": "cd ../franklin_lib && yarn tsc && cd ../client_js && rm -rf node_modules && yarn && yarn serve",
"lint": "vue-cli-service lint"
},
"dependencies": {
Expand Down

0 comments on commit 1a48963

Please sign in to comment.