nucypher.acumen

Submodules

class NicknameCharacter(symbol: str, color_name: str, color_hex: str)

Bases: object

to_json()
class Nickname(characters: List[nucypher.acumen.nicknames.NicknameCharacter])

Bases: object

classmethod from_seed(seed, length: int = 2)
to_json()
class ArchivedFleetState(checksum, nickname, timestamp, population)

Bases: tuple

property checksum

Alias for field number 0

property nickname

Alias for field number 1

property timestamp

Alias for field number 2

property population

Alias for field number 3

to_json()
class StateDiff(this_node_updated, nodes_updated, nodes_removed)

Bases: tuple

property this_node_updated

Alias for field number 0

property nodes_updated

Alias for field number 1

property nodes_removed

Alias for field number 2

empty()
class FleetState(nodes: Dict[NewType.<locals>.new_type, Ursula], this_node_ref: Optional[weakref], this_node_metadata: Optional[nucypher_core.NodeMetadata])

Bases: object

Fleet state as perceived by a local Ursula.

Assumptions we’re based on:

  • Every supplied node object, after its constructor has finished, has a .checksum_address and bytes() (metadata)

  • checksum address or metadata do not change for the same Python object

  • this_node (the owner of FleetSensor) may not have metadata initially (when the constructor is first called), but will have one at the time of the first record_fleet_state() call.

  • The metadata of this_node can change.

  • For the purposes of the fleet state, nodes with different metadata are considered different, even if they have the same checksum address.

classmethod new(this_node: Optional[Ursula] = None) → FleetState
archived()nucypher.acumen.perception.ArchivedFleetState
with_updated_nodes(nodes_to_add: Iterable[Ursula], nodes_to_remove: Iterable[NewType.<locals>.new_type], skip_this_node: bool = False) → FleetState
property population

Returns the number of all known nodes, including itself, if applicable.

addresses()collections.abc.KeysView
shuffled() → List[Ursula]
to_json() → Dict
property icon
items()
values()
class FleetSensor(domain: str, this_node: Optional[Ursula] = None)

Bases: object

A representation of a fleet of NuCypher nodes.

If this_node is provided, it will be included in the state checksum (but not returned during iteration/lookups).

log

Drop-in replacement of Twisted’s Logger, patching the emit() method to tolerate inputs with curly braces, i.e., not compliant with PEP 3101.

See Issue #724 and, particularly, https://github.com/nucypher/nucypher/issues/724#issuecomment-600190455

record_node(node: Ursula)
property current_state
property checksum
property population
property nickname
property icon
property timestamp
items()
values()
latest_state()nucypher.acumen.perception.ArchivedFleetState
previous_states(quantity: int) → List[nucypher.acumen.perception.ArchivedFleetState]

Returns at most quantity latest archived states (not including the current one), in chronological order.

addresses()
record_fleet_state(skip_this_node: bool = False)nucypher.acumen.perception.StateDiff
shuffled()
mark_as(label: Exception, node: Ursula)
record_remote_fleet_state(checksum_address: NewType.<locals>.new_type, state_checksum: nucypher_core.FleetStateChecksum, timestamp: maya.core.MayaDT, population: int)
status_info(checksum_address_or_node: Union[NewType.<locals>.new_type, Ursula]) → RemoteUrsulaStatus
class RemoteUrsulaStatus(verified, nickname, staker_address, operator_address, rest_url, timestamp, recorded_fleet_state, last_learned_from)

Bases: tuple

property verified

Alias for field number 0

property nickname

Alias for field number 1

property staker_address

Alias for field number 2

property operator_address

Alias for field number 3

property rest_url

Alias for field number 4

property timestamp

Alias for field number 5

property recorded_fleet_state

Alias for field number 6

property last_learned_from

Alias for field number 7

to_json() → Dict[str, Any]