Clique POA Signed recently must wait for others
Asked Answered
B

4

8

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()

Bicameral answered 1/5, 2018 at 7:30 Comment(1)
Have you checked that there are not any other peers in your network? Because Clique needs at least 50%+1 votes in order to seal.Shavers
H
5

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

Hyperbole answered 18/5, 2018 at 2:6 Comment(0)
D
2

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,

Divisor answered 23/10, 2018 at 13:50 Comment(0)
M
1

node1 add node2 enode address by admin.addPeer()

Mercia answered 26/6, 2018 at 6:51 Comment(0)
S
1

I think you need to add to the geth --syncmode "full" and maybe the problem also is that nodes starting too close together. Try to add sleep between miner.start()

Sillimanite answered 25/8, 2022 at 15:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.