What is initial_key in genesis.json and role of this property?
initial_key is public key of genesis nodeos, this property used on genesis nodeos to start producing. All other nodes those who want to participate in the network should have the same key in their genesis.json file.
How is the initial key generated?
$cleos create key
revan@blockedin-2:~/eos/contracts/eosio.bios$ cleos create key
Private key: 5KBDAGTwNjPAfM1ZSmUwwUN7shoHaGFpkwNLEM5mGgd2YF5H1WW
Public key: EOS7ouMWwQgiPo7UL2bZVBKrHv38GxkdCo6jCCEiC9sRQxnu337R5
```
The above generated public key can be set as initial_key property
e.g "initial_key": "EOS7ouMWwQgiPo7UL2bZVBKrHv38GxkdCo6jCCEiC9sRQxnu337R5"
in genesis.json
If two different nodes have two different initial key, can they go on the same network?
No, every node should have the same initial_key in order be accepted in the same network. You would see following error if initial key is different
432103ms thread-0 net_plugin.cpp:719 connection] accepted network connection
432103ms thread-0 net_plugin.cpp:2230 handle_message] Peer on a different chain. Closing connection
432103ms thread-0 net_plugin.cpp:1094 operator()] sent a go away message: wrong chain, closing connection to connecting client
P.S: All nodes must start from the same initial state. Following two properties should be same along all nodes.
initial_timestamp
represents the start time of the blockchain
initial_key
public key of genesis nodeos
Reference: https://github.com/EOSIO/eos/wiki/Tutorial-Bios-Boot-Sequence#configure-the-genesisjson-file