<p>Hi gophers</p>
<p>I <em>was</em> a programmer (C++ and ADA95) then I stopped to do the sysadmin, now I am back with go. I find this language is perfect for sysadmins which wants to develop again. :)</p>
<p>Now one <strong>crazy</strong> idea popped up in my mind. </p>
<p>I want to write a daemon which:</p>
<ol>
<li>Listens on localhost/local interfaces with protocol NNTP acting as server.</li>
<li>Stores messages in the local filesystem (e.g.: zz.bau.miao will be /path/zz/bau/miao</li>
<li>Uses DHT/BEP to propagate the news. Any machine running this program will have the same data, with zero config.</li>
</ol>
<p>Now, for doing that, I can't develope everything by my own. So I need</p>
<ol>
<li>Some libraries for NNTP, for acting as a server, with examples.</li>
<li>Some libraries for DHT/BEP, to put the server into the network.</li>
<li>Some libraries to transfer single messages with UDP+DHT </li>
</ol>
<p>So everybody could just install the server on its own machine, set up Pan/Thunderbird/Whatever, wait a little, and having usenet in the laptop. No need of static address, no need of DNS, just run and go.</p>
<p>I found something, but:</p>
<ol>
<li>They are not so documented. It is really confusing to me , to understand how to use them. No examples or examples which only makes sense to the developer.</li>
<li>They are not so complete. Always in some beta state, missing this and that.</li>
</ol>
<p>Do you know any libraries with a decent documentation and good examples for DHT/BEP, NNTP , and filetransfer using UDP/DHT?</p>
<p>thanks in advance,</p>
<p>Uriel</p>
<hr/>**评论:**<br/><br/>Justinsaccount: <pre><p><a href="https://github.com/anacrolix/torrent/tree/master/dht" rel="nofollow">https://github.com/anacrolix/torrent/tree/master/dht</a></p></pre>HR-Uriel: <pre><p>This was the example i needed to explain the problem: code, code, code, no documentation and no example.</p>
<p>So, actually, just bytes.</p>
<blockquote>
<p>code, code, code everywhere </p>
<p>and not a single byte to use...</p>
</blockquote></pre>Justinsaccount: <pre><p>The repo is full of examples and test cases.</p></pre>nuunien: <pre><p>I prefer <a href="https://godoc.org/github.com/anacrolix/torrent/dht" rel="nofollow">godoc</a> myself, but <a href="https://sourcegraph.com/github.com/anacrolix/torrent@master/.godoc/dht" rel="nofollow">sourcegraph</a> also provides usage examples.</p></pre>HR-Uriel: <pre><p>Ok, so. </p>
<p>Either I am missing something or you all have something in mind <strong>and I don't get it</strong>. Since usually there is nothing like "everybody else is in the wrong lane", then the one in the wrong lane is me.</p>
<p>In all the links you provided (thank you), I see code. But I don't see anything about "what the functions are doing exactly", neither how to use them, like an "example".</p>
<p>Now, what I call an "example" is that:</p>
<p><a href="https://github.com/nictuku/dht/blob/master/examples/find_infohash_and_wait/main.go" rel="nofollow">dht example</a></p>
<p>this <em>example</em> shows me how to use the dht libraries from nictuku. Because it gives me an example of how to use.</p>
<p>I see you <em>all</em> are saying your repositories are <strong>full of examples</strong>. So... <em>it has to be <strong>me</strong> unable to find them</em>.</p>
<p>Given what an example is, could you provide where is the example, exactly, in the links you posted? </p>
<p>I start suspecting I am the one in the wrong lane, but I can't get why...</p></pre>nuunien: <pre><p>When browsing the generated documentation with sourcegraph, references to pieces of code that call those methods are specified, you can basically take these as examples. You can even click the method name, which takes you to the source code, click the method name again and you're shown examples of calling that specific method/function.</p></pre>HR-Uriel: <pre><p>Aaahhh. Got it. Thanks. :) :) </p>
<p>As usual, when you feel like everybody else is in the wrong lane, the one in the wrong lane is you. :) </p>
<p>I'm getting classic.</p></pre>anacrolix: <pre><p>Sorry I forgot to cleanup the DHT package public interface. Feel free to contact me.</p>
<p>Edit: It's now cleaned. <a href="http://godoc.org/github.com/anacrolix/torrent/dht" rel="nofollow">http://godoc.org/github.com/anacrolix/torrent/dht</a></p></pre>HR-Uriel: <pre><p>Hi </p>
<p>thank you very much. </p>
<p>So I am now in the "paper and stencil" phase, since I need to simplify the idea. This is because I also work and I also have a family, so I cannot code so much. Then I decided to use NNTP to transfer the contents , instead of another file sharing protocol.</p>
<p>I will basically write 4 components:</p>
<p>first, the dht component:</p>
<ul>
<li>dht : using the dht library, the server will be able to find other peers.</li>
</ul>
<p>then the second component, NNTP</p>
<ul>
<li>NNTP client: once another peer is found, using NNTP it will upload new contents and download from the peer.</li>
<li>NNTP server: interface to the user's client and to the peers, in order to exchange messages and groups.</li>
</ul>
<p>and the thirtd module, UpNP</p>
<ul>
<li>It will try to open port 11119 on the router (nntp) and some UDP port for dht.</li>
</ul>
<p>So basically i plan to have 4 threads :</p>
<ul>
<li>Upnp opening the router</li>
<li>hdt looking for peers</li>
<li>nntp listening </li>
<li>an infinite loop spreading/downloading new messages and groups to all the known peers, using NNTP client. </li>
</ul>
<p>i think this is enough to keep me busy in the spare time. :) :)</p>
<p>I started the empty repo here:</p>
<p><a href="https://github.com/uriel-fanelli/averno" rel="nofollow">https://github.com/uriel-fanelli/averno</a> just with a placeholder, I will continue from home, where I have the compiler.</p></pre>Zilog8: <pre><p><a href="https://github.com/nictuku/dht" rel="nofollow">https://github.com/nictuku/dht</a></p>
<p>An example of it's use:
<a href="https://github.com/jackpal/Taipei-Torrent" rel="nofollow">https://github.com/jackpal/Taipei-Torrent</a></p></pre>HR-Uriel: <pre><p>Yes this is the only library with an understandable example.</p>
<p>thank you. </p></pre>shazow: <pre><p>Check out <a href="https://github.com/jbenet/ipfs" rel="nofollow">https://github.com/jbenet/ipfs</a>, too. Not NNTP but a lot of similar goals, and then some. The primary implementation is in go: <a href="https://github.com/jbenet/go-ipfs" rel="nofollow">https://github.com/jbenet/go-ipfs</a></p></pre>HR-Uriel: <pre><p>Uhm... so this could help to share the hierarchy and align the spool. </p>
<p>What is the difference between this and btsync, or syncthing, exactly?</p></pre>shazow: <pre><p>It's a superset, more of a general protocol that you can use to implement whatever data layouts you'd like. One of the basic use cases is, indeed, a file sync thing.</p>
<p>They're further building a p2p file replication startup on top of this protocol: <a href="http://filecoin.io/" rel="nofollow">http://filecoin.io/</a></p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传