Encod new felix node password on init.

pull/1040/head
Kieran Prasch 2019-04-27 21:43:06 +03:00
parent 81cbdd7404
commit cdaf2da1d9
No known key found for this signature in database
GPG Key ID: 199AB839D4125A62
2 changed files with 11 additions and 6 deletions

View File

@ -3,7 +3,7 @@ import os
from constant_sorrow.constants import NOT_RUNNING
from geth import LoggingMixin
from geth.accounts import ensure_account_exists
from geth.accounts import ensure_account_exists, get_accounts, create_new_account
from geth.chain import (
get_chain_data_dir,
initialize_chain,
@ -132,7 +132,11 @@ class NuCypherGethDevnetProcess(NuCypherGethProcess):
geth_kwargs = {'network_id': str(cls.__CHAIN_ID),
'port': str(cls.P2P_PORT),
'verbosity': str(cls.VERBOSITY),
'data_dir': data_dir,
'password': password.encode()}
etherbase = ensure_account_exists(**geth_kwargs)
return etherbase
'data_dir': data_dir}
accounts = get_accounts(**geth_kwargs)
if not accounts:
account = create_new_account(password=password.encode(), **geth_kwargs)
else:
account = accounts[0]
return account

View File

@ -72,7 +72,8 @@ def felix(click_config,
if geth:
data_dir = os.path.join(config_root, '.ethereum', network)
new_checksum_address = NuCypherGethDevnetProcess.ensure_account_exists(password=new_password, data_dir=data_dir)
new_checksum_address = NuCypherGethDevnetProcess.ensure_account_exists(password=new_password,
data_dir=data_dir)
click.prompt(f"New geth address is {new_checksum_address}. \n"
f"Press ENTER key to continue", default=True)