Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
hickscorp committed Oct 30, 2018
0 parents commit 9988c8f
Show file tree
Hide file tree
Showing 19 changed files with 1,216 additions and 0 deletions.
Empty file added .gitignore
Empty file.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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:

```bash
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:

```bash
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:

```bash
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.
1 change: 1 addition & 0 deletions boot.key
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8d40c21d502a20bdcd20a1df0db339dece7ef4d42981b35f0f6bd9bf7cca167f
80 changes: 80 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
version: "3"

services:
# The bootnode is the rendez-vous point for all other nodes.
bootnode:
image: ethereum/client-go:alltools-release-1.8
restart: on-failure
hostname: bootstrap
ports:
- 30303:30303
volumes:
- ./scripts:/scripts:ro
- ./boot.key:/boot.key:ro
- /etc/localtime:/etc/localtime:ro
command: /scripts/bootnode.sh
# The node container is our entry point to issue RPC commands
# but it's not sealing.
node:
image: ethereum/client-go:alltools-release-1.8
restart: on-failure
links: [bootnode]
ports:
- 8544-8546:8544-8546
volumes:
- ./scripts:/scripts:ro
- ./keystore:/keystore:ro
- ./genesis.json:/genesis.json:ro
- /etc/localtime:/etc/localtime:ro
command: /scripts/node.sh 0x627306090abab3a6e1400e9345bc60c78a8bef57
# Sealer nodes are workers that commit blocks constantly.
sealer-one:
image: ethereum/client-go:alltools-release-1.8
restart: on-failure
links: [bootnode]
volumes:
- ./scripts:/scripts:ro
- ./keystore:/keystore:ro
- ./genesis.json:/genesis.json:ro
- /etc/localtime:/etc/localtime:ro
command: /scripts/sealer.sh 0xf17f52151ebef6c7334fad080c5704d77216b732
sealer-two:
image: ethereum/client-go:alltools-release-1.8
restart: on-failure
links: [bootnode]
volumes:
- ./scripts:/scripts:ro
- ./keystore:/keystore:ro
- ./genesis.json:/genesis.json:ro
- /etc/localtime:/etc/localtime:ro
command: /scripts/sealer.sh 0xc5fdf4076b8f3a5357c5e395ab970b5b54098fef
sealer-three:
image: ethereum/client-go:alltools-release-1.8
restart: on-failure
links: [bootnode]
volumes:
- ./scripts:/scripts:ro
- ./keystore:/keystore:ro
- ./genesis.json:/genesis.json:ro
- /etc/localtime:/etc/localtime:ro
command: /scripts/sealer.sh 0x821aea9a577a9b44299b9c15c88cf3087f3b5544
sealer-four:
image: ethereum/client-go:alltools-release-1.8
restart: on-failure
links: [bootnode]
volumes:
- ./scripts:/scripts:ro
- ./keystore:/keystore:ro
- ./genesis.json:/genesis.json:ro
- /etc/localtime:/etc/localtime:ro
command: /scripts/sealer.sh 0x0d1d4e623d10f9fba5db95830f7d3839406c6af2
sealer-five:
image: ethereum/client-go:alltools-release-1.8
restart: on-failure
links: [bootnode]
volumes:
- ./scripts:/scripts:ro
- ./keystore:/keystore:ro
- ./genesis.json:/genesis.json:ro
- /etc/localtime:/etc/localtime:ro
command: /scripts/sealer.sh 0x2932b7a2355d6fecc4b5c0b6bd44cc31df247a2e
Loading

0 comments on commit 9988c8f

Please sign in to comment.