Sable is an experimental chat server designed to address many of the fundamental limitations of legacy IRC server software. In particular:
Things are still changing too much to draw a diagram here. The foundational principles are:
Event
. All events have a target object which
they modify, a globally-unique event ID, an event clock containing its dependency information, other
metadata, and a typed details structure describing the change being made.Event
s emitted by the event log.
Event application is careful to ensure that any valid order of application for a set of events will
eventually produce the same state.Some other design decisions which are not as fundamental but are worth mentioning:
Currently, Sable is split into several crates:
sable_network
contains all of the network data model and logic for running a network server. This
includes state tracking but no client protocol logic.
sable_network::network
contains the Network
type which represents network state and handles
event application and conflict resolution, as well as the various state objects and convenience wrappers
that make up a network. It also contains definitions of the event types.sable_network::history
contains the NetworkHistoryLog
type which represents the network history
as it is visible to each user of the networksable_network::sync
contains the network synchronisation codesable_network::node
contains the NetworkNode
struct which manages synchronisation and communication
with the rest of the networksable_server
contains generic code to run a network node and plug in node-specific functionality (such
as a client server or services node)sable_ircd
contains the IRC client serversable_services
contains the special-purpose services node, which maintains a network-wide source of
truth for account and registration data.client_listener
and auth_client
contain split-out parts of the client server which run in their
own processes.sable_ipc
contains IPC channel types used by the split-out processes to communicate with the main
client server.sable_macros
contains procedural macros used by the other crates.cargo build
There's a sample set of configs and certificates in the configs
directory, which will run a network of
two servers on 127.0.1.2 and 127.0.1.3, both using 6667 and 6697 for client connections, and 6668 for server
linking. To run them:
./target/debug/sable_ircd -n configs/network.conf -s configs/server1.conf --bootstrap-network configs/network_config.json
./target/debug/sable_ircd -n configs/network.conf -s configs/server2.conf
There are two types of network configuration. At present, the list of nodes and their network addresses
is static, and read only at startup. This is what's in the network.conf
file, which should be shared
between all server nodes. Runtime configuration currently consists of operator credentials, and is
contained in a separate file (network_config.json
in the examples). This can be loaded via the command
line when bootstrapping a new network, or updated at runtime via the config_loader
utility.