Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clique POA Signed recently must wait for others

This is my first time on this i hope somebody can understand my grammar and question. I have created 2 nodes using puppeth and choosing Clique for my private Ethereum. Both nodes are sealer (verify on both nodes using clique.getSigners()) and both can see each other as peer (verify using admin.peers). When I started to mine for both nodes using the code below, both nodes stuck at Signed recently, must wait for others

geth personal.unlockAccount(eth.coinbase)

geth eth.defaultAccount = eth.coinbase

geth miner.start()

Screenshot for both nodes

Below are the steps for creating node 1 (already create genesis using puppeth)

  1. geth --datadir "folder" init "genesis.json"
  2. geth --datadir "folder” --networkid [Network provided] –nodiscover
  3. Separate console - geth attach ipc:\.\pipe\geth.ipc
  4. admin.addPeer(enode of node 2)

Below are the steps for creating node 2 (already create genesis using puppeth)

  1. geth --datadir "folder" init "genesis.json"
  2. geth --datadir "folder” --networkid [Network provided] –nodiscover
  3. Separate console - geth attach ipc:\.\pipe\geth.ipc
  4. get enode admin.nodeInfo.enode and use admin.addPeer in node 1

Check signers - clique.getSigners - both of the account appear

Check peers for both node - admin.peers - both are okay

Then both mine using below code

geth personal.unlockAccount(eth.coinbase)

geth eth.defaultAccount = eth.coinbase

geth miner.start()

like image 967
qarina teal Avatar asked May 01 '18 07:05

qarina teal


2 Answers

I had the same issue before. My solution is terminate the node 2, then run it again.

like image 136
Long Nguyen Avatar answered Nov 14 '22 07:11

Long Nguyen


It is probably a good idea to use bootnodes to help the peering. (Me too was a bit skeptical about the idea before starting using it, but it dramatically reduces the chance of something going wrong, because you can monitor all the nodes activity via it). It is really easy to use and easy to scale using it.

Anyway, regarding your issue: they're definitely on different networks (see they are both sealing the second block, thus they are on different network). Check whether the port and rpcport are different and the networkid the same.

Some general thoughts I always check first are the following:

  • Different nodes on the network will always have different ports and rpcports.
  • Bootnodes serve as attachment nodes for peers on different networks (or even on the same, should you want). Thus it is a good idea to know the IP address of the machine hosting the bootnode and reference it when calling Geth on the added peers.
  • The Genesis file should always be the same, even across different nodes. You can either declare all signers at the Genesis file, even before spinning the node at the other machines, or add them voting afterwards.
  • Same networkid for all the peer nodes too!

Additionally, I don't mean to be picky but just so we can use the appropriate language and not get confused across different consensus protocols. Although the Geth command is the same (mine), on PoA consensus there is no such a concept of mining. The blocks are minted, so the signing nodes (authority nodes either determined by the Genesis block or voted for afterwards) only gather the pending transactions, verify them, and seal a new block, broadcasting it for the other nodes. Moreover, Clique does not use voting system and our colleague Marcos said above, like BFT protocols. Clique uses purely PoA where the signers seal blocks and add them to the chain.

Happy to discuss further as I am very keen on these applications!

Stay tuned!

Cheers,

like image 42
epm-bt Avatar answered Nov 14 '22 08:11

epm-bt