Module: C3D::Utility
Instance Method Summary collapse
Instance Method Details
#save_key ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/c3d/util/util.rb', line 7 def save_key key = Celluloid::Actor[:eth].get_key config_file = File.join(ENV['HOME'], '.epm', 'c3d-config.json') config = JSON.load(File.read(config_file)) config["primary_account_key"] = key if config["primary_account_key"] != key ENV['ETH_KEY'] = config["primary_account_key"] File.open(config_file, 'w'){|f| f.write(JSON.pretty_generate(config))} end |