Extract private key setup from the global config setup to make it reusable. Return errors instead of panicing. * NodeKey() method is removed - it is unused.