5

just looking through genesis.json file and found initial key parameter, and wondering how that connects to block generation / syncing.

specific questions:

  • If two different nodes have two different initial key, can they go on the same network?
  • How is the initial key generated? (from random samplings of the ones i've seen on the internet, it doesn't follow a specific rule)
  • What is the role of the initial key?

1 Answer 1

2

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.

  1. initial_timestamp represents the start time of the blockchain
  2. initial_key public key of genesis nodeos

Reference: https://github.com/EOSIO/eos/wiki/Tutorial-Bios-Boot-Sequence#configure-the-genesisjson-file

1
  • As a follow up, whos public key is being used for the current eos mainnet?
    – Suah Kim
    Commented Jun 14, 2018 at 0:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.