LanGrpcDappTransport

class LanGrpcDappTransport(host: String, port: Int, credentials: ChannelCredentials = InsecureChannelCredentials.create()) : DappTransport, AutoCloseable

The dApp side of the LAN transport: a DappTransport over a gRPC bidirectional stream to a LanGrpcDappServer.

The stream opens on construction and stays open for the session. Requests go out as frames; responses come back correlated by their JSON-RPC id, and event notifications arrive on events — the reason to hold a stream open rather than dial per request.

Correlation is explicit because a bidi stream interleaves responses with notifications and does not promise response order. Each in-flight request parks a CompletableDeferred keyed by its id; the receive side completes it when the matching response arrives.

Security note: this slice dials with InsecureChannelCredentials. The LAN trust story pins the peer's self-signed certificate via the QR fingerprint (TlsTrust.TrustRoots.Certificates); the credentials are a constructor seam so that drops in unchanged. Loopback and pinned LAN only — never plaintext across an untrusted network.

Constructors

Link copied to clipboard
constructor(host: String, port: Int, credentials: ChannelCredentials = InsecureChannelCredentials.create())

Properties

Link copied to clipboard
open override val events: Flow<DappEvent>

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
open suspend override fun send(request: JsonRpcRequest): JsonRpcResponse