hydrus/help/getting_started_ipfs.html

60 lines
4.8 KiB
HTML
Raw Normal View History

2016-03-02 21:00:30 +00:00
<html>
<head>
<title>getting started - ipfs</title>
<link href="hydrus.ico" rel="shortcut icon" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="content">
<h3>ipfs</h3>
<p>IPFS is a p2p protocol that makes it easy to share many sorts of data. The hydrus client can communicate with an IPFS daemon to send and receive files.</p>
<p>You can read more about IPFS from <a href="http://ipfs.io">their homepage</a>, or <a href="https://medium.com/@ConsenSys/an-introduction-to-ipfs-9bba4860abd0">this guide</a> that explains its various rules in more detail.</p>
<p>For our purposes, we only need to know about these concepts:</p>
<ul>
<li><b>IPFS daemon</b> -- A running instance of the IPFS executable that can talk to the larger network.</li>
<li><b>IPFS multihash</b> -- An IPFS-specific identifier for a file or group of files.</li>
<li><b>pin</b> -- To tell our IPFS daemon to host a file.</li>
<li><b>unpin</b> -- To tell our IPFS daemon to stop hosting a file.</li>
</ul>
<h3>getting ipfs</h3>
<p>I have found the easiest way to run IPFS is to get the built executable <a href="https://gobuilder.me/github.com/ipfs/go-ipfs/cmd/ipfs?branch=release">here</a>. Scroll down a bit and pick the release for your platform. Inside should be a very simple 'ipfs' executable that does everything. Extract it somewhere and open up a terminal in the same folder, and then type:</p>
<ul>
<li>ipfs init</li>
<li>ipfs daemon</li>
</ul>
<p>The IPFS exe should now be running in that terminal, ready to respond to requests:</p>
<p><img src="ipfs_terminal.png" /></p>
<p>You can kill it with Ctrl+C and restart it with the 'ipfs daemon' call again (you only have to run 'ipfs init' once).</p>
<p>When it is running, opening <a href="http://127.0.0.1:8080/ipfs/QmfM2r8seH2GiRaC4esTjeraXEachRt8ZsSeGaWTPLyMoG">this page</a> should download and display an example 'Hello World!' file from <span class="dealwithit">~~~across the internet~~~</span>.</p>
<p>Your daemon listens for other instances of ipfs using port 4001, so if you know how to open that port in your firewall and router, make sure you do.</p>
<h3>connecting your client</h3>
<p>IPFS daemons are treated as services inside hydrus, so go to <i>services->manage services->remote->ipfs daemons</i> and add in your information. Hydrus uses the API port, default 5001, so you will probably want to use credentials of '127.0.0.1:5001'. You can click 'test credentials' to make sure everything is working.</p>
<p><img src="ipfs_services.png" /></p>
<p>Thereafter, you will get the option to 'pin' and 'unpin' from a thumbnail's right-click menu, like so:</p>
<p><img src="ipfs_pin.png" /></p>
<p>This works like hydrus's repository uploads--it won't happen immediately, but instead will be queued up at the pending menu. Commit all your pins when you are ready:</p>
<p><img src="ipfs_commit.png" /></p>
<p>Notice how the IPFS icon appears on your pending and pinned files. You can search for these files using 'system:file service'.</p>
<p>Unpin works the same as pin, just like a hydrus repository petition.</p>
<p>Right-clicking any pinned file will give you a new 'share' action:</p>
<p><img src="ipfs_multihash.png" /></p>
<p>Which will put it straight in your clipboard. In this case, it is QmP6BNvWfkNf74bY3q1ohtDZ9gAmss4LAjuFhqpDPQNm1S. <a href="http://127.0.0.1:8080/ipfs/QmP6BNvWfkNf74bY3q1ohtDZ9gAmss4LAjuFhqpDPQNm1S">See if I still have it pinned!</a></p>
<p>If you want to share a pinned file with someone, you have to tell them this multihash. They can then:</p>
<ul>
<li>View it through their own ipfs daemon's gateway, at http://127.0.0.1:8080/ipfs/[multihash]</li>
<li>View it through a public web gateway, such as the one the IPFS people run, at http://ipfs.io/ipfs/[multihash]</li>
<li>Download it through their ipfs-connected hydrus client by going <i>pages->new download popup->a file from ipfs</i>.</li>
</ul>
<p>I hope to support ipfs directories for more convenient mass-sharing in the near future!</p>
2016-03-09 19:37:14 +00:00
<h3>additional links</h3>
<p>If you find you use IPFS a lot, here are some add-ons for your web browser, as recommended by /tech/:</p>
<blockquote><i>
<p>This script changes all bare ipfs hashes into clickable links to the ipfs gateway (on page loads):</p>
<p><a href="https://greasyfork.org/en/scripts/14837-ipfs-hash-linker">https://greasyfork.org/en/scripts/14837-ipfs-hash-linker</a></p>
<p>These redirect all gateway links to your local daemon when it's on, it works well with the previous script:</p>
<p><a href="https://github.com/lidel/ipfs-firefox-addon">https://github.com/lidel/ipfs-firefox-addon</a></p>
<p><a href="https://github.com/dylanPowers/ipfs-chrome-extension">https://github.com/dylanPowers/ipfs-chrome-extension</a></p>
</i></blockquote>
2016-03-02 21:00:30 +00:00
</div>
</body>
</html>