Giter Club home page Giter Club logo

polygon-edge-compose's Introduction

Polygon Edge docker-compose / docker-stack deployment

Overview

This docker compose file simplifies the deployment of Polygon Edge in containerized environment. The trouble with this deployment is that the chain needs to be initialized before the server can be started. Before starting the chain two worker containers are started so that the chain can be initialized and destroyed after the job is done. Blockchain data and genesis.json are persisted with volumes bind mounts.

Usage

Prequestites

docker and docker-compose

Clone repo or simply copy paste docker-compse.yaml and run docker-compose up. Docker compose docs This will start a chain with default parameters. You should be able to interact with the chain on the default http port ( port 80 ) To test this run curl localhost, you should get a responce Polygon Edge JSON-RPC

Customisation

Genesis

You can customise the genesis.json file parameters, by adding your own parameters to the command: ["-mode","genesis"]. The available options are:

-num-nodes ( default 4 )
-premine account:ammount
-chain-id ( default 5100 )
-chain-name ( default polygon-edge )
-block-gas-limit
-epoch-size

the rest are defaults from genesis command.

For example, if we would like to set chain name the command for genesis-ledge container would be command: ["-mode","genesis","-chain-name","my-awsome-chain"].

Server

To customize server command follow the cli commands docs. For every node, you can add additional arguments to the command: field.

Number of nodes

If you'd like to run more than default 4 nodes, the following rules must be applied:

  • init-ledge and genesis-ledge containers must run with -num-nodes parameter, defining the total number of nodes
  • the name of node data volume must match container name
  • no arbitrary container names are allowed, container name must start with node + the node number
  • the container and volume names must increment in steps of 1 ( node1, node2, etc. )
  • init-ledge and genesis-ledge must have data directories of all nodes, named as described above

Proxy

The additional container is nginx proxy with very basic config file, bind mounted for easy configuration. Nginx is proxying JSON-RPC requests to all 4 nodes with round-robin method. You can easily configure this config file to suit your needs.

polygon-edge-compose's People

Contributors

zeljkobenovic avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.