Code Monkey home page Code Monkey logo

docker-geth-cluster-poa's Introduction

Ethereum Proof of Authority

This repository is an example setup allowing an arbitrary number of sealer nodes to participate a Proof of Authority (PoA) concensus over an Ethereum network.

The provided genesis block defines a mining period of 5 seconds, and should allow the network to systain production at this frequency without any issue.

To start the example cluster, simply run docker-compose up. By default, only the first three nodes defined in the addresses array will be allowed to seal. To allow a new node to participate the network, that node needs to be proposed and voted in by 50% + 1 node. To do this, you can run in sequence:

docker-compose exec -T sealer-one geth --exec 'clique.propose("0x0d1d4e623d10f9fba5db95830f7d3839406c6af2", true)' attach
docker-compose exec -T sealer-two geth --exec 'clique.propose("0x0d1d4e623d10f9fba5db95830f7d3839406c6af2", true)' attach

At this point, the fourth node should be allowed to seal. To allow the fifth node to seal, you can run the following commands:

docker-compose exec -T sealer-one geth --exec 'clique.propose("0x2932b7a2355d6fecc4b5c0b6bd44cc31df247a2e", true)' attach
docker-compose exec -T sealer-two geth --exec 'clique.propose("0x2932b7a2355d6fecc4b5c0b6bd44cc31df247a2e", true)' attach
docker-compose exec -T sealer-four geth --exec 'clique.propose("0x2932b7a2355d6fecc4b5c0b6bd44cc31df247a2e", true)' attach

At this point, the fifth node should start being able to seal blocks as well.

At any time, you can retrieve the list of authorized sealers by running:

docker-compose exec -T node geth --exec 'clique.getSigners()' attach

To vote a node out of the network, you can use the same commands as described before and simply replace true by false.

Example: Transfer Wei

eth.getBalance(eth.accounts[0])
eth.sendTransaction({from: eth.accounts[1], to: eth.accounts[0], value: 10})

docker-geth-cluster-poa's People

Contributors

minhnguyenepi 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.