holochain_client

Struct InstallAppPayload

Source
pub struct InstallAppPayload {
    pub source: AppBundleSource,
    pub agent_key: Option<HoloHash<Agent>>,
    pub installed_app_id: Option<String>,
    pub network_seed: Option<String>,
    pub roles_settings: Option<HashMap<String, RoleSettings>>,
    pub ignore_genesis_failure: bool,
    pub allow_throwaway_random_agent_key: bool,
}
Expand description

All the information necessary to install an app

Fields§

§source: AppBundleSource

Where to obtain the AppBundle, which contains the app manifest and DNA bundles to be installed. This is the main payload of app installation.

Since this field uses #[serde(flatten)], when using other serialized data formats like JSON or YAML, this field will actually show up as one of the variants of AppBundleSource (e.g. bundle or path), rather than as a source field.

§agent_key: Option<HoloHash<Agent>>

The agent to use when creating Cells for this App. If None, a new agent key will be generated in the right circumstances (read on).

It’s always OK to provide a pregenerated agent key here, but there is at least one major benefit to letting Holochain generate keys for you (other than the sheer convenience of not having to generate your own):

If you are using a device seed in your conductor config, the agent key will be derived from that seed using a sensible scheme based on the total number of app installations in this conductor, which means you can fairly easily regenerate all of your auto-generated agent keys if you lose access to the device with your conductor data (as long as you retain exclusive access to the device seed of course).

Holochain will only generate an agent key for you if [ConductorConfig::device_seed_lair_tag] is set and pointing to a seed present in lair. If this config is not set, installation will fail if no agent key is provided. This safety mechanism can however be overridden by setting the allow_throwaway_random_agent_key flag on this payload, which will cause Holochain to generate a totally random (non-recoverable) agent key.

If you are not using a device seed, or if your app has special requirements for agent keys, you can always provide your own here, no matter what setting you’re using.

§installed_app_id: Option<String>

The unique identifier for an installed app in this conductor. If not specified, it will be derived from the app name in the bundle manifest.

§network_seed: Option<String>

Optional: Overwrites all network seeds for all DNAs of Cells created by this app. This has a lower precedence than role-specific network seeds provided in the role_settings field of the InstallAppPayload.

The app can still use existing Cells, i.e. this does not require that all Cells have DNAs with the same overridden DNA.

§roles_settings: Option<HashMap<String, RoleSettings>>

Specify role specific settings or modifiers that will override any settings in the dna manifets.

§ignore_genesis_failure: bool

Optional: If app installation fails due to genesis failure, normally the app will be immediately uninstalled. When this flag is set, the app is left installed with empty cells intact. This can be useful for using graft_records_onto_source_chain, or for diagnostics.

§allow_throwaway_random_agent_key: bool

By default, if an agent key is not specified, the conductor will generate a new one by deriving a key from the device seed specified in the config. If the device seed is not set, app installation will fail. If this flag is set, a random key will be created if no device seed is present. This is a risky decision, because it will mean that if you lose control of this device, you will not be able to regenerate your agent key from the device seed. Use only in situations where you know that this is a throwaway key!

Trait Implementations§

Source§

impl Debug for InstallAppPayload

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for InstallAppPayload

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<InstallAppPayload, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for InstallAppPayload

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

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

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

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 T
where 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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize = _

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

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

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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

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

fn is_in_subset(&self) -> bool

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

fn to_subset_unchecked(&self) -> SS

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

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.
Source§

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

Source§

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
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T