Adding domains to Alice and Bob in examples, to aviod using the production defaults.

pull/1040/head
Kieran R. Prasch 2019-06-01 07:03:36 -07:00 committed by Kieran Prasch
parent 4fd55ab6cb
commit 58302eb7db
No known key found for this signature in database
GPG Key ID: 199AB839D4125A62
6 changed files with 14 additions and 6 deletions

View File

@ -16,6 +16,8 @@ from nucypher.utilities.logging import SimpleObserver
######################
# Execute the download script (download_finnegans_wake.sh) to retrieve the book
from nucypher.utilities.sandbox.constants import TEMPORARY_DOMAIN
BOOK_PATH = os.path.join('.', 'finnegans-wake.txt')
# Change this value to to perform more or less total re-encryptions
@ -31,7 +33,7 @@ globalLogPublisher.addObserver(SimpleObserver())
# (will fail with bad connection) #####
#######################################
SEEDNODE_URI = "https://localhost:11501"
SEEDNODE_URI = "https://localhost:11500"
##############################################
# Ursula, the Untrusted Re-Encryption Proxy #
@ -50,6 +52,7 @@ label = b"secret/files/and/stuff"
######################################
ALICE = Alice(network_middleware=RestMiddleware(),
domains={TEMPORARY_DOMAIN},
known_nodes=[ursula],
learn_on_same_thread=True,
federated_only=True)
@ -61,6 +64,7 @@ ALICE = Alice(network_middleware=RestMiddleware(),
policy_pubkey = ALICE.get_policy_encrypting_key_from_label(label)
BOB = Bob(known_nodes=[ursula],
domains={TEMPORARY_DOMAIN},
network_middleware=RestMiddleware(),
federated_only=True,
start_learning_now=True,

View File

@ -19,6 +19,8 @@ from nucypher.utilities.logging import SimpleObserver
# Twisted Logger
from nucypher.utilities.sandbox.constants import TEMPORARY_DOMAIN
globalLogPublisher.addObserver(SimpleObserver())
TEMP_ALICE_DIR = os.path.join('/', 'tmp', 'heartbeat-demo-alice')
@ -50,6 +52,7 @@ ursula = Ursula.from_seed_and_stake_info(seed_uri=SEEDNODE_URL,
alice_config = AliceConfiguration(
config_root=os.path.join(TEMP_ALICE_DIR),
is_me=True,
domains={TEMPORARY_DOMAIN},
known_nodes={ursula},
start_learning_now=False,
federated_only=True,

View File

@ -17,6 +17,7 @@ from nucypher.network.middleware import RestMiddleware
from umbral.keys import UmbralPublicKey
from nucypher.utilities.logging import SimpleObserver
from nucypher.utilities.sandbox.constants import TEMPORARY_DOMAIN
globalLogPublisher.addObserver(SimpleObserver())
@ -51,6 +52,7 @@ print("Creating the Doctor ...")
doctor = Bob(
is_me=True,
domains={TEMPORARY_DOMAIN},
federated_only=True,
crypto_power_ups=power_ups,
start_learning_now=True,

View File

@ -18,7 +18,7 @@ export NUCYPHER_FILE_LOGS=0
# Run Node #1 (Lonely Ursula)
echo "Starting Lonely Ursula..."
python3 "${0%/*}"/../local_fleet/run_lonely_ursula.py > /tmp/ursulas-logs/ursula-11500.txt 2>&1 &
sleep 1
sleep 2
# Connect Node #2 to Lonely Ursula
echo "Starting Ursula #2..."
@ -27,5 +27,4 @@ sleep 1
# Connect Node #3 to the local Fleet
echo "Starting Ursula #3..."
nucypher --debug ursula run --dev --federated-only --teacher-uri localhost:11500 --rest-port 11502 > /tmp/ursulas-logs/ursula-11502.txt 2>&1 &
sleep 1
nucypher --debug ursula run --dev --federated-only --teacher-uri localhost:11500 --rest-port 11502 > /tmp/ursulas-logs/ursula-11502.txt 2>&1 &

View File

@ -30,7 +30,7 @@ from nucypher.utilities.sandbox.constants import select_test_port
click_runner = CliRunner()
DEMO_NODE_PORT = select_test_port()
DEMO_FLEET_STARTING_PORT = 11501
DEMO_FLEET_STARTING_PORT = 11500
args = ['--debug',
'ursula', 'run',

View File

@ -21,7 +21,7 @@ from nucypher.utilities.sandbox.constants import (
@pytest_twisted.inlineCallbacks
def test_run_felix(click_runner,
testerchain,
federated_ursulas,
federated_ursulas, # TODO: Make these blockchain Ursulas
deploy_user_input,
mock_primary_registry_filepath):