Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Add clique support #115

Merged
merged 5 commits into from
Nov 20, 2020
Merged

Add clique support #115

merged 5 commits into from
Nov 20, 2020

Conversation

libby
Copy link
Contributor

@libby libby commented Nov 19, 2020

Adding clique support as per #114

To test locally run (qubernetes container not updated yet)

1. with qctl

build qctl on this branch

> git clone https://github.com/libby/qubernetes.git
> git checkout add-clique-support
> cd qubernetes/qctl
> go install

build the qubernetes container locally

> cd qubernetes
> ./docker-build latest username/qubernetes-local 

create a clique network via qctl and use the local container you just built --qcontainer username/qubernetes-local
follow export prompts at the end of each qctl command, e.g. $> export QUBE_K8S_DIR=/PATH/qctl-config/mini/out

> qctl init --num 4 --consensus clique
> qctl generate network --create --qcontainer username/qubernetes-local

start minikube minikube start --memory 6144, kind, docker k8s, or whatever K8s runtime you test with
Then run

> qctl deploy network --wait

test clique network

> qctl test contract quorum-node1
> qctl geth exec quorum-node1 'eth.blockNumber'
> qctl geth attach quorum-node1
INFO[0000] attaching to geth  pods [quorum-node1-deployment-7df95555dd-mvv8v]
connecting to geth /etc/quorum/qdata
Welcome to the Geth JavaScript console!

instance: Geth/v1.9.7-stable-6005360c(quorum-v2.7.0)/linux-amd64/go1.13.13
coinbase: 0xac5ecc27f1c50e1a5725ab662700fc7dd59a5527
at block: 2 (Thu, 19 Nov 2020 23:22:10 UTC)
 datadir: /etc/quorum/qdata/dd
 modules: admin:1.0 clique:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 quorumExtension:1.0 rpc:1.0 txpool:1.0 web3:1.0

> clique.getSigners()
["0xa255119f5c4546f36f54b80140531606c0cf3c5c", "0xac5ecc27f1c50e1a5725ab662700fc7dd59a5527", "0xacb35640ae0f95293013c8db30147cf654867a6a", "0xda4c8028322201c2bd820faebb26c3a366dd0b11"]

2. Running locally without qctl and qubernetes build container

you need ethkey in your path to run locally

> ./qube-init examples/config/clique.yaml

start minikube, kind, docker k8s

kubectl apply -f out -f out/deployments

test execing a contract

> qclt test contract quorum-node1

attach to node and test clique


> qctl geth attach quorum-node1

instance: Geth/v1.9.7-stable-9339be03(quorum-v2.6.0)/linux-amd64/go1.13.10
coinbase: 0x72e3f1956a9bc007ea860df650c73d250997392c
at block: 2 (Thu, 19 Nov 2020 21:39:30 UTC)
 datadir: /etc/quorum/qdata/dd
 modules: admin:1.0 clique:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0

> clique.getSigners()
["0x54128defab1dac803092d0e56d4115287d9f639b", "0x72e3f1956a9bc007ea860df650c73d250997392c", "0x899a0c5096bdfa5ba0d66612c2406a33cc1b14f3", "0xb98874a8457a0945062c01f892ddfdfc94f5a6da"

In the genesis template don't repeat shared config sections, e.g.
account alloc, coinbase, homesteadBlock, byzantiumBlock, etc.
This will make it easier to add support for additional consensus, e.g.
clique.
Add clique support when generating genesis.json and node deployments.
Add example clique.yaml for generating a clique network
(examples/config/clique.yaml), to run locally if setup to do so run
> ./qube-init examples/config/clique.yaml
@libby libby requested a review from jbhurat November 19, 2020 21:43
Fix quorum-config generation, only generate istanbul-validator.toml if
the consensus is an ibft variant. Get the consensus from the genesis
section of the qubernetes config.
Sometimes it is useful to use a diffent qubernetes build container, e.g.
when developing testing locally, this adds support for passing in the
qubernetes build container if a build container other than
"quorumengineering/qubernetes" is needed:

> qctl generate network --create --qcontainer username/qubernetes-local
Copy link
Contributor

@jbhurat jbhurat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@libby libby merged commit e1b0241 into Consensys:master Nov 20, 2020
@libby libby mentioned this pull request Dec 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants