pub struct Conductor {
    pub config: ConductorConfig,
    /* private fields */
}
Expand description

A Conductor is a group of Cells

Fields§

§config: ConductorConfig

The config used to create this Conductor

Implementations§

source§

impl Conductor

Methods used by the ConductorHandle

source

pub fn check_running(&self) -> ConductorResult<()>

A gate to put at the top of public functions to ensure that work is not attempted after a shutdown has been issued

source

pub fn detach_task_management(&self) -> Option<JoinHandle<TaskManagerResult>>

Take ownership of the TaskManagerClient as well as the task which completes when all managed tasks have completed

source

pub fn shutdown(&self) -> JoinHandle<TaskManagerResult>

Broadcasts the shutdown signal to all managed tasks and returns a future to await for shutdown to complete.

source§

impl Conductor

source

pub async fn add_app_interface( self: Arc<Self>, port: Either<u16, AppInterfaceId> ) -> ConductorResult<u16>

Spawn a new app interface task, register it with the TaskManager, and modify the conductor accordingly, based on the config passed in which is just a networking port number (or 0 to auto-select one). Returns the given or auto-chosen port number if giving an Ok Result

source

pub fn get_arbitrary_admin_websocket_port(&self) -> Option<u16>

Returns a port which is guaranteed to have a websocket listener with an Admin interface on it. Useful for specifying port 0 and letting the OS choose a free port.

source

pub async fn list_app_interfaces(&self) -> ConductorResult<Vec<u16>>

Give a list of networking ports taken up as running app interface tasks

source§

impl Conductor

source

pub fn list_dnas(&self) -> Vec<DnaHash>

Get the list of hashes of installed Dnas in this Conductor

source

pub fn get_dna_def(&self, hash: &DnaHash) -> Option<DnaDef>

Get a DnaDef from the RibosomeStore

source

pub fn get_dna_file(&self, hash: &DnaHash) -> Option<DnaFile>

Get a DnaFile from the RibosomeStore

source

pub fn get_entry_def(&self, key: &EntryDefBufferKey) -> Option<EntryDef>

Get an EntryDef from the EntryDefBufferKey

source

pub fn get_dna_definitions( &self, app: &InstalledApp ) -> ConductorResult<HashMap<CellId, DnaDefHashed>>

Create a hash map of all existing DNA definitions, mapped to cell ids.

source

pub fn root_db_dir(&self) -> &DatabaseRootPath

Get the root environment directory.

source

pub fn keystore(&self) -> &MetaLairClient

Get the keystore.

source

pub fn holochain_p2p(&self) -> &HolochainP2pRef

Get a reference to the conductor’s HolochainP2p.

source

pub async fn register_dna(&self, dna: DnaFile) -> ConductorResult<()>

Install a DnaFile in this Conductor

source§

impl Conductor

source

pub async fn get_agent_infos( &self, cell_id: Option<CellId> ) -> ConductorApiResult<Vec<AgentInfoSigned>>

Get signed agent info from the conductor

source

pub async fn block(&self, input: Block) -> DatabaseResult<()>

Block some target.

source

pub async fn unblock(&self, input: Block) -> DatabaseResult<()>

Unblock some target.

source

pub async fn is_blocked( &self, input: BlockTargetId, timestamp: Timestamp ) -> DatabaseResult<bool>

Check if some target is blocked.

source

pub async fn list_wasm_host_functions(&self) -> ConductorApiResult<Vec<String>>

List all host functions provided by this conductor for wasms.

source

pub async fn call_zome( &self, call: ZomeCall ) -> ConductorApiResult<ZomeCallResult>

Invoke a zome function on a Cell

source

pub async fn easy_call_zome<I, O, Z, F>( &self, provenance: &AgentPubKey, cap_secret: Option<CapSecret>, cell_id: CellId, zome_name: Z, fn_name: F, payload: I ) -> ConductorApiResult<O>where FunctionName: From<F>, ZomeName: From<Z>, I: Serialize + Debug, O: DeserializeOwned + Debug,

Make a zome call with deserialization and some error unwrapping built in

source§

impl Conductor

source

pub async fn install_app_bundle( self: Arc<Self>, payload: InstallAppPayload ) -> ConductorResult<StoppedApp>

Install DNAs and set up Cells as specified by an AppBundle

source

pub async fn uninstall_app( self: Arc<Self>, installed_app_id: &InstalledAppId ) -> ConductorResult<()>

Uninstall an app

source

pub async fn list_running_apps(&self) -> ConductorResult<Vec<InstalledAppId>>

List active AppIds

source

pub async fn list_apps( &self, status_filter: Option<AppStatusFilter> ) -> ConductorResult<Vec<AppInfo>>

List Apps with their information

source

pub async fn list_running_apps_for_dependent_cell_id( &self, cell_id: &CellId ) -> ConductorResult<HashSet<InstalledAppId>>

Get the IDs of all active installed Apps which use this Cell

source

