X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=ARCH.md;h=c55e2ef74d368b7b944a93c513add5dfc3b5189d;hb=98bc46beb9d364915c7c43c96b154b0d5efa0ba3;hp=061c0ba4f8330145f5d965a8550aed8676ef6acb;hpb=3ee6a27bc6cef28ba52059a405913ca5c6e1dcb7;p=rust-lightning diff --git a/ARCH.md b/ARCH.md index 061c0ba4..c55e2ef7 100644 --- a/ARCH.md +++ b/ARCH.md @@ -6,7 +6,7 @@ need to use are `ChannelManager` and `ChannelMonitor`. `ChannelManager` holds mu channels, routes payments between them, and exposes a simple API to make and receive payments. Individual `ChannelMonitor`s monitor the on-chain state of a channel, punish counterparties if they misbehave, and force-close channels if they contain unresolved -HTLCs which are near expiration. The `ManyChannelMonitor` API provides a way for you to +HTLCs which are near expiration. The `chain::Watch` interface provides a way for you to receive `ChannelMonitorUpdate`s from `ChannelManager` and persist them to disk before the channel steps forward. @@ -39,24 +39,24 @@ At a high level, some of the common interfaces fit together as follows: ----------------- | UserConfig | -------------------- | -------------- /------| MessageSendEvent | | | ---------------- - | -------------------- | | | FeeEstimator | - | (as MessageSendEventsProvider) | | ---------------- - | ^ | | / | ------------------------ - | \ | | / ---------> | BroadcasterInterface | - | \ | | / / | ------------------------ - | \ v v v / v ^ - | (as ------------------ ---------------------- - | ChannelMessageHandler)-> | ChannelManager | ----> | ManyChannelMonitor | - v / ------------------ ---------------------- ---------------- / (as EventsProvider) -| PeerManager |- \ / ---------------- \ / - | ----------------- \ / - | | chain::Access | v - | ----------------- --------- - | | | Event | -(as RoutingMessageHandler) v --------- - \ -------------------- - -----------------> | NetGraphMsgHandler | - -------------------- + | -------------------- | | | FeeEstimator | <----------------------- + | (as MessageSendEventsProvider) | | ---------------- \ + | ^ | | / ------------------------ | + | \ | | / ---------> | BroadcasterInterface | | + | \ | | / / ------------------------ | + | \ v v v / ^ | + | (as ------------------ ---------------- | | + | ChannelMessageHandler)-> | ChannelManager | ----> | chain::Watch | | | + v / ------------------ ---------------- | | +--------------- / (as EventsProvider) ^ | | +| PeerManager |- \ | | | +--------------- \ | (is-a) | | + | ----------------- \ _---------------- / / + | | chain::Access | \ / | ChainMonitor |--------------- + | ----------------- \ / ---------------- + | | \ / | +(as RoutingMessageHandler) v v v + \ -------------------- --------- ----------------- + -----------------> | NetGraphMsgHandler | | Event | | chain::Filter | + -------------------- --------- ----------------- ```