From 8d7a43924619cad6e59c6180cc891d47d0cca035 Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Wed, 27 Apr 2016 17:58:39 +0100 Subject: [PATCH] Document network map service --- docs/source/messaging.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/source/messaging.rst b/docs/source/messaging.rst index eefd63c0a0..b43a356c70 100644 --- a/docs/source/messaging.rst +++ b/docs/source/messaging.rst @@ -94,4 +94,29 @@ sit around waiting for messages to be delivered. Handlers will then be invoked o more difficult style of programming that can be used to increase the realism of the unit tests by ensuring multiple nodes run in parallel, just as they would on a real network spread over multiple machines. +Network Map Service +------------------- +Supporting the messaging layer is a network map service, which is responsible for tracking public nodes on the network. +Nodes have an internal component, the network map cache, which contains a copy of the network map. When a node starts up +its cache fetches a copy of the full network map, and requests to be notified of changes. The node then registers itself +with the network map service, and the service notifies subscribers that a new node has joined the network. Nodes do not +automatically deregister themselves, so far (for example) nodes going offline briefly for maintenance + +Nodes submit signed changes to the map service, which then forwards them on to nodes which have requested to be notified +of changes. This process achieves basic consensus of the overall network map, although currently it has no formal +process for identifying or recovering from issues such as network outages. Later versions are planned to address this. + +Registration change notifications contain a serial number, which indicates their relative ordering, similar to the +serial number on DNS records. These numbers must increase with each change, but are not expected to be sequential. +Changes are then signed by the party whom the node represents to confirm the association between party and node. +The change, signature and public key are then sent to the network map service, which verifies the signature and then +updates the network map accordingly. + +The network map cache currently supports: + +* Looking up nodes by service +* Looking up node for a party +* Suggesting a node providing a specific service, based on suitability for a contract and parties, for example suggesting +an appropriate interest rates oracle for a interest rate swap contract. Currently no recommendation logic is in place +(the code simply picks the first registered node that supports the required service), however.