forked from redhog/cliqueclique
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
108 lines (80 loc) · 3.03 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
git clone git://github.com/dcramer/django-idmapper.git
Every document (forum message) forms two overlaying networks of nodes
that has a copy of that document. The networks are connected graphs,
and one of them is a strict subnetwork of the other one. The smaller
one is the "subscribing" set. Nodes in the subscribing set gets copies
of all comments to the document. The protocol is push-based: When you
have a peer that is subscribed to a document you have, and you have a
comment to that document, you send that comment to the peer. The
protocol attempts to keep the network for a document a connected graph
by allways electing a "root node" among themselves, and keeping track
of their distances from that root node. This way, no closed,
disconnected circles can form (circles can still form, bur they'r
obvious). This means that a document is only present on the nodes
actually interested in that particular document. It is a bit like what
NNTP would be, where nodes subscribe to newsgroups, if every message
had its own newsgroup.
Node A only pushes comments to document x to B if A and B share
document x. Every node should probably have a max-peers-per-document
setting to keep the branching level reasonable. For two nodes to
initiate contact, they both need to know a third node, and share the
same document with that third node. For eaxmple a "root document"
Every "virtual forum" consist of a root document, and you have to have
its id, and the address of a peer that also has it, to initiate
contact / usage of that forum. Every document (forum message) linked
from teh root, or from documents linked from the root (and so on)
forms its own network, and the original peer with the root document
need not be part of every such network.
You install i2p and cliqueclique on your machine, then go to
localhost:whatever in your browser. You enter a peer address and forum
root document id You _can_ of course run a node publicly as a website
too
My current django code supports multiple nodes in one installation,
each node connected to a django user object It's a rather simple idea
really. Only drawback I can think of is overhead :S
Algorithms
===========
Metadata sync
--------------
Node1 (server)
---------------
Data:
local: Its own data
serial: Version of its data
serialcopy: copy of the other nodes' copy of its own serial
time=1
When local changes:
serial += 1
time = 1
While serial != serialcopy:
Send (local, serial) to other node
Wait time
time *= 2
When receiving:
if received.serial == serial:
serialcopy = serial
Node2 (client)
---------------
Data
peer: a copy of the other nodes' data
peerserial: copy of the other nodes' serial
When receiving:
Copy received.local to peer
Send received.serial back to other node
Metadata deletion
------------------
Node1 (server)
---------------
Data:
local: Its own data
While local exists:
Send delete request to other node
When receiving:
Delete local
Node2 (client)
---------------
Data
peer: a copy of the other nodes' data
When receiving:
Delete peer
Send ACK to peer