2

I was wondering if it was possible to easily plug new consensus into the geth client.

Actually, I tried to add a very simple "consensus" (which is a fully centralized proof of authority with a single node being able to validate blocks) based on the provided clique PoA, modifying its very source code. It compiled but ... well, it did not work ;-) I tried to "reverse engineer" the whole geth code but it is obviously quite a work. Do you know if there is any resource (as on-line documentation or UML) that may help me achieve my goal/understand the geth architecture ?

Note that clique PoA could be configured to be a "single noded validation" consensus, however, that is not the heart of my query here.

I wanted to start with the simplest "consensus" as a Proof-of-Concept (it will allow me to have a full understanding of the geth client). More complex consensus may be developed later once PoC is fully functional. Sure, geth source code is well-commented but it is not "that easy" to have good overview of the full geth architecture (dependencies and so on) without spending hours. Maybe someone already tried to do a similar thing.

Thanks,

Best regards,

Jeremy.

  • 1
    Hi there. Would you be open to using Parity, or does it have to be the Go client? (Parity already supports pluggable consensus... ) – Richard Horrocks Oct 16 '17 at 13:53
  • Thanks for your quick response ! Actually, I wish to keep working with geth but if it is not "possible", I'll be thinking in switching from geth to Parity. – Jérémy Métairie Oct 16 '17 at 14:03
  • I am having a challenge, where I have taken the parameters that I was starting geth with for a private chain and bake them into the source and recompiled but can't get it working. Not sure where I am going wrong or what I am missing. Can't find any good resources or other people to talk it through with. Gitter chat not very responsive. – Lismore Jan 19 '18 at 9:37
1

Support for various consensus engines is already thought in Ethereum.

In fact, there is already code for Clique:

params/config.go:74

Clique: &CliqueConfig{
    Period: 15,
    Epoch:  30000,
},

I don't know if it works, because it is on Rinkeby's test network, but you can start working from there.

The docs about Ethereum are very good and the source code is fully commented, just dive in and you are done

  • Yes, Clique works pretty well on the private network I built. However, the question was more about adding new consensus into geth, i.e. adding golang files to it (sorry if I was not clear enough). I wanted to start with the simplest "consensus" as a Proof-of-Concept. More complex consensus may be developed later once PoC is fully functional. Sure, geth source code is well-commented but it is not "that easy" to have good overview of the full geth architecture (dependencies and so on) without spending hours. Do you know if I could find docs that could help me understand the architecture ? Thx ! – Jérémy Métairie Oct 16 '17 at 14:52
  • @JérémyMétairie you will find this on YouTube from the dev staff itself, but I don't know of any links. Ethereum is a very complex framework, so if you don't have time , I suggest not to try, because you will need to spend a lot of hours to deliver something production-ready. – Nulik Oct 16 '17 at 16:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.