pub async fn find_cell_with_role_alongside_cell( &self, cell_id: &CellId, role_name: &RoleName ) -> ConductorResult<Option<CellId>>

Find the ID of the first active installed App which uses this Cell

source

pub async fn list_running_apps_for_dependent_dna_hash( &self, dna_hash: &DnaHash ) -> ConductorResult<HashSet<InstalledAppId>>

Get the IDs of all active installed Apps which use this Dna

source

pub async fn get_app_info( &self, installed_app_id: &InstalledAppId ) -> ConductorResult<Option<AppInfo>>

Get info about an installed App, regardless of status

source§

impl Conductor

source

pub fn live_cell_ids(&self) -> HashSet<CellId>

Iterator over only the cells which are fully “live”, meaning they have been fully initialized and are registered with the kitsune network layer. Generally used to handle conductor interface requests.

source

pub fn running_cell_ids( &self, filter: Option<CellStatusFilter> ) -> HashSet<CellId>

List CellIds for Cells which match a status filter

source§

impl Conductor

source

pub async fn create_clone_cell( self: Arc<Self>, payload: CreateCloneCellPayload ) -> ConductorResult<ClonedCell>

Create a new cell in an existing app based on an existing DNA.

Returns

A struct with the created cell’s clone id and cell id.

source

pub async fn enable_clone_cell( self: Arc<Self>, payload: &EnableCloneCellPayload ) -> ConductorResult<ClonedCell>

Enable a disabled clone cell.

source§

impl Conductor

source

pub async fn reconcile_cell_status_with_app_status( self: Arc<Self> ) -> ConductorResult<CellStartupErrors>

Adjust which cells are present in the Conductor (adding and removing as needed) to match the current reality of all app statuses.

  • If a Cell is used by at least one Running app, then ensure it is added
  • If a Cell is used by no running apps, then ensure it is removed.
source

pub async fn enable_app( self: Arc<Self>, app_id: InstalledAppId ) -> ConductorResult<(InstalledApp, CellStartupErrors)>

Enable an app

source

pub async fn disable_app( self: Arc<Self>, app_id: InstalledAppId, reason: DisabledAppReason ) -> ConductorResult<InstalledApp>

Disable an app

source

pub async fn start_app( self: Arc<Self>, app_id: InstalledAppId ) -> ConductorResult<InstalledApp>

Start an app

source§

impl Conductor

source

pub async fn grant_zome_call_capability( &self, payload: GrantZomeCallCapabilityPayload ) -> ConductorApiResult<()>

Grant a zome call capability for a cell

source

pub async fn dump_cell_state( &self, cell_id: &CellId ) -> ConductorApiResult<String>

Create a JSON dump of the cell’s state

source

pub async fn dump_full_cell_state( &self, cell_id: &CellId, dht_ops_cursor: Option<u64> ) -> ConductorApiResult<FullStateDump>

Create a comprehensive structured dump of a cell’s state

source

pub async fn dump_network_metrics( &self, dna_hash: Option<DnaHash> ) -> ConductorApiResult<String>

JSON dump of network metrics

source

pub async fn dump_network_stats(&self) -> ConductorApiResult<String>

JSON dump of backend network stats

source

pub async fn add_agent_infos( &self, agent_infos: Vec<AgentInfoSigned> ) -> ConductorApiResult<()>

Add signed agent info to the conductor

source

pub async fn graft_records_onto_source_chain( self: Arc<Self>, cell_id: CellId, validate: bool, records: Vec<Record> ) -> ConductorApiResult<()>

Inject records into a source chain for a cell. If the records form a chain segment that can be “grafted” onto the existing chain, it will be. Otherwise, a new chain will be formed using the specified records.

source

pub async fn update_coordinators( &self, hash: &DnaHash, coordinator_zomes: CoordinatorZomes, wasms: Vec<DnaWasm> ) -> ConductorResult<()>

Update coordinator zomes on an existing dna.

source§

impl Conductor

source

pub fn signal_broadcaster(&self) -> SignalBroadcaster

Access to the signal broadcast channel, to create new subscriptions

source

pub async fn post_commit_permit( &self ) -> Result<OwnedPermit<PostCommitArgs>, SendError<()>>

Get the post commit sender.

source

pub fn get_config(&self) -> &ConductorConfig

Get the conductor config

source

pub fn task_manager(&self) -> TaskManagerClient

Get a TaskManagerClient

source§

impl Conductor

source

pub fn builder() -> ConductorBuilder

Create a conductor builder

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere T: Any,

§

fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>

§

fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T, Global>) -> Arc<dyn Any + Sync + Send, Global>

§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

§

fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcastable for Twhere T: Any + Send + Sync + 'static,

§

fn upcast_any_ref(&self) -> &(dyn Any + 'static)

upcast ref
§

fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)

upcast mut ref
§

fn upcast_any_box(self: Box<T, Global>) -> Box<dyn Any, Global>

upcast boxed dyn
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more