mirror of https://github.com/nucypher/nucypher.git
Modify load_seednodes to use the 'TEACHER_NODES' constant specific to the network domain
parent
e717e213d1
commit
755acbf556
|
@ -9,6 +9,8 @@ from nucypher.characters.lawful import Ursula
|
||||||
from nucypher.cli.config import NucypherClickConfig
|
from nucypher.cli.config import NucypherClickConfig
|
||||||
from nucypher.config.constants import DEFAULT_CONFIG_ROOT, USER_LOG_DIR
|
from nucypher.config.constants import DEFAULT_CONFIG_ROOT, USER_LOG_DIR
|
||||||
from nucypher.network.middleware import RestMiddleware
|
from nucypher.network.middleware import RestMiddleware
|
||||||
|
from nucypher.network.teachers import TEACHER_NODES
|
||||||
|
|
||||||
|
|
||||||
DESTRUCTION = '''
|
DESTRUCTION = '''
|
||||||
*Permanently and irreversibly delete all* nucypher files including:
|
*Permanently and irreversibly delete all* nucypher files including:
|
||||||
|
@ -35,14 +37,14 @@ console_emitter = NucypherClickConfig.emit
|
||||||
|
|
||||||
def load_seednodes(min_stake: int,
|
def load_seednodes(min_stake: int,
|
||||||
federated_only: bool,
|
federated_only: bool,
|
||||||
|
network_domain: str,
|
||||||
network_middleware: RestMiddleware = None,
|
network_middleware: RestMiddleware = None,
|
||||||
teacher_uris: list = None
|
teacher_uris: list = None
|
||||||
) -> List[Ursula]:
|
) -> List[Ursula]:
|
||||||
|
|
||||||
teacher_nodes = list()
|
teacher_nodes = list()
|
||||||
if teacher_uris is None:
|
if teacher_uris is None:
|
||||||
# Default teacher nodes can be placed here
|
teacher_uris = TEACHER_NODES[network_domain]
|
||||||
return teacher_nodes
|
|
||||||
for uri in teacher_uris:
|
for uri in teacher_uris:
|
||||||
teacher_node = Ursula.from_teacher_uri(teacher_uri=uri,
|
teacher_node = Ursula.from_teacher_uri(teacher_uri=uri,
|
||||||
min_stake=min_stake,
|
min_stake=min_stake,
|
||||||
|
|
|
@ -17,6 +17,8 @@ along with nucypher. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
# Hardcoded teacher nodes for, both, our testnet and mainnet.
|
# Hardcoded teacher nodes for, both, our testnet and mainnet.
|
||||||
TESTNET = []
|
# Stored as a dict with the domain as the key.
|
||||||
|
TEACHER_NODES = {
|
||||||
MAINNET = []
|
'goerli-testnet': [],
|
||||||
|
'mainnet': [],
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue