Bug fixes and API updates for Domains, Heartbeat Demo, and CLI flags.

pull/805/head
Kieran R. Prasch 2019-02-26 10:25:07 -07:00 committed by Kieran Prasch
parent 46f674475e
commit 10a1fa42bc
No known key found for this signature in database
GPG Key ID: 199AB839D4125A62
8 changed files with 23 additions and 22 deletions

View File

@ -1,19 +1,17 @@
import datetime
import json
import os
import shutil
import maya
from twisted.logger import globalLogPublisher
from nucypher.characters.lawful import Bob, Ursula
from nucypher.config.characters import AliceConfiguration
from nucypher.config.storages import LocalFileBasedNodeStorage
from nucypher.crypto.powers import DecryptingPower, SigningPower
from nucypher.network.middleware import RestMiddleware
from nucypher.utilities.logging import SimpleObserver
import datetime
import os
import shutil
import maya
import json
import sys
from twisted.logger import globalLogPublisher
######################
# Boring setup stuff #

View File

@ -783,9 +783,10 @@ class Ursula(Teacher, Character, Miner):
certificate = self.rest_server_certificate()
cert_vbytes = VariableLengthBytestring(certificate.public_bytes(Encoding.PEM))
domains = {bytes(domain) for domain in self.serving_domains}
as_bytes = bytes().join((version,
self.canonical_public_address,
bytes(VariableLengthBytestring.bundle(self.serving_domains)),
bytes(VariableLengthBytestring.bundle(domains)),
self.timestamp_bytes(),
bytes(self._interface_signature),
bytes(identity_evidence),

View File

@ -149,7 +149,7 @@ def ursula(click_config,
#
if not quiet:
if dev:
click.secho("WARNING: Running in development mode", fg='yellow')
click.secho("WARNING: Running in Development mode", fg='yellow')
if force:
click.secho("WARNING: Force is enabled", fg='yellow')
@ -220,7 +220,7 @@ def ursula(click_config,
else:
ursula_config = UrsulaConfiguration.from_configuration_file(filepath=config_file,
domains=[str(network)] if network else None,
domains=[bytes(network, encoding='utf-8')] if network else None,
registry_filepath=registry_filepath,
provider_uri=provider_uri,
rest_host=rest_host,
@ -289,7 +289,10 @@ def ursula(click_config,
# That's all folks!
return
URSULA.get_deployer().run() # <--- Blocking Call (Reactor)
node_deployer = URSULA.get_deployer()
node_deployer.addServices()
node_deployer.catalogServers(node_deployer.hendrix)
node_deployer.run() # <--- Blocking Call (Reactor)
except Exception as e:
ursula_config.log.critical(str(e))

View File

@ -34,9 +34,9 @@ from nucypher.utilities.sandbox.middleware import MockRestMiddleware
@click.option('--version', help="Echo the CLI version", is_flag=True, callback=echo_version, expose_value=False, is_eager=True)
@click.option('-v', '--verbose', help="Specify verbosity level", count=True)
@click.option('-Z', '--mock-networking', help="Use in-memory transport instead of networking", count=True)
@click.option('-J', '--json-ipc', help="Send all output to stdout as JSON", is_flag=True, default=False)
@click.option('-Q', '--quiet', help="Disable console printing", is_flag=True, default=False)
@click.option('-L', '--no-logs', help="Disable all logging output", is_flag=True, default=False)
@click.option('-J', '--json-ipc', help="Send all output to stdout as JSON", is_flag=True)
@click.option('-Q', '--quiet', help="Disable console printing", is_flag=True)
@click.option('-L', '--no-logs', help="Disable all logging output", is_flag=True)
@click.option('-D', '--debug', help="Enable debugging mode", is_flag=True)
@click.option('--no-registry', help="Skip importing the default contract registry", is_flag=True)
@nucypher_click_config

View File

@ -122,7 +122,7 @@ def make_rest_app(
_alice_class = Alice
_node_class = Ursula
rest_app = rest_app = Flask("ursula-service")
rest_app = Flask("ursula-service")
@rest_app.route("/public_information")
def public_information():

View File

@ -94,7 +94,7 @@ TEMPORARY_DOMAIN = 'TEMPORARY_DOMAIN'
MOCK_REGISTRY_FILEPATH = os.path.join(BASE_TEMP_DIR, f'{BASE_TEMP_PREFIX}mock-registry-{str(datetime.now())}.json')
TEMPORARY_DOMAIN = ':TEMPORARY_DOMAIN:' # for use with `--dev` node runtimes
TEMPORARY_DOMAIN = b':TEMPORARY_DOMAIN:' # for use with `--dev` node runtimes
GETH_DEV_URI = f'ipc://{BASE_TEMP_DIR}/geth.ipc' # Standard IPC path for `geth --dev`

View File

@ -45,8 +45,7 @@ def spin_up_federated_ursulas(quantity: int = FLEET_POPULATION):
ursula_processes = list()
for index, port in enumerate(ports):
args = ['nucypher',
'--debug',
args = ['nucypher', '--debug',
'ursula', 'run',
'--rest-port', port,
'--teacher-uri', TEACHER_URI,

View File

@ -37,7 +37,7 @@ args = ['--debug',
'--federated-only',
'--teacher-uri', f'https://127.0.0.1:{DEMO_FLEET_STARTING_PORT}',
'--rest-port', DEMO_NODE_PORT,
'--dev',
'--dev'
]
nucypher_cli.main(args=args, prog_name="nucypher-cli")