Skip to content

Commit

Permalink
Update local deployment README files (#1773)
Browse files Browse the repository at this point in the history
* Update docs

* Remove submodules part as it is not necessary for the local deployment

* Remove compiling contracts from docker script README

* Fix links
  • Loading branch information
Stefan-Ethernal committed Aug 8, 2023
1 parent 1ce87aa commit 4215337
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 26 deletions.
33 changes: 19 additions & 14 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
# Deploying local docker cluster

## Prerequisites

* [Docker Engine](https://docs.docker.com/engine/install/) - Minimum version 20.10.23
* [Docker compose v.1.x](https://docs.docker.com/compose/install/) - Minimum version 1.29

### `polybft` consensus

When deploying with `polybft` consensus, there are some additional dependencies:
* [npm](https://nodejs.org/en/)

* [go 1.20.x](https://go.dev/dl/)

## Local development

Running `polygon-edge` local cluster with docker can be done very easily by using provided `scripts` folder
or by running `docker-compose` manually.

### Using provided `scripts` folder

***All commands need to be run from the repo root / root folder.***

* `scripts/cluster ibft --docker` - deploy environment with `ibft` consensus
Expand All @@ -22,40 +26,41 @@ or by running `docker-compose` manually.
* `scripts/cluster {ibft or polybft}--docker destroy` - destroy environment (delete containers and volumes)

### Using `docker-compose`

***All commands need to be run from the repo root / root folder.***

#### use `ibft` PoA consensus

* `export EDGE_CONSENSUS=ibft` - set `ibft` consensus
* `docker-compose -f ./docker/local/docker-compose.yml up -d --build` - deploy environment

#### use `polybft` consensus
* `cd core-contracts && npm install && npm run compile && cd -` - install `npm` dependencies and compile smart contracts
* `go run ./consensus/polybft/contractsapi/artifacts-gen/main.go` generate needed code

* `export EDGE_CONSENSUS=polybft` - set `polybft` consensus
* `docker-compose -f ./docker/local/docker-compose.yml up -d --build` - deploy environment

#### stop / destroy
#### stop / destroy

* `docker-compose -f ./docker/local/docker-compose.yml stop` - stop containers
* `docker-compose -f ./docker/local/docker-compose.yml down -v` - destroy environment

## Customization
Use `docker/local/polygon-edge.sh` script to customize chain parameters.
All parameters can be defined at the very beginning of the script, in the `CHAIN_CUSTOM_OPTIONS` variable.
It already has some default parameters, which can be easily modified.

Use `docker/local/polygon-edge.sh` script to customize chain parameters.
All parameters can be defined at the very beginning of the script, in the `CHAIN_CUSTOM_OPTIONS` variable.
It already has some default parameters, which can be easily modified.
These are the `genesis` parameters from the official [docs](https://wiki.polygon.technology/docs/supernets/operate/supernets-param-reference).

Primarily, the `--premine` parameter needs to be edited to include the accounts that the user has access to.
Primarily, the `--premine` parameter needs to be edited to include the accounts that the user has access to.

## Considerations

### Submodules
Before deploying `polybft` environment, `core-contracts` submodule needs to be downloaded.
To do that, simply run `make download-submodules`.

### Build times

When building containers for the first time (or after purging docker build cache),
it might take a while to complete, depending on the hardware that the build operation is running on.

### Production
This is **NOT** a production ready deployment. It is to be used in *development* / *test* environments only.
For production usage, please check out the official [docs](https://wiki.polygon.technology/docs/edge/overview/).

This is **NOT** a production ready deployment. It is to be used in *development* / *test* environments only.
For production usage, please check out the official [docs](https://wiki.polygon.technology/docs/supernets).
23 changes: 11 additions & 12 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@
## Prerequisites

When deploying with `polybft` consensus, there are some additional dependencies:
* [npm](https://nodejs.org/en/)

* [go 1.20.x](https://go.dev/dl/)
* [jq](https://jqlang.github.io/jq)
* Netcat (nc)

## Local development

Running `polygon-edge` from local binary can be done very easily by using provided `scripts` folder.

* `scripts/cluster ibft` - deploy environment with `ibft` consensus
* `scripts/cluster polybft` - deploy environment with `polybft` consensus

## Customisation
Use `scripts/cluster` script to customize chain parameters.
## Customization

Use `scripts/cluster` script to customize chain parameters.
It already has some default parameters, which can be easily modified.
These are the `genesis` parameters from the official [docs](https://wiki.polygon.technology/docs/supernets/operate/supernets-param-reference).

Expand All @@ -24,15 +26,12 @@ Primarily, the `--premine` parameter needs to be edited (`createGenesis` functio
## Considerations

### Live console
The servers are run in foreground, meaning that the terminal console that is running the script
must remain active. To stop the servers - `Ctrl/Cmd + C`.
To interact with the chain use another terminal or run a dockerized environment by following the instructions
in `docker/README.md`.

### Submodules
Before deploying `polybft` environment, `core-contracts` submodule needs to be downloaded.
To do that simply run `make download-submodules`.
The servers are run in foreground, meaning that the terminal console that is running the script must remain active.
To stop the servers - `Ctrl/Cmd + C`.
To interact with the chain use another terminal or run a dockerized environment by following the instructions in `docker/README.md`.

### Production
This is **NOT** a production ready deployment. It is to be used in *development* / *test* environments only.
For production usage, please check out the official [docs](https://wiki.polygon.technology/docs/edge/overview/).

This is **NOT** a production ready deployment. It is to be used in *development* / *test* environments only.
For production usage, please check out the official [docs](https://wiki.polygon.technology/docs/supernets).

0 comments on commit 4215337

Please sign in to comment.