[Ethereum] How to add new nodes under PoA

evmgo-ethereumproof-of-authority

I implemented a PoA system successfully. But after the initial setup (eg two nodes), how are new nodes added? I understand that the acceptance of a new node is a voting process but I am not certain how that is implemented.

Here is the link I used for the setup –
https://hackernoon.com/setup-your-own-private-proof-of-authority-ethereum-network-with-geth-9a0a3750cda8

Output from machine 2 (which has nodes 3,4). Nodes 1,2 are on machine 1 and they both are signers. It shows on node 3 that the account is unlocked but it is not authorised.

more nohup.out INFO [04-14|17:22:17] Maximum peer count
ETH=25 LES=0 total=25 INFO [04-14|17:22:17] Starting peer-to-peer node
instance=Geth/v1.8.2-stable-b8b9f7f4/linux-amd64/go1.9.4 INFO
[04-14|17:22:17] Allocated cache and file handles
database=/home/satoshimaca/blockchain2/node3/geth/chaindata cache=7 68
handles=512 INFO [04-14|17:22:18] Initialised chain configuration
config="{ChainID: 1515 Homestead: 1 DAO: DAOSupport: false EI
P150: 2 EIP155: 3 EIP158: 3 Byzantium: 4 Constantinople: Engine:
clique}" INFO [04-14|17:22:18] Initialising Ethereum protocol
versions="[63 62]" network=1515 INFO [04-14|17:22:18] Loaded most
recent local header number=0 hash=fdb68b…8a634f td=1 INFO
[04-14|17:22:18] Loaded most recent local full block number=0
hash=fdb68b…8a634f td=1 INFO [04-14|17:22:18] Loaded most recent local
fast block number=0 hash=fdb68b…8a634f td=1 INFO [04-14|17:22:18]
Loaded local transaction journal transactions=0 dropped=0 INFO
[04-14|17:22:18] Regenerated local transaction journal
transactions=0 accounts=0 INFO [04-14|17:22:18] Starting P2P
networking INFO [04-14|17:22:20] UDP listener up
self=enode://7b13a6dc2fd5de476b2a579d702a36ec37587dad1cef7f99501835
4928a279a7733635e3cbd3b2fa1a261c2b37638f2aa46195bc7e1ebfa3c1875c84ecbc8087@[::]:30313
INFO [04-14|17:22:20] RLPx listener up
self=enode://7b13a6dc2fd5de476b2a579d702a36ec37587dad1cef7f99501835
4928a279a7733635e3cbd3b2fa1a261c2b37638f2aa46195bc7e1ebfa3c1875c84ecbc8087@[::]:30313
INFO [04-14|17:22:20] IPC endpoint opened
url=/home/satoshimaca/blockchain2/node3/geth.ipc INFO [04-14|17:22:20]
HTTP endpoint opened url=http://localhost:8503
cors= vhosts=local host INFO [04-14|17:22:21] Unlocked account
address=0xC08832c6cB6df14340F3866B293a705FB9bc378B INFO
[04-14|17:22:21] Transaction pool price threshold updated price=1 INFO
[04-14|17:22:21] Etherbase automatically configured
address=0xC08832c6cB6df14340F3866B293a705FB9bc378B INFO
[04-14|17:22:21] Starting mining operation INFO [04-14|17:22:21]
Commit new mining work number=1 txs=0 uncles=0
elapsed=226.085µs WARN [04-14|17:22:21] Block sealing failed
err=unauthorized

Here is the connection for node 3 –

nohup geth –datadir node3/ –syncmode 'full' –port 30313 –rpc
–rpcaddr 'localhost' –rpcport 8503 –rpcapi 'personal,db,eth,ne t,web3,txpool,miner' –bootnodes
'enode://601ade737b81f16abdd0ce9983b63eb12050c4ef89c46b8fdbf3e3e6c951cc02dffe36f87200033107cf8b00
7355e780fba16b67d1d46603b1321f07314ea46b@10.132.0.2:30310' –networkid
1515 –gasprice '1' -unlock 'c08832c6cb6df14340f3866b293a70
5fb9bc378b' –password node3/pwdnode3.txt –mine &

Geth on node 1 gives these peers and this enode –

> admin

{ datadir: "/home/satoshimaca/blockchain/node1", nodeInfo: {
enode: "enode://64793e6e791115d315550d651cda00342b688ba36728b3d8070b04f4513ff65eb15ffb8f66387f1733340d8732e6ca956f0825cd3fc4e67686e04f63c5d0abc4@[::]:30311",
id: "64793e6e791115d315550d651cda00342b688ba36728b3d8070b04f4513ff65eb15ffb8f66387f1733340d8732e6ca956f0825cd3fc4e67686e04f63c5d0abc4",
ip: "::",
listenAddr: "[::]:30311",
name: "Geth/v1.8.2-stable-b8b9f7f4/linux-amd64/go1.9.4",
ports: {
discovery: 30311,
listener: 30311
},
protocols: {
eth: {
config: {…},
difficulty: 15290,
genesis: "0x702d8ca9647d171a6596a775888f71c7c0f3ddb011fbffcb921be685b2ef33b7",
head: "0x574671023088dd06c2127cee4e2a70e30782ed3f525d28b537294ac0f3297099",
network: 1515
}
} }, peers: [{
caps: ["eth/62", "eth/63"],
id: "d889d565b3ddc37491d131aed1c23d0a7b30a185bb925f325c7830b2ae710bc127010487f39f32d889afd1284ea31aa893adddda2197f2763485926970620381",
name: "Geth/v1.8.2-stable-b8b9f7f4/linux-amd64/go1.9.4",
network: {
inbound: true,
localAddress: "127.0.0.1:30311",
remoteAddress: "127.0.0.1:54108",
static: false,
trusted: false
},
protocols: {

From node 1 – acct 1 is definitely a signer and it is unlocked but then is not authorised.

> clique.getSigners()

["0xc08832c6cb6df14340f3866b293a705fb9bc378b",
"0xfc1bdf06d1150e6eeeb229a8500b09df8ccdcbbd",
"0xfcad53c780a4f6c66b3daca331fe72fc6559c367"]

Best Answer

Adding a new node as sealer is simple as calling:

clique.propose(<NEWSEALER>, true)

You will need 50% + 1 votes.

See How to add new Sealer in Geth 1.6 Proof of Authority? for more details.

For the details on the specification see EIP 225 - https://github.com/ethereum/EIPs/issues/225

Related Topic