Diff: [root] @ d4717ef115d | faq | css

More hellnet updates

File: hellnet/hspawn/use [Diff]

diff --git a/hellnet/hspawn/use b/hellnet/hspawn/use
index f0152ef..e4d52a1 100644
-- a/hellnet/hspawn/use
++ b/hellnet/hspawn/use
@@ -1,10 +1,8 @@
h1. Usage of Hellnet

Currently, the only thing Hellnet can do is file storage

*WARNING: This part contains much unsettled stuff and retrieval.

h2. How it works interfaces that can be not convenient to use yet. This will change.*

h3. Data Simple data storage

All the data in Hellnet is stored in 64kb chunks. You can see your current cache in ~/.hellnet/store.

@@ -20,39 +18,89 @@ h2. Action!

So, let's assume you need to share a copy of GPL[2]. It's named COPYING and located in current folder. Here you go:

bc. % hell-insert COPYING
COPYING: hell://file/361e6d35ac16281294314c5b40b57ccd3f0d5e6ab2ed6088e346f8e181ec4c89ac141a9a786a1f0afc454610f4db8c00af98272f44490a6f601fa08293a13be9/COPYING hell://file/361e6d35ac16281294314c5b40b57ccd3f0d5e6ab2ed6088e346f8e181ec4c89ac141a9a786a1f0afc454610f4db8c00af98272f44490a6f601fa08293a13be9?name=COPYING

Hellnet *inserts* the file in local storage and gives you a link to the file. You might as well request to encrypt the file, to protect your privacy:

bc. % hell-insert -e COPYING
COPYING: hell://file/04e69a4c0cf881dfe487cb76551e0cbfabde629453765dd647f2ee5bddd3d4298a78bae8bc4094e3c4df3f76ad7bdf5112592d85f6dab3571a931a145854a391.9f85e591452b21f9390bc75a5bb016da4a73a13e58e7649bc9a748c4a80b49cf/COPYING hell://file/04e69a4c0cf881dfe487cb76551e0cbfabde629453765dd647f2ee5bddd3d4298a78bae8bc4094e3c4df3f76ad7bdf5112592d85f6dab3571a931a145854a391?name=COPYING&key=9f85e591452b21f9390bc75a5bb016da4a73a13e58e7649bc9a748c4a80b49cf

Link here consists of three or two parts, first is hash, second is encryption key. Third may be the file name. If you are using a link without filename, contents will be printed to STDOUT.

You can test how file is inserted then:

bc. % hell-get hell://file/04e69a4c0cf881dfe487cb76551e0cbfabde629453765dd647f2ee5bddd3d4298a78bae8bc4094e3c4df3f76ad7bdf5112592d85f6dab3571a931a145854a391.9f85e591452b21f9390bc75a5bb016da4a73a13e58e7649bc9a748c4a80b49cf/COPYING.2 "hell://file/04e69a4c0cf881dfe487cb76551e0cbfabde629453765dd647f2ee5bddd3d4298a78bae8bc4094e3c4df3f76ad7bdf5112592d85f6dab3571a931a145854a391?name=COPYING2&key=9f85e591452b21f9390bc75a5bb016da4a73a13e58e7649bc9a748c4a80b49cf"
diff COPYING COPYING.2

Now let's assume you have a friend who needs to receive a copy of GPL. First, you should bring up Hellnet server on your side:

bc. % hell-serve 12345 &

where 12345 is port on your machine which is open to the world.

Then, your friend should run:

bc. % hell-nodes add 123.12.1.0 12345

where *123.12.1.0* is *your* host and 12345 is *your* open port.

Then he can type as well:

bc. % hell-get hell://file/04e69a4c0cf881dfe487cb76551e0cbfabde629453765dd647f2ee5bddd3d4298a78bae8bc4094e3c4df3f76ad7bdf5112592d85f6dab3571a931a145854a391.9f85e591452b21f9390bc75a5bb016da4a73a13e58e7649bc9a748c4a80b49cf/COPYING "hell://file/04e69a4c0cf881dfe487cb76551e0cbfabde629453765dd647f2ee5bddd3d4298a78bae8bc4094e3c4df3f76ad7bdf5112592d85f6dab3571a931a145854a391?name=COPYING&key=9f85e591452b21f9390bc75a5bb016da4a73a13e58e7649bc9a748c4a80b49cf"

And after short wait read the text of GPL.

h2. Meta trees

[[/hellnet/tech/metatrees|Meta trees]] are tool to publish named information to Hellnet and keep it updated. Authenticity of information is guaranteed via digital signatures.

h3. Create a key

First step is to create your own key that will be used to sign content.

bc. % hell-meta genkey
Generating keys...
Your key ID is 02883714ac21fc87478e91cb0204a9cff2c82a1368b03aed84bfe1c3567268a7331fa5d04e8a9725b0d18094ab546068b6e569e15c09277f1ca9cd89a8ff10e9

This key ID is effectively public key's hash. It's rather long and hard to remember, so we can create client-side alias:

bc. % hell-meta alias add testkey 02883714ac21fc87478e91cb0204a9cff2c82a1368b03aed84bfe1c3567268a7331fa5d04e8a9725b0d18094ab546068b6e569e15c09277f1ca9cd89a8ff10e9

Now you can refer to your key as "testkey"

h3. Write a meta

Second step is editing your meta file. It's "JSON":http://json.org and represents a filesystem of Hellnet links. Let us add our homepage:

bc. % echo "<html>Hallo thar</html>" > index.html
% hell-insert index.html
hell://file/6890e1d532ac7a8f21453f86a082bad7109eb452589bd19606b7251973a63bbeeb9e4d66b99a0411f7d3c897445ef2dc1c8fd0da678604caff10d72bddc25e2f?name=index.html

OK, we got a helllink to our home page. Let's insert it into meta:

bc. % hell-meta new testkey homepage
% hell-meta edit testkey homepage

This will launch your favourite (or default) editor and open meta content in it. Editing, saving and exiting will overwrite meta content and update the meta. Let's write the following:

bc. {
"index.html" : "hell://file/6890e1d532ac7a8f21453f86a082bad7109eb452589bd19606b7251973a63bbeeb9e4d66b99a0411f7d3c897445ef2dc1c8fd0da678604caff10d72bddc25e2f"
}

Save & exit. Now you can get your homepage by these tricky commands:

bc. % hell-meta get testkey homepage /index.html
"hell://file/6890e1d532ac7a8f21453f86a082bad7109eb452589bd19606b7251973a63bbeeb9e4d66b99a0411f7d3c897445ef2dc1c8fd0da678604caff10d72bddc25e2f"
% hell-get hell://file/6890e1d532ac7a8f21453f86a082bad7109eb452589bd19606b7251973a63bbeeb9e4d66b99a0411f7d3c897445ef2dc1c8fd0da678604caff10d72bddc25e2f
<html>Hallo thar</html>

Other people can get it too, only using you key's real ID instead of "testkey".

h2. Discover more nodes

If you have already discovered at least one Hellnet node, you can use @hell-nodes discover@ to scan the net for more. All found nodes will be added to your nodelist.

fn1. Or run out of nodes

fn2. Which is the most seeded content on "GNUnet":http://gnunet.org
\ No newline at end of file

By Voker57 on 2010-02-20 01:07:16 +0300 Powered by bitcheese wiki engine