From 755acbf556f41ed0a6a32c768c3e426a6197219e Mon Sep 17 00:00:00 2001 From: tuxxy Date: Tue, 14 May 2019 14:06:25 -0600 Subject: [PATCH] Modify load_seednodes to use the 'TEACHER_NODES' constant specific to the network domain --- nucypher/cli/actions.py | 6 ++++-- nucypher/network/teachers.py | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/nucypher/cli/actions.py b/nucypher/cli/actions.py index c86ca23a6..2ad3ffc7a 100644 --- a/nucypher/cli/actions.py +++ b/nucypher/cli/actions.py @@ -9,6 +9,8 @@ from nucypher.characters.lawful import Ursula from nucypher.cli.config import NucypherClickConfig from nucypher.config.constants import DEFAULT_CONFIG_ROOT, USER_LOG_DIR from nucypher.network.middleware import RestMiddleware +from nucypher.network.teachers import TEACHER_NODES + DESTRUCTION = ''' *Permanently and irreversibly delete all* nucypher files including: @@ -35,14 +37,14 @@ console_emitter = NucypherClickConfig.emit def load_seednodes(min_stake: int, federated_only: bool, + network_domain: str, network_middleware: RestMiddleware = None, teacher_uris: list = None ) -> List[Ursula]: teacher_nodes = list() if teacher_uris is None: - # Default teacher nodes can be placed here - return teacher_nodes + teacher_uris = TEACHER_NODES[network_domain] for uri in teacher_uris: teacher_node = Ursula.from_teacher_uri(teacher_uri=uri, min_stake=min_stake, diff --git a/nucypher/network/teachers.py b/nucypher/network/teachers.py index d69afca61..96a984bea 100644 --- a/nucypher/network/teachers.py +++ b/nucypher/network/teachers.py @@ -17,6 +17,8 @@ along with nucypher. If not, see . # Hardcoded teacher nodes for, both, our testnet and mainnet. -TESTNET = [] - -MAINNET = [] +# Stored as a dict with the domain as the key. +TEACHER_NODES = { + 'goerli-testnet': [], + 'mainnet': [], +}