Private PoA Network
Using Kotal, you can create private cross-client Proof of Authority (Clique) networks.
#
Single signer networkHere's an example of 2 nodes cross-client network, the first node node-1
is a signer.
In the example network above, we created a proof of authority network as indicated by consensus: poa
, The most important setting in proof of authority network genesis is signers
, we set the account 0xd2c21213027cbf4d46c16b55fa98e5252b048706
as the only signer. We also set the network id and chain id to 4444
and funding the account 0x48c5F25a884116d58A6287B72C9b069F936C9489
with 100,000 eth 💰
How node becomes a signer ✏️
Any node can be a signer by importing a private key that corresponds to an address in the genesis signers
list.
Hyperledger Besu must use the private key as nodekey
to be a signer. Go-Ethereum must import
the address private key and enable mining by miner
to be a signer.
network with no signers or signer nodes 🔥
The network will be dysfunctional and blocks will not be generated if
- There's no
signers
in thegensis.clique
setting - No signer account is imported in any node
pre-funded accounts are important in PoA networks
Block signers are not rewarded by eth in PoA networks, so the only way source of eth in a private PoA network is genesis block funded accounts.
Note that we've left most of the genesis block config parameters like coinbase
, nonce
, difficulty
... etc. Kotal will default all these missing fields like setting coinbase to 0x00...00
, nonce to 0x0
and difficulty to 0x0
... etc. So you can set only parameters that are specific to your network like genesis
and funded accounts
in the example above.
Deploy this network manifest and 2 nodes will be deployed, using PoA clique consensus, the first node only is a signer, can produce and sign blocks, the second node is only syncing the blockchain and can submit and rely transactions.
You can fetch deployed Blockchain networks using
check node-1 logs, and you will find that it produce a new block every 9 seconds as indicated by the blockPeriod: 9
above.
Let's delete the network before starting our next example.
#
Multiple signers networkUsing kotal, you can create multiple signers cross-client network by creating a list of signers in the genesis block clique.signers
setting.
note
You can use the client clique API to add more signers after the genesis block is created using
- Hyperledger Besu Clique API
- Go-Ethereum Clique API
In this example we're creating a PoA clique network of 2 signer nodes, the first node using hyperledger besu and using the first signer account private key as nodekey
, the second node is using Go-Ethereum client and import
ing the second signer private key and turn on mining.
Deploy this network manifest and 2 nodes will be deployed, both of them are producing and signing blocks in their turn.
You can fetch deployed Blockchain networks using
check node-1 logs, and you will find that it produce a new block every 9 seconds as indicated by the blockPeriod: 9
above.
check node-2 logs, and you will find that it produce a new block every 9 seconds.
Let's delete the network before starting our next example.
and Kubernetes garbage collector will delete all resources created by the controller 🔥