Liking cljdoc? Tell your friends :D

urd.consensus.networks.kabel

Kabel-based P2P network implementation for consensus.

Provides a real P2P network layer using Kabel WebSockets. This is one implementation of the ConsensusNetwork protocol.

Kabel-based P2P network implementation for consensus.

Provides a real P2P network layer using Kabel WebSockets.
This is one implementation of the ConsensusNetwork protocol.
raw docstring

consensus-strategyclj

(consensus-strategy handler-fn)

Create a simple pub/sub strategy that forwards messages to a handler.

Create a simple pub/sub strategy that forwards messages to a handler.
sourceraw docstring

create-kabel-clientclj

(create-kabel-client supervisor peer-id server-url)

Create a Kabel network peer that connects to a server.

Args: supervisor - superv.async supervisor peer-id - UUID for this peer server-url - URL to connect to (e.g., "ws://localhost:47291")

Returns: Channel yielding KabelNetwork instance

Create a Kabel network peer that connects to a server.

Args:
  supervisor - superv.async supervisor
  peer-id - UUID for this peer
  server-url - URL to connect to (e.g., "ws://localhost:47291")

Returns:
  Channel yielding KabelNetwork instance
sourceraw docstring

create-kabel-serverclj

(create-kabel-server supervisor peer-id port)

Create a Kabel network peer that acts as a server.

Uses a single server peer for both broadcasting and subscribing. Local subscriptions are handled by adding local channels as subscribers.

Args: supervisor - superv.async supervisor peer-id - UUID for this peer port - Port to listen on (e.g., 47291)

Returns: Channel yielding KabelNetwork instance

Create a Kabel network peer that acts as a server.

Uses a single server peer for both broadcasting and subscribing.
Local subscriptions are handled by adding local channels as subscribers.

Args:
  supervisor - superv.async supervisor
  peer-id - UUID for this peer
  port - Port to listen on (e.g., 47291)

Returns:
  Channel yielding KabelNetwork instance
sourceraw docstring

register-consensus-topics!clj

(register-consensus-topics! kabel-network topics)

Register the topics a node will use on the SERVER peer.

topics is the set the node declares through node/check-topics, plus :direct for emulated unicast. It used to be a hardcoded list -- :proposals :votes :finalizations :recovery :direct -- which is round-robin's vocabulary, and a topic the server has not registered simply never delivers.

That made round-robin the ONLY algorithm that could work over kabel: Tendermint broadcasts on :consensus, SCP on :scp, Bullshark on :bullshark, Nakamoto on :headers, and every one of those went to a topic the server had never heard of. It fails silently -- a node that starts cleanly, reports no error, and makes no progress.

The runtime's SUBSCRIPTION side of this was fixed when topics became part of the capability declaration; this registration side was missed in the same change, and the comment left here pointed at runtime/consensus-topics, which that change deleted. Half a fix reads exactly like a whole one.

Args: kabel-network - KabelNetwork instance (server) topics - set of topic keywords the node declares

Returns: Channel that yields true when complete

Register the topics a node will use on the SERVER peer.

`topics` is the set the node declares through `node/check-topics`, plus
`:direct` for emulated unicast. It used to be a hardcoded list --
`:proposals :votes :finalizations :recovery :direct` -- which is
round-robin's vocabulary, and a topic the server has not registered simply
never delivers.

That made round-robin the ONLY algorithm that could work over kabel:
Tendermint broadcasts on `:consensus`, SCP on `:scp`, Bullshark on
`:bullshark`, Nakamoto on `:headers`, and every one of those went to a topic
the server had never heard of. It fails silently -- a node that starts
cleanly, reports no error, and makes no progress.

The runtime's SUBSCRIPTION side of this was fixed when topics became part of
the capability declaration; this registration side was missed in the same
change, and the comment left here pointed at `runtime/consensus-topics`,
which that change deleted. Half a fix reads exactly like a whole one.

Args:
  kabel-network - KabelNetwork instance (server)
  topics        - set of topic keywords the node declares

Returns:
  Channel that yields true when complete
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close