Modify load_seednodes to use the 'TEACHER_NODES' constant specific to the network domain

pull/1040/head
tuxxy 2019-05-14 14:06:25 -06:00 committed by Kieran Prasch
parent e717e213d1
commit 755acbf556
No known key found for this signature in database
GPG Key ID: 199AB839D4125A62
2 changed files with 9 additions and 5 deletions

View File

@ -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,

View File

@ -17,6 +17,8 @@ along with nucypher. If not, see <https://www.gnu.org/licenses/>.
# 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': [],
}