Hyperlinkv0.8.0-beta.28

Hyperlink

Hyperlink.layerProtocolconstsrc/Hyperlink.ts:4051
(
  protocol: Layer.Layer<RpcClient.Protocol>
): Layer.Layer<RpcClient.Protocol>

The standard way to set the RPC client transport: hand it any RpcClient.Protocol layer and it becomes the ambient transport that every nodeless Hyperlink.client — and each node's peers fold — reads. This is the primitive; protocolHttp / protocolWebsocket build the two common protocols, and ws / http are per-node shortcuts layered on top. Provide it once and the whole app agrees on a wire:

Effect.provide(app, Hyperlink.layerProtocol(Hyperlink.protocolWebsocket())); // one knob
Effect.provide(app, Hyperlink.layerProtocol(Hyperlink.protocolHttp("http://edge/rpc")));
Source src/Hyperlink.ts:40513 lines
export const layerProtocol = (
  protocol: Layer.Layer<RpcClient.Protocol>,
): Layer.Layer<RpcClient.Protocol> => protocol;