A node may connect to another node and use its REPL as a client would. This allows to nodes to synchronize: a node checks what it has, then gets and puts the differences (that they need: see Object distribution and world splitting).
The process of node connecting is as follows:
- Node A connects to Node B.
- Node A tells Node B it is a node, with a message such as
- Node B connects to Node A. This checks if Node A is truly a node, and makes bidirectional communication simpler and possibly faster.
- Both nodes store the others' address. The nodes can then recall the address when looking for new nodes, and allows nodes to discover more nodes.
- Nodes start synchronization. Nodes should
putfiles the other does not have.
Nodes can also periodically check each other for other nodes. I suggest the
get-nodes command for this: it just lists all the connected nodes which have announced themselves.