pub struct Hab<'a> {
pub base: BaseHab<'a>,
pub cf: Option<Arc<Configer>>,
}Expand description
Hab class provides a given identifier controller’s local resource environment i.e. hab or habitat. Includes dependency injection of database, keystore, configuration file as well as Kevery and key store Manager.
§Attributes (Injected)
ks- LMDB key storedb- LMDB data base for KEL etccf- Config file instancemgr- Creates and rotates keys in key storertr- Routes reply ‘rpy’ messagesrvy- Factory that processes reply ‘rpy’ messageskvy- Factory for local processing of local event msgspsr- Parses local messages for .kvy .rvy
§Attributes
name- Alias of controllerpre- qb64 prefix of own local controller or None if newtemp- True means testing: use weak level when salty algo for stretching in key creation for incept and rotate of keys for this hab.preinited- True means fully initialized wrt databases. False means not yet fully initializeddelpre- Delegator prefix if any else None
§Properties
kever- Instance of key state of local controllerkevers- Of eventing.Kever instances from KELs in local db keyed by qb64 prefix. Read through cache of kevers of states for KELs in db.statesiserder- Own inception eventprefixes- Local prefixes for .dbaccepted- True means accepted into local KEL. False otherwise
Fields§
§base: BaseHab<'a>Base habitat functionality
cf: Option<Arc<Configer>>Configuration file instance
Implementations§
Source§impl<'a> Hab<'a>
impl<'a> Hab<'a>
Sourcepub fn new(
db: Arc<Baser>,
mgr: &'a mut Manager,
rtr: Option<Arc<Router>>,
rvy: &'a mut Revery,
kvy: &'a mut Kevery,
psr: &'a mut Parser<Empty>,
cf: Option<Arc<Configer>>,
name: String,
ns: Option<String>,
pre: Option<String>,
temp: bool,
delpre: Option<String>,
) -> Result<Self, KERIError>
pub fn new( db: Arc<Baser>, mgr: &'a mut Manager, rtr: Option<Arc<Router>>, rvy: &'a mut Revery, kvy: &'a mut Kevery, psr: &'a mut Parser<Empty>, cf: Option<Arc<Configer>>, name: String, ns: Option<String>, pre: Option<String>, temp: bool, delpre: Option<String>, ) -> Result<Self, KERIError>
Create a new Hab instance
§Parameters
db- Baser database instancemgr- Manager for key operationsrtr- Optional router for reply messagesrvy- Revery for processing reply messageskvy- Kevery for processing event messagespsr- Handler-less parser used to ingest locally produced messagescf- Optional configuration filename- Alias name for the controllerns- Optional namespacepre- Optional existing prefixtemp- Testing mode flagdelpre- Optional delegator prefix
§Returns
Result<Self, KERIError>- New Hab instance or error
Sourcepub fn make(
&mut self,
secrecies: Option<Vec<Vec<String>>>,
iridx: Option<usize>,
code: Option<&str>,
dcode: Option<&str>,
icode: Option<&str>,
transferable: Option<bool>,
isith: Option<Tholder>,
icount: Option<usize>,
nsith: Option<Tholder>,
ncount: Option<usize>,
toad: Option<u32>,
wits: Option<Vec<String>>,
delpre: Option<String>,
est_only: Option<bool>,
d_n_d: Option<bool>,
hidden: Option<bool>,
data: Option<Vec<SadValue>>,
algo: Option<Algos>,
salt: Option<Vec<u8>>,
tier: Option<Tiers>,
) -> Result<SerderKERI, KERIError>
pub fn make( &mut self, secrecies: Option<Vec<Vec<String>>>, iridx: Option<usize>, code: Option<&str>, dcode: Option<&str>, icode: Option<&str>, transferable: Option<bool>, isith: Option<Tholder>, icount: Option<usize>, nsith: Option<Tholder>, ncount: Option<usize>, toad: Option<u32>, wits: Option<Vec<String>>, delpre: Option<String>, est_only: Option<bool>, d_n_d: Option<bool>, hidden: Option<bool>, data: Option<Vec<SadValue>>, algo: Option<Algos>, salt: Option<Vec<u8>>, tier: Option<Tiers>, ) -> Result<SerderKERI, KERIError>
Create a new habitat with the given parameters. This method handles both replay (from secrecies) and normal inception flows.
Sourcepub fn algo(&self) -> Result<String, KERIError>
pub fn algo(&self) -> Result<String, KERIError>
Get the algorithm used for this habitat
§Returns
Result<String, KERIError>- The algorithm name or error
Sourcepub fn rotate(
&mut self,
isith: Option<Tholder>,
nsith: Option<Tholder>,
ncount: Option<u32>,
toad: Option<u32>,
cuts: Option<Vec<String>>,
adds: Option<Vec<String>>,
data: Option<Vec<SadValue>>,
) -> Result<Vec<u8>, KERIError>
pub fn rotate( &mut self, isith: Option<Tholder>, nsith: Option<Tholder>, ncount: Option<u32>, toad: Option<u32>, cuts: Option<Vec<String>>, adds: Option<Vec<String>>, data: Option<Vec<SadValue>>, ) -> Result<Vec<u8>, KERIError>
Perform rotation operation. Register rotation in database. Returns rotation message with attached signatures.
§Parameters
isith- Current signing thresholdnsith- Next signing thresholdncount- Next number of signing keystoad- Witness threshold after cuts and addscuts- List of witness prefixes to be removed from witness listadds- List of witness prefixes to be added to witness listdata- List of committed data such as seals
§Returns
Result<Vec<u8>, KERIError>- Rotation message with signatures or error
Methods from Deref<Target = BaseHab<'a>>§
Sourcepub fn ingest_local(&mut self, msg: &[u8]) -> Result<(), KERIError>
pub fn ingest_local(&mut self, msg: &[u8]) -> Result<(), KERIError>
Parse msg and route each message into this Hab’s Kevery/Revery as a
local (protected) source, e.g. to store a receipt this Hab just made.
Sourcepub fn make(
&mut self,
d_n_d: Option<bool>,
code: Option<&str>,
data: Option<Vec<SadValue>>,
delpre: Option<String>,
est_only: Option<bool>,
isith: Option<Tholder>,
verfers: Vec<Verfer>,
nsith: Option<Tholder>,
digers: Option<Vec<Diger>>,
toad: Option<u32>,
wits: Option<Vec<String>>,
) -> Result<SerderKERI, KERIError>
pub fn make( &mut self, d_n_d: Option<bool>, code: Option<&str>, data: Option<Vec<SadValue>>, delpre: Option<String>, est_only: Option<bool>, isith: Option<Tholder>, verfers: Vec<Verfer>, nsith: Option<Tholder>, digers: Option<Vec<Diger>>, toad: Option<u32>, wits: Option<Vec<String>>, ) -> Result<SerderKERI, KERIError>
Create inception event with verifiers, threshold settings, witnesses, etc.
pub fn save(&mut self, habord: &HabitatRecord) -> Result<(), KERIError>
pub fn reconfigure(&self)
Sourcepub fn iserder(&self) -> Result<SerderKERI, KERIError>
pub fn iserder(&self) -> Result<SerderKERI, KERIError>
Get own inception event serder
Sourcepub fn kever(&self) -> Result<&Kever, KERIError>
pub fn kever(&self) -> Result<&Kever, KERIError>
Get the kever (key state) of the local controller
Sourcepub fn incept(
&mut self,
transferable: Option<bool>,
code: Option<&str>,
count: Option<u32>,
ncount: Option<u32>,
isith: Option<Tholder>,
nsith: Option<Tholder>,
toad: Option<u32>,
wits: Option<Vec<String>>,
cnfg: Option<Vec<&str>>,
data: Option<Vec<SadValue>>,
delpre: Option<String>,
) -> Result<SerderKERI, KERIError>
pub fn incept( &mut self, transferable: Option<bool>, code: Option<&str>, count: Option<u32>, ncount: Option<u32>, isith: Option<Tholder>, nsith: Option<Tholder>, toad: Option<u32>, wits: Option<Vec<String>>, cnfg: Option<Vec<&str>>, data: Option<Vec<SadValue>>, delpre: Option<String>, ) -> Result<SerderKERI, KERIError>
Create inception event (alias for make)
Sourcepub fn rotate(
&mut self,
verfers: Option<Vec<Verfer>>,
digers: Option<Vec<Diger>>,
ncount: Option<u32>,
isith: Option<Tholder>,
nsith: Option<Tholder>,
toad: Option<u32>,
cuts: Option<Vec<String>>,
adds: Option<Vec<String>>,
data: Option<Vec<SadValue>>,
) -> Result<Vec<u8>, KERIError>
pub fn rotate( &mut self, verfers: Option<Vec<Verfer>>, digers: Option<Vec<Diger>>, ncount: Option<u32>, isith: Option<Tholder>, nsith: Option<Tholder>, toad: Option<u32>, cuts: Option<Vec<String>>, adds: Option<Vec<String>>, data: Option<Vec<SadValue>>, ) -> Result<Vec<u8>, KERIError>
Perform rotation operation
Sourcepub fn interact(
&mut self,
data: Option<Vec<SadValue>>,
) -> Result<Vec<u8>, KERIError>
pub fn interact( &mut self, data: Option<Vec<SadValue>>, ) -> Result<Vec<u8>, KERIError>
Create, sign and accept an interaction event (keripy Hab.interact).
data is the event’s anchor list a, typically seals such as
{"i": pre, "s": sn, "d": said}; None gives an empty list.
Sourcepub fn sign(
&self,
ser: &[u8],
verfers: Option<Vec<Verfer>>,
indexed: Option<bool>,
indices: Option<Vec<u32>>,
ondices: Option<Vec<Option<u32>>>,
ponly: Option<bool>,
) -> Result<Vec<Siger>, KERIError>
pub fn sign( &self, ser: &[u8], verfers: Option<Vec<Verfer>>, indexed: Option<bool>, indices: Option<Vec<u32>>, ondices: Option<Vec<Option<u32>>>, ponly: Option<bool>, ) -> Result<Vec<Siger>, KERIError>
Sign given serialization using appropriate keys
pub fn decrypt( &self, ser: &[u8], verfers: Option<Vec<Verfer>>, ) -> Result<Vec<u8>, KERIError>
pub fn query( &self, pre: &str, src: &str, query: Option<IndexMap<String, SadValue>>, route: Option<String>, reply_route: Option<String>, stamp: Option<String>, ) -> Result<Vec<u8>, KERIError>
pub fn endorse( &self, serder: &SerderKERI, last: Option<bool>, pipelined: Option<bool>, ) -> Result<Vec<u8>, KERIError>
Sourcepub fn forward(
&self,
recipient: &str,
topic: &str,
msg: &[u8],
mbx: &str,
) -> Result<Vec<u8>, KERIError>
pub fn forward( &self, recipient: &str, topic: &str, msg: &[u8], mbx: &str, ) -> Result<Vec<u8>, KERIError>
Envelope msg (a KERI message with its attachments) for recipient’s
mailbox at witness mbx, as keripy’s Poster.forwardToWitness does:
this identifier’s KEL when mbx is not one of its own witnesses (keripy
forwarding.introduce, which also skips it once mbx has receipted
our inception), then a /fwd exn with msg embedded at /e/evt,
endorsed by this identifier, then msg’s attachments as a pathed group.
POST the result to mbx.
The mailbox stores msg under {recipient}/{topic}; the recipient’s
keripy agent processes mailbox messages as local.
Sourcepub fn receipt(&mut self, serder: &SerderKERI) -> Result<Vec<u8>, KERIError>
pub fn receipt(&mut self, serder: &SerderKERI) -> Result<Vec<u8>, KERIError>
Create and process a receipt event for the given serder
Creates a KERI receipt event for the provided event serder, signs it with the appropriate signature type based on transferability, and processes it into the local database.
§Arguments
serder- The event serder to create a receipt for
§Returns
Result<Vec<u8>, KERIError>- The complete receipt message bytes
§Errors
KERIError::ValidationError- If receipt building, signing, or processing failsKERIError::ConfigurationError- If habitat not properly initializedKERIError::MissingEntryError- If required kever state is missing
pub fn witness(&mut self, serder: &SerderKERI) -> Result<Vec<u8>, KERIError>
Sourcepub fn replay(
&self,
pre: Option<&str>,
fn_num: Option<u64>,
) -> Result<Vec<u8>, KERIError>
pub fn replay( &self, pre: Option<&str>, fn_num: Option<u64>, ) -> Result<Vec<u8>, KERIError>
Replay events for the given prefix starting from the specified first seen number.
This method creates a complete replay by first including the delegation chain (if the identifier is delegated), then including all events for the prefix starting from the specified first seen ordinal number.
§Parameters
pre- Optional identifier prefix as string. If None, uses self.prefn_num- Optional first seen number to start replay from. Default is 0
§Returns
Result<Vec<u8>, KERIError>- Concatenated messages representing the complete replay
Sourcepub fn replay_all(&self) -> Result<Vec<u8>, KERIError>
pub fn replay_all(&self) -> Result<Vec<u8>, KERIError>
Replay all events for all identifier prefixes in the database.
This method creates a complete replay of all events across all prefixes in first seen order with attachments. Useful for database synchronization and backup scenarios.
§Returns
Result<Vec<u8>, KERIError>- Concatenated messages representing all events
Sourcepub fn make_other_event(
&self,
pre: impl AsRef<[u8]>,
sn: u64,
) -> Result<Option<Vec<u8>>, KERIError>
pub fn make_other_event( &self, pre: impl AsRef<[u8]>, sn: u64, ) -> Result<Option<Vec<u8>>, KERIError>
Sourcepub fn fetch_end(
&self,
cid: &str,
role: &str,
eid: &str,
) -> Result<Option<EndpointRecord>, KERIError>
pub fn fetch_end( &self, cid: &str, role: &str, eid: &str, ) -> Result<Option<EndpointRecord>, KERIError>
Sourcepub fn fetch_loc(
&self,
eid: &str,
scheme: Option<&str>,
) -> Result<Option<LocationRecord>, KERIError>
pub fn fetch_loc( &self, eid: &str, scheme: Option<&str>, ) -> Result<Option<LocationRecord>, KERIError>
Sourcepub fn fetch_end_allowed(
&self,
cid: &str,
role: &str,
eid: &str,
) -> Result<Option<bool>, KERIError>
pub fn fetch_end_allowed( &self, cid: &str, role: &str, eid: &str, ) -> Result<Option<bool>, KERIError>
Fetch endpoint allowed status for given cid, role, and eid
§Parameters
cid- Controller identifier (qb64 prefix)role- Role such as watcher, witnesseid- Endpoint identifier
§Returns
Ok(Some(bool))- If record found and allowed status is setOk(None)- If no record found or allowed status is NoneErr(KERIError)- On database error
Sourcepub fn fetch_end_enabled(
&self,
cid: &str,
role: &str,
eid: &str,
) -> Result<Option<bool>, KERIError>
pub fn fetch_end_enabled( &self, cid: &str, role: &str, eid: &str, ) -> Result<Option<bool>, KERIError>
Fetch endpoint enabled status for given cid, role, and eid
§Parameters
cid- Controller identifier (qb64 prefix)role- Role such as watcher, witnesseid- Endpoint identifier
§Returns
Ok(Some(bool))- If record found and enabled status is setOk(None)- If no record found or enabled status is NoneErr(KERIError)- On database error
Sourcepub fn fetch_end_authzed(
&self,
cid: &str,
role: &str,
eid: &str,
) -> Result<Option<bool>, KERIError>
pub fn fetch_end_authzed( &self, cid: &str, role: &str, eid: &str, ) -> Result<Option<bool>, KERIError>
Fetch endpoint authorization status (enabled OR allowed) for given cid, role, and eid
§Parameters
cid- Controller identifier (qb64 prefix)role- Role such as watcher, witnesseid- Endpoint identifier
§Returns
Ok(Some(bool))- If record found and either enabled or allowed is trueOk(None)- If no record found or both enabled and allowed are None/falseErr(KERIError)- On database error
Sourcepub fn fetch_url(
&self,
eid: &str,
scheme: Option<&str>,
) -> Result<Option<String>, KERIError>
pub fn fetch_url( &self, eid: &str, scheme: Option<&str>, ) -> Result<Option<String>, KERIError>
Sourcepub fn fetch_urls(
&self,
eid: &str,
scheme: Option<&str>,
) -> Result<Mict<String, String>, KERIError>
pub fn fetch_urls( &self, eid: &str, scheme: Option<&str>, ) -> Result<Mict<String, String>, KERIError>
Fetch URLs for given eid and optional scheme filter Returns a Mict containing (scheme, url) pairs for all matching locations
§Parameters
eid- Endpoint identifierscheme- Optional scheme filter (empty string means all schemes)
§Returns
Ok(Mict<String, String>)- Mict containing scheme->url mappingsErr(KERIError)- On database error
Sourcepub fn fetch_role_urls(
&self,
cid: &str,
role: Option<&str>,
scheme: Option<&str>,
eids: Option<&[String]>,
enabled: bool,
allowed: bool,
) -> Result<Mict<String, Mict<String, Mict<String, String>>>, KERIError>
pub fn fetch_role_urls( &self, cid: &str, role: Option<&str>, scheme: Option<&str>, eids: Option<&[String]>, enabled: bool, allowed: bool, ) -> Result<Mict<String, Mict<String, Mict<String, String>>>, KERIError>
Fetch role URLs for given cid, role, and optional filters Returns a Mict containing role -> Mict(eid -> urls) mappings
§Parameters
cid- Controller identifierrole- Optional role filter (empty string means all roles)scheme- Optional scheme filter (empty string means all schemes)eids- Optional list of endpoint identifiers to filter byenabled- Whether to include enabled endpointsallowed- Whether to include allowed endpoints
§Returns
Ok(Mict<String, Mict<String, Mict<String, String>>>)- Nested Mict structureErr(KERIError)- On database error
Sourcepub fn fetch_witness_urls(
&self,
cid: &str,
scheme: Option<&str>,
eids: Option<&[String]>,
enabled: bool,
allowed: bool,
) -> Result<Mict<String, Mict<String, Mict<String, String>>>, KERIError>
pub fn fetch_witness_urls( &self, cid: &str, scheme: Option<&str>, eids: Option<&[String]>, enabled: bool, allowed: bool, ) -> Result<Mict<String, Mict<String, Mict<String, String>>>, KERIError>
Fetch witness URLs for given cid Convenience method that calls fetch_role_urls with witness role
§Parameters
cid- Controller identifierscheme- Optional scheme filter (empty string means all schemes)eids- Optional list of endpoint identifiers to filter byenabled- Whether to include enabled endpointsallowed- Whether to include allowed endpoints
§Returns
Ok(Mict<String, Mict<String, Mict<String, String>>>)- Nested Mict structureErr(KERIError)- On database error
Sourcepub fn ends_for(
&self,
pre: &str,
) -> Result<HashMap<String, HashMap<String, HashMap<String, String>>>, KERIError>
pub fn ends_for( &self, pre: &str, ) -> Result<HashMap<String, HashMap<String, HashMap<String, String>>>, KERIError>
Get all endpoints for a given prefix, organized by role and endpoint ID Returns a nested HashMap structure: role -> eid -> scheme -> url
§Parameters
pre- Prefix (controller identifier)
§Returns
Ok(HashMap<String, HashMap<String, HashMap<String, String>>>)- Nested structure of endpointsErr(KERIError)- On database error
Sourcepub fn reply(
&self,
route: String,
data: Option<IndexMap<String, SadValue>>,
stamp: Option<String>,
version: Option<String>,
kind: Option<String>,
last: Option<bool>,
pipelined: Option<bool>,
) -> Result<Vec<u8>, KERIError>
pub fn reply( &self, route: String, data: Option<IndexMap<String, SadValue>>, stamp: Option<String>, version: Option<String>, kind: Option<String>, last: Option<bool>, pipelined: Option<bool>, ) -> Result<Vec<u8>, KERIError>
Create and endorse a reply event
§Parameters
route- Namespaced path that indicates data flow handlerdata- Optional attribute section of replystamp- Optional timestamp (RFC-3339 format)version- Optional version stringkind- Optional serialization kindlast- Optional flag for seal type (default: false)pipelined- Optional flag for message format (default: true)
§Returns
Ok(Vec<u8>)- Endorsed reply messageErr(KERIError)- On validation or signing error
Sourcepub fn make_end_role(
&self,
eid: String,
role: Option<Roles>,
allow: Option<bool>,
stamp: Option<String>,
) -> Result<Vec<u8>, KERIError>
pub fn make_end_role( &self, eid: String, role: Option<Roles>, allow: Option<bool>, stamp: Option<String>, ) -> Result<Vec<u8>, KERIError>
Create and endorse an endpoint role management reply event
§Parameters
eid- Endpoint identifierrole- Role to assign (default: Controller)allow- If true, adds the role; if false, removes it (default: true)stamp- Optional timestamp (RFC-3339 format)
§Returns
Ok(Vec<u8>)- Endorsed endpoint role reply messageErr(KERIError)- On validation or signing error
Sourcepub fn load_end_role(
&self,
cid: &str,
eid: &str,
role: Option<Roles>,
) -> Result<Vec<u8>, KERIError>
pub fn load_end_role( &self, cid: &str, eid: &str, role: Option<Roles>, ) -> Result<Vec<u8>, KERIError>
Sourcepub fn make_loc_scheme(
&self,
url: String,
eid: Option<String>,
scheme: Option<String>,
stamp: Option<String>,
) -> Result<Vec<u8>, KERIError>
pub fn make_loc_scheme( &self, url: String, eid: Option<String>, scheme: Option<String>, stamp: Option<String>, ) -> Result<Vec<u8>, KERIError>
Create and endorse a location scheme reply message
§Parameters
url- The URL for this location schemeeid- Optional endpoint identifier (defaults to self.pre)scheme- Scheme type (default: “http”)stamp- Optional timestamp (RFC-3339 format)
§Returns
Ok(Vec<u8>)- Endorsed location scheme reply messageErr(KERIError)- On validation or signing error
Sourcepub fn reply_loc_scheme(
&self,
eid: String,
scheme: Option<String>,
) -> Result<Vec<u8>, KERIError>
pub fn reply_loc_scheme( &self, eid: String, scheme: Option<String>, ) -> Result<Vec<u8>, KERIError>
Create reply messages for all location schemes matching the given eid and scheme
§Parameters
eid- Endpoint identifierscheme- Optional scheme filter (empty string means all schemes)
§Returns
Ok(Vec<u8>)- Combined reply messages for all matching location schemesErr(KERIError)- On database error or message creation failure
Sourcepub fn load_loc_scheme(
&self,
eid: &str,
scheme: Option<&str>,
) -> Result<Vec<u8>, KERIError>
pub fn load_loc_scheme( &self, eid: &str, scheme: Option<&str>, ) -> Result<Vec<u8>, KERIError>
Sourcepub fn reply_end_role(
&self,
cid: &str,
role: Option<Roles>,
eids: Option<&[String]>,
scheme: Option<&str>,
) -> Result<Vec<u8>, KERIError>
pub fn reply_end_role( &self, cid: &str, role: Option<Roles>, eids: Option<&[String]>, scheme: Option<&str>, ) -> Result<Vec<u8>, KERIError>
Reply with endpoint role information for a given controller identifier
§Parameters
cid- Controller identifierrole- Optional role filter (None means all roles)eids- Optional list of endpoint identifiers to filter byscheme- Scheme filter for location queries (empty string means all schemes)
§Returns
Ok(Vec<u8>)- Combined reply messagesErr(KERIError)- On database error or validation failure
Sourcepub fn reply_to_oobi(
&self,
aid: &str,
role: Roles,
eids: Option<&[String]>,
) -> Result<Vec<u8>, KERIError>
pub fn reply_to_oobi( &self, aid: &str, role: Roles, eids: Option<&[String]>, ) -> Result<Vec<u8>, KERIError>
Reply to OOBI (Out-Of-Band Introduction) request This is a simple wrapper around reply_end_role
§Parameters
aid- Agent identifier (controller ID)role- Role to reply witheids- Optional list of endpoint identifiers to filter by
§Returns
Ok(Vec<u8>)- Combined reply messagesErr(KERIError)- On database error or validation failure
Sourcepub fn get_own_event<T>(
&self,
sn: u64,
allow_partially_signed: bool,
) -> Result<(SerderKERI, Vec<Siger>, Option<T>), KERIError>
pub fn get_own_event<T>( &self, sn: u64, allow_partially_signed: bool, ) -> Result<(SerderKERI, Vec<Siger>, Option<T>), KERIError>
Get own event at specified sequence number
§Parameters
sn- Sequence number of the event to retrieveallow_partially_signed- If true, also check partially signed events database
§Returns
Ok((SerderKERI, Vec<Siger>, Option<T>))- Event serder, signatures, and optional coupleErr(KERIError)- On missing event or database error
Sourcepub fn make_own_event(
&self,
sn: u64,
allow_partially_signed: bool,
) -> Result<Vec<u8>, KERIError>
pub fn make_own_event( &self, sn: u64, allow_partially_signed: bool, ) -> Result<Vec<u8>, KERIError>
Create own event message with attachments at specified sequence number
§Parameters
sn- Sequence number of the event to retrieveallow_partially_signed- If true, also check partially signed events database
§Returns
Ok(Vec<u8>)- Complete event message with attachmentsErr(KERIError)- On missing event or database error
Sourcepub fn witness_receipt_msgs(
&self,
sn: u64,
) -> Result<Vec<(String, Vec<u8>)>, KERIError>
pub fn witness_receipt_msgs( &self, sn: u64, ) -> Result<Vec<(String, Vec<u8>)>, KERIError>
Messages that give every witness of own event sn the receipts of
the other witnesses (the second half of keripy Receiptor.receipt).
For each witness, the message is a rct for the event with the other
witnesses’ signatures stored so far as receipt couples. For an
inception, and for a rotation toward a witness it adds, the other
witnesses’ /loc/scheme replies come first so the witnesses learn
each other’s endpoints. A witness with nothing to receive is skipped.
Returns (witness prefix, CESR stream) pairs.
Sourcepub fn make_own_inception(
&self,
allow_partially_signed: bool,
) -> Result<Vec<u8>, KERIError>
pub fn make_own_inception( &self, allow_partially_signed: bool, ) -> Result<Vec<u8>, KERIError>
Create own inception event message with attachments This is a convenience method that calls make_own_event with sn=0
§Parameters
allow_partially_signed- If true, also check partially signed events database
§Returns
Ok(Vec<u8>)- Complete inception event message with attachmentsErr(KERIError)- On missing event or database error