geth init --datadir node/ genesis.json command generates an empty keystore directory and a geth directory. Its only after running the node that the geth folder is populated with the nodekey. Is it possible to generate the node.key file via the
geth init command? Appreciate any help!
You can use the
bootnode utility for this to create a nodekey immediately after geth init. You can download it with "Geth & Tools" from https://geth.ethereum.org/downloads/
bootnode -genkey <datadir>/geth/nodekey
If you wish to get the public key for the enode url, you can use:
bootnode -nodekey <datadir>/geth/nodekey -writeaddress