Using Kotal, you can create ibft2 networks.
Go-Ethereum and Parity (OpenEthereum) doesn't support ibft2 consensus. Use Hyperledger Besu client instead.
When creating private networks,
genesis config are required. Here's an example of a single miner besu node ibft2 network.
Here's an example of 5 nodes ibft2 network, 3 of them are validators.
In the example network above, we created an ibft2 network as indicated by
consensus: ibft2. The most important setting in ibft2 network genesis is
validators, we set the accounts
0x8e...2b as the initial block validators. We set the network id and chain id to
55555, and funded the account
0x48c5F25a884116d58A6287B72C9b069F936C9489 with 100,000 eth 💰
How node becomes a validator ✏️
Hyperledger besu nodes that use one of the validators accounts' private key as nodekey becomes a validator node.
ibft2 network with no validators 🔥
ibft2 network will be dysfunctional and blocks will not be generated if
- There's no
- No Validator account private key is used by any node
pre-funded accounts are important in ibft2 networks
Block validators are not rewarded by eth in ibft2 networks, so the only source of eth in a private ibft2 network is genesis block funded accounts.
Note that we've left most of the genesis block config parameters like
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
chainId and funded
accounts in the example above.
Deploy this network manifest and this 5 nodes ibft2 network will be deployed.
You can fetch deployed Blockchain networks using
node-1 logs, and you will find that it producing blocks.
node-5 logs, and you will find that it only import blocks from its peers.
You can use Hyperledger Besu ibft2 API to propose, discard, and get validators at any block.
HTTP RPC server was enabled on
rpc: true and we enabled
ibft API with
rpcAPI which accepts a list of RPC APIs to enable.
Let's call node-1 rpc, but first lets forward localhost:8545 calls to node-1 pod
In another terminal window call
ibft_getValidatorsByBlockNumber RPC method
Finally you can delete the network and all its resources by
and kubernetes garbage collector will delete all resources created by the controller 🔥