git ssb

4+

Dominic / scuttlebot



Tree: 05ee423a12eb6b100c38f199ce6a95689b0f4f49

Files: 05ee423a12eb6b100c38f199ce6a95689b0f4f49 / plugins / gossip.html

7386 bytesRaw
1<html>
2 <head>
3 <title>Scuttlebot Gossip Plugin - Documentation - SSBC</title>
4 <link rel="stylesheet" href="/normalize.css">
5 <link rel="stylesheet" href="/styles.css">
6 <link rel="stylesheet" href="/atelier-forest-light.css">
7 <script src="/highlight.pack.js"></script>
8 <script>hljs.initHighlightingOnLoad();</script>
9 </head>
10 <body>
11 <div id="topnav">
12 <div id="topnav-inner">
13 <a class="topnav-item " href="/" title="Home">
14 Home<br><small>SSBC</small>
15 </a>
16 <a class="topnav-item " href="/patchwork" title="Patchwork">
17 Patchwork<br><small>Social Messaging App</small>
18 </a>
19 <a class="topnav-item " href="/scuttlebot" title="Scuttlebot">
20 Scuttlebot<br><small>P2P Log Store</small>
21 </a>
22 <a class="topnav-item selected" href="/docs" title="Documentation">
23 Documentation<br><small>APIs, Articles</small>
24 </a>
25 </div>
26 </div>
27 <div id="layout">
28 <div id="leftnav">
29 <div class="leftnav-item">Key Concepts</div>
30 <div class="leftnav-subitems">
31 <div class="leftnav-item ">
32 <a href="/secure-scuttlebutt" title="Secure Scuttlebutt: a global database protocol">Secure Scuttlebutt: a global database protocol</a>
33 </div>
34 <div class="leftnav-item ">
35 <a href="/docs/ssb/linking.html" title="Content-Hash Linking">Content-Hash Linking</a>
36 </div>
37 <div class="leftnav-item ">
38 <a href="/docs/ssb/secret-handshake.html" title="Secret Handshake: a secure channel protocol">Secret Handshake: a secure channel protocol</a>
39 </div>
40 <div class="leftnav-item ">
41 <a href="/docs/ssb/end-to-end-encryption.html" title="Private Box: metadata-free encryption">Private Box: metadata-free encryption</a>
42 </div>
43 <div class="leftnav-item ">
44 <a href="/docs/ssb/faq.html" title="Frequently Asked Questions">Frequently Asked Questions</a>
45 </div>
46 </div>
47 <div class="leftnav-item">API Documentation</div>
48 <div class="leftnav-subitems">
49 <div class="leftnav-item ">
50 <a href="/ssb-server/api.html" title="scuttlebot">scuttlebot</a>
51 </div>
52 <div class="leftnav-indent">
53 <div class="leftnav-item ">
54 <a href="/ssb-server/plugins/blobs.html" title="blobs">blobs</a>
55 </div>
56 <div class="leftnav-item ">
57 <a href="/ssb-server/plugins/block.html" title="block">block</a>
58 </div>
59 <div class="leftnav-item ">
60 <a href="/ssb-server/plugins/friends.html" title="friends">friends</a>
61 </div>
62 <div class="leftnav-item selected">
63 <a href="/ssb-server/plugins/gossip.html" title="gossip">gossip</a>
64 </div>
65 <div class="leftnav-item ">
66 <a href="/ssb-server/plugins/invite.html" title="invite">invite</a>
67 </div>
68 <div class="leftnav-item ">
69 <a href="/ssb-server/plugins/private.html" title="private">private</a>
70 </div>
71 <div class="leftnav-item ">
72 <a href="/ssb-server/plugins/replicate.html" title="replicate">replicate</a>
73 </div>
74 </div>
75 <div class="leftnav-item ">
76 <a href="/ssb-client" title="ssb-client">ssb-client</a>
77 </div>
78 <div class="leftnav-item ">
79 <a href="/ssb-feed" title="ssb-feed">ssb-feed</a>
80 </div>
81 <div class="leftnav-item ">
82 <a href="/ssb-keys" title="ssb-keys">ssb-keys</a>
83 </div>
84 <div class="leftnav-item ">
85 <a href="/ssb-msgs" title="ssb-msgs">ssb-msgs</a>
86 </div>
87 <div class="leftnav-item ">
88 <a href="/ssb-msg-schemas" title="ssb-msg-schemas">ssb-msg-schemas</a>
89 </div>
90 <div class="leftnav-item ">
91 <a href="/ssb-ref" title="ssb-ref">ssb-ref</a>
92 </div>
93 <div class="leftnav-item ">
94 <a href="/ssb-markdown" title="ssb-markdown">ssb-markdown</a>
95 </div>
96 <div class="leftnav-item ">
97 <a href="/patchwork-threads" title="patchwork-threads">patchwork-threads</a>
98 </div>
99 <div class="leftnav-item ">
100 <a href="/ssb-config" title="ssb-config">ssb-config</a>
101 </div>
102 <div class="leftnav-item ">
103 <a href="/secret-stack" title="secret-stack">secret-stack</a>
104 </div>
105 <div class="leftnav-item ">
106 <a href="/muxrpc" title="muxrpc">muxrpc</a>
107 </div>
108 <div class="leftnav-item ">
109 <a href="/muxrpcli" title="muxrpcli">muxrpcli</a>
110 </div>
111 <div class="leftnav-item ">
112 <a href="/mdmanifest" title="mdmanifest">mdmanifest</a>
113 </div>
114 <div class="leftnav-item ">
115 <a href="/docs/api/pull-stream.html" title="pull-stream">pull-stream</a>
116 </div>
117 </div>
118 <div class="leftnav-item">Articles</div>
119 <div class="leftnav-subitems">
120 <div class="leftnav-item ">
121 <a href="/docs/articles/design-challenge-avoid-centralization-and-singletons.html" title="Design Challenge: Avoiding Centralization and Singletons">Design Challenge: Avoiding Centralization and Singletons</a>
122 </div>
123 <div class="leftnav-item ">
124 <a href="/docs/articles/design-challenge-sybil-attack.html" title="Design Challenge: Sybil Attacks">Design Challenge: Sybil Attacks</a>
125 </div>
126 <div class="leftnav-item ">
127 <a href="/docs/articles/using-trust-in-open-networks.html" title="Using Trust in Open Networks">Using Trust in Open Networks</a>
128 </div>
129 </div>
130 </div>
131 <div id="content">
132 <h1 id="scuttlebot-gossip-plugin">scuttlebot gossip plugin</h1>
133<p>Schedule connections randomly with a peerlist constructed from config, multicast UDP announcements, feed announcements, and API-calls.</p>
134<h2 id="peers-sync">peers: sync</h2>
135<p>Get the current peerlist.</p>
136<pre><code class="lang-bash">peers
137</code></pre>
138<pre><code class="lang-js">peers(cb)
139</code></pre>
140<h2 id="add-sync">add: sync</h2>
141<p>Add an address to the peer table.</p>
142<pre><code class="lang-bash">add {addr}
143add --host {string} --port {number} --key {feedid}
144</code></pre>
145<pre><code class="lang-js">add(addr, cb)
146add({ host:, port:, key: }, cb)
147</code></pre>
148<ul>
149<li><code>addr</code> (address string): An address string, of the following format: <code>hostname:port:feedid</code>.</li>
150<li><code>host</code> (host string): IP address or hostname.</li>
151<li><code>port</code> (port number)</li>
152<li><code>key</code> (feedid)</li>
153</ul>
154<h2 id="connect-async">connect: async</h2>
155<p>Add an address to the peer table, and connect immediately.</p>
156<pre><code class="lang-bash">connect {addr}
157connect --host {string} --port {number} --key {feedid}
158</code></pre>
159<pre><code class="lang-js">connect(addr, cb)
160connect({ host:, port:, key: }, cb)
161</code></pre>
162<ul>
163<li><code>addr</code> (address string): An address string, of the following format: <code>hostname:port:feedid</code>.</li>
164<li><code>host</code> (host string): IP address or hostname.</li>
165<li><code>port</code> (port number)</li>
166<li><code>key</code> (feedid)</li>
167</ul>
168<h2 id="changes-source">changes: source</h2>
169<p>Listen for gossip events.</p>
170<pre><code class="lang-bash">changes
171</code></pre>
172<pre><code class="lang-js">changes()
173</code></pre>
174<p>Events come in the following forms:</p>
175<pre><code>{ type: &#39;discover&#39;, peer:, source: }
176{ type: &#39;connect&#39;, peer: }
177{ type: &#39;connect-failure&#39;, peer: }
178{ type: &#39;disconnect&#39;, peer: }
179</code></pre>
180 </div>
181 </div>
182 </body>
183 </html>

Built with git-ssb-web