Skip to main content

WitnessActor

Struct WitnessActor 

Source
struct WitnessActor {
    alias: String,
    pre: String,
    hby: Habery,
    oobi_replies: Vec<u8>,
}
Expand description

State owned by the actor thread. Only ever accessed from that one thread.

Fields§

§alias: String§pre: String§hby: Habery§oobi_replies: Vec<u8>

Signed /loc/scheme and /end/role replies served with the OOBI (keripy builds these from the config file on startup).

Implementations§

Source§

impl WitnessActor

Source

fn open( alias: &str, base_dir: PathBuf, config: &WitnessNetworkConfig, ) -> Result<Self>

Open the witness Habery the way keripy’s kli witness demo does: Habery(name=alias, salt=Salter(raw=demo_salt).qb64, temp=False) then makeHab(name=alias, transferable=False) on first start.

Source

fn handle(&mut self, cmd: Command)

Source

fn guarded<T>( &mut self, what: &str, f: impl FnOnce(&mut Self) -> Result<T, ActorError>, ) -> Result<T, ActorError>

Run one command, turning a panic into an Internal error so a single bad request (e.g. one that hits a libkeri todo!()) cannot take down the witness.

Source

fn receipt( &mut self, body: &[u8], attachments: &str, ) -> Result<ReceiptOutcome, ActorError>

keripy ReceiptEnd.on_post.

Source

fn ingest(&mut self, msg: &[u8]) -> Result<(), ActorError>

keripy HttpEnd: events and receipts pushed by peers (non-local source).

Source

fn oobi(&mut self, aid: &str, role: Option<&str>) -> Result<Vec<u8>, ActorError>

keripy OOBIEnd: this witness’s own AID (KEL plus signed replies), or an AID it witnesses once that AID’s latest event is fully witnessed (that AID’s KEL plus this witness’s replies).

Source§

impl WitnessActor

Source

fn witnessed_oobi( &mut self, aid: &str, role: Option<&str>, ) -> Result<Vec<u8>, ActorError>

OOBI for an AID this witness witnesses (keripy OOBIEnd.on_get with fullyWitnessed): 404 until its latest event holds toad witness signatures, so a validator never gets a KEL it would have to escrow.

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
§

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

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

§

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.

§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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