ControlRequest

Enum ControlRequest 

Source
pub enum ControlRequest {
Show 17 variants Hatch { service_type: ServiceType, network_id: String, metadata: HashMap<String, Value>, }, Flock, Farewell { service_id: String, }, FarewellEvict { service_id: String, }, Pause { service_id: String, eta_minutes: u64, }, Resume { service_id: String, }, Join { network_id: String, }, Leave { network_id: String, force: bool, }, Status, AnnounceNow, Ping, PutFile { chunk_data: Vec<u8>, ph: Option<f64>, q_target: Option<f64>, network_id: String, file_name: Option<String>, }, GetFile { chunk_id: String, network_id: String, }, ConnectRelay { relay_addr: String, }, CreateInvite { network_id: String, invitee_fingerprint: Option<String>, invite_password: String, ttl_hours: Option<u64>, }, StorageInfo { network_id: String, }, ListFiles { network_id: String, },
}
Expand description

Request sent from CLI → daemon.

Variants§

§

Hatch

Spawn a new service of service_type in network_id.

Fields

§service_type: ServiceType
§network_id: String
§metadata: HashMap<String, Value>

Optional extra config (e.g. {"storage_bytes": 10737418240} for Pouch).

§

Flock

Return all known peers and network summary.

§

Farewell

Kill a running service by ID.

Fields

§service_id: String
§

FarewellEvict

Permanently evict a Pouch from the network.

Announces to the network that this Pouch is going offline permanently, records a reputation eviction, removes the service from ServiceRegistry, and purges all on-disk fragment storage.

Fragment redistribution to other peers is not yet automated — the remaining network peers will detect missing fragments via Proof-of-Storage challenges and trigger preventive recoding.

Fields

§service_id: String
§

Pause

Pause a running Pouch service for planned maintenance.

Announces via gossip that peers should mark this node’s fragments as temporarily_unavailable. If the service does not resume within eta_minutes, the quality monitor will apply fault-score increments.

Fields

§service_id: String

Service ID to pause (UUID returned by bp hatch).

§eta_minutes: u64

Estimated downtime in minutes.

§

Resume

Resume a previously paused service.

Triggers an immediate gossip announcement and clears the Paused status.

Fields

§service_id: String

Service ID to resume.

§

Join

Join an existing network (subscribe to gossip topics).

Fields

§network_id: String
§

Leave

Leave a network.

If force is true the daemon automatically evicts all active services on the network before leaving instead of returning a blocking error. Pouch services are evicted permanently (equivalent to bp farewell --evict); Bill and Post services are stopped gracefully (equivalent to bp farewell).

Fields

§network_id: String
§force: bool

Auto-evict all blocking services, then leave.

§

Status

Return info about this daemon (identity, services, networks).

§

AnnounceNow

Announce all active services via gossip and wait 2 s for propagation.

Used by bp status to ensure the peer list is fresh before displaying it. Returns Ok("announced") once the wait is done.

§

Ping

Ping — used to check if daemon is alive.

§

PutFile

Encode chunk_data with RLNC and store fragments in the local Pouch.

k and n are derived automatically by the daemon from live QoS data and the ph target recovery probability. Returns a chunk_id (BLAKE3 hash prefix) that can be used with GetFile.

Fields

§chunk_data: Vec<u8>

Raw bytes to encode and store.

§ph: Option<f64>

Target recovery probability (default: 0.999). The daemon derives k/n from live peer QoS and this target.

§q_target: Option<f64>

Redundancy overhead fraction (default: 1.0 = k extra fragments).

§network_id: String

Network ID whose Pouch should hold the fragments.

§file_name: Option<String>

Optional file name to record in the local file registry. Displayed by bp ls.

§

GetFile

Retrieve and decode a stored file chunk by its chunk_id.

Fields

§chunk_id: String

BLAKE3 chunk hash prefix (16 hex chars) returned by PutFile.

§network_id: String

Network ID to search for the chunk.

§

ConnectRelay

Dial a relay node to enable NAT traversal via circuit relay v2.

The daemon dials relay_addr, establishes a reservation, and subsequently becomes reachable through the relay at /p2p-circuit addresses.

Fields

§relay_addr: String

Full multiaddr of the relay node, e.g. /ip4/1.2.3.4/tcp/4001/p2p/12D3KooW...

§

CreateInvite

Generate a signed + password-encrypted invite token for network_id.

The token contains the NetworkMetaKey for the network, signed with the daemon’s Ed25519 key and encrypted with invite_password. Share the blob and the password with the invitee out-of-band.

Fields

§network_id: String

Network to invite the recipient into.

§invitee_fingerprint: Option<String>

Optional: fingerprint of the specific invitee. None = open invite.

§invite_password: String

Password used to encrypt the token — shared out-of-band.

§ttl_hours: Option<u64>

Token validity in hours (default: 24).

§

StorageInfo

Return storage statistics for all local Pouch services.

Includes per-Pouch quota, usage, tier, plus aggregate totals and total bytes uploaded by this node’s Bill services.

Fields

§network_id: String

Filter to a specific network (empty string = all networks).

§

ListFiles

List files uploaded by this node.

Returns entries from the local file registry populated by PutFile.

Fields

§network_id: String

Filter to a specific network (empty string = all networks).

Trait Implementations§

Source§

impl Clone for ControlRequest

Source§

fn clone(&self) -> ControlRequest

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ControlRequest

Source§

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

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

impl<'de> Deserialize<'de> for ControlRequest

Source§

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

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

impl Serialize for ControlRequest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

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>,