Expand description
The pool feature: the app side of remote inference over weirdnet-net.
NetDialer: aDialerthat opens agent protocol streams to peers by id.LinkedNodes: aNodeSourceof the inference nodes among the user’s linked devices (active certs in theweirdnet-syncroster whose node announcesINFERENCE_APP), direct connections before relayed ones.connect: aPoolover both, presenting this device’s certificate.connect_shared(since 0.5.9): aPoolover a pool owned by another Weirdnet identity, from itsPoolSharelink: the share’s nodes in order (no roster discovery), dialed by peer id with the share’s addresses, presenting this device’s guest credential (encode_credential). The owner’s nodes admit it by their guest policy (serve::GuestAuth); a refusal (not-shared,guest-revoked,wrong-userfrom a node that does not take guests) comes back asRemoteError::Refused.
Dialing another user’s node needs nothing special: weirdnet-net streams are authenticated by
the peer id (Noise), whoever its user is, and relay circuit addresses
(.../p2p-circuit/p2p/<id>) in the share work as for linked devices. The peer ids in the
share are what the connection checks, so take shares only from someone you trust to name the
pool’s nodes (as with any link).
The pool itself (crate::remote::pool) is transport-neutral.
Re-exports§
pub use crate::remote::pool::Answer;pub use crate::remote::pool::CatalogWatch;pub use crate::remote::pool::EventSink;pub use crate::remote::pool::Interrupted;pub use crate::remote::pool::Job;pub use crate::remote::pool::NoEvents;pub use crate::remote::pool::NodeSource;pub use crate::remote::pool::Pool;pub use crate::remote::pool::PoolEvent;pub use crate::remote::pool::PoolOptions;pub use crate::remote::pool::Stall;
Structs§
- Linked
Nodes - The inference nodes among the user’s linked devices.
- NetDialer
- Opens agent streams over a
weirdnet-netnode. Node ids are peer ids. - Presented
- What a caller presented: a certificate, and its user’s public key when it sent a guest
credential (
encode_credential). Nothing here is checked yet.
Constants§
- INFERENCE_
APP - The app name inference nodes announce (
Node::serve_app), so the pool can find them among the user’s linked devices. Model nodes do not announce it: apps never call them.
Functions§
- channel
- A
Channelover a stream: length-prefixed messages (crate::remote::codec). A task drives the stream; dropping the channel closes our side, and once both sides are done the stream is dropped. Call from a Tokio runtime. - connect
- A
Poolovernode: inference nodes among the roster’s linked devices, presentingcert(this device’s certificate) with every request. - connect_
shared - A
Poolover a pool another Weirdnet identity shared with this one (PoolShare): its nodes in the share’s order (failover across them as usual), dialed throughnode, with this device’s guest credential (user_key, the public key of this device’s user, andcert, this device’s certificate) presented with every catalog/1 and infer/2 request. No roster discovery is done for it. Errors (BadRequest) for an invalid or expired share, or a certificate that is not this node’s or notuser_key’s. - decode_
cert - decode_
presented - Reads presented bytes: a guest credential or a bare certificate (
encode_cert). - encode_
cert - A certificate as presented with a request (
Caller::cert_bytes,PoolOptions::cert). - encode_
credential - A guest credential (since 0.5.9): this device’s certificate plus its user’s public key
(protobuf), so a node of a different user can check the certificate (a
NodeCertnames its user only by id). Present it with requests to a shared pool (pool::connect_shareddoes). Public: it holds no secret. - share_
dialer - A
NetDialerfor a shared pool: the share’s nodes with their addresses as hints. Checks that every peer id and address parses (an address for another peer is refused). - stream_
limits - Stream limits for the agent protocols:
weirdnet-netdefaults (30 s resume window), no idle reset (a queued request can be quiet for a while;Queuedkeepalives come every 3 s).
Type Aliases§
- Roster
View - The roster as it is now (the app keeps it current from
weirdnet-sync).