Adding Signer Node to Private Ethereum Network

By | 20. August 2020

Last time topic was Adding Another Node to Private Ethereum Network now we will have look how to add Sealer in Proof of Authority chain.

Sealer on a PoA is like a miner on PoW. You can start a sealer with geth –mine –unlock “0xa132432bf” with a genesis using the clique consensus. The initial sealers are defined in the genesis block.

The protocol defines a voting mechanism to dynamically add new signers and remove existing ones. In Geth this can be controlled via the clique.propose(address, authorized) method (clique_propose for remote RPC calls).

To authorize a new signer, existing ones can propose it via clique.propose(“0x…”, true). When more than half the signers proposed it, the authorization comes into effect immediately and the new account can start signing blocks.

Similarly, existing signers can propose deauthorizing existing ones via clique.propose(“0x…”, false). Again if half + 1 signers deauthorize a signer, it is immediately removed from the list and blocks minted by it are rejected from that point onward.

Clique commands

  • list sealers clique.getSigners()
  • list propositions: clique.proposals
  • discard a proposition: clique.discard(“0x1234234234234”)
  • add a new sealer: clique.propose(“0x1234243214312”, true)
  • remove a sealer: clique.propose(“0x1234243214312”, false)

So we run next command on geth console for both nodes:

clique.propose("0x47698A0744d4645B8F8753E4285828DEc174FB6F", true)

Result can be confirmed with command:

clique.getSigners()

["0x47698a0744d4645b8f8753e4285828dec174fb6f", "0x2C80fc7FAE05Ec4daCC44465fa0a9989C3147bA1"]

If addition was successful then both  signer addresses should be in list.

Start mining on second node.

If you see message “Successfully sealed new block” then all is OK and you are ready to go.

If you see message “Signed recently, must wait for others” then there seems to be issue in two nodes connectivity or synchronization.

Usually restarting both nodes helps.

Tip.

In last article we added connection to other node using Geth console command like this:

admin.addPeer("enode://303bda0631f48b090d11c6e05fec25ff43b7432523c11557460fb78f79c87a436a59f7ee3cc2e6f493678b58220ee05a2c213daa8da655a748e13d1b45b8e2b2@127.0.0.1:3001")

Connection to node can also be added as permanent solution.

Geth supports a feature called static nodes if you have certain peers you always want to connect to. Static nodes are re-connected on disconnects. You can configure permanent static nodes by putting something like the following into /geth/static-nodes.json:

[
  "enode://303bda0631f48b090d11c6e05fec25ff43b7432523c11557460fb78f79c87a436a59f7ee3cc2e6f493678b58220ee05a2c213daa8da655a748e13d1b45b8e2b2@127.0.0.1:3001",
  "enode://pubkey@ip:port"
]

Bod info for geth node can be obtained via command admin.nodeInfo.enode

Leave a Reply