Diff: [root] @ 36f80ecf43f | faq | css

Replaced hexes with crockford

File created: hellnet/hspawn/hackage [Diff]

-- /dev/null++ b/hellnet/hspawn/hackage
@@ -1 +1,34 @@
h1. How to set up distributed "Hackage":http://hackage.haskell.org/packages/hackage.html mirror using Hellnet

1. [[build|Install Hellnet]]

2. Generate yourself a meta key

bc. % hell-meta genkey
Your key ID is 1HZYTR77ETSZBRVGCERFK48JHTR90HGPJPHEQJGHWKV280K0Q4J2116XBTR8YSZW49FCTTT4CRBYZGR0534RCQ1EMN5TEQFNCGG6RWN
% hell-meta alias add hackey 1HZYTR77ETSZBRVGCERFK48JHTR90HGPJPHEQJGHWKV280K0Q4J2116XBTR8YSZW49FCTTT4CRBYZGR0534RCQ1EMN5TEQFNCGG6RWN

3. Set up a Hackage mirror in a directory: see [[/howto/setup-hackage-mirror|this howto]] for instructions.

4. Share this directory as a meta:

bc. % hell-dir push . hackey hackage
<...>
Updating meta...
Success

5. Use this meta link to serve directory via HTTP or share it with others: hell://meta/1HZYTR77ETSZBRVGCERFK48JHTR90HGPJPHEQJGHWKV280K0Q4J2116XBTR8YSZW49FCTTT4CRBYZGR0534RCQ1EMN5TEQFNCGG6RWN/hackage

bc. % hell-serve-meta 8888 hell://meta/1HZYTR77ETSZBRVGCERFK48JHTR90HGPJPHEQJGHWKV280K0Q4J2116XBTR8YSZW49FCTTT4CRBYZGR0534RCQ1EMN5TEQFNCGG6RWN/hackage

This command will launch a HTTP server on port 8888 that will serve specified meta as file tree. You may want to add -b 127.0.0.1 and -b6 :: to restrict connections to localhost.

Now you can add this location to your Cabal config:

bc. % echo "remote-repo: localhost:http://localhost:8887" >> ~/.cabal/config
% cabal update

That's all! Now you can install packages from hackage mirror.

The reference Hackage mirror is run at [hell://meta/2RMW5V0ZXWGS1NAXEY14WJ4M7MZV736AGTN4PA5CQ14WVED2K5HT8RS2R1V59RYK37B604ZN11TAKG63FNAH36D3C1PFTFQPCF1YCRX/hackage]

File: hellnet/hspawn/use [Diff]

-- a/hellnet/hspawn/use++ b/hellnet/hspawn/use
@@ -19,18 +19,18 @@
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?name=COPYING hell://file/V1WV9NNGB2G4MM6565PG5NFK6KY3AYDASETR48WD3FHRC1XH68KB0M3AD7GTGZ1BY4AHGGYKDRR05FK0KJYH2919QP07X0GA9T2EZ9?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?name=COPYING&key=9f85e591452b21f9390bc75a5bb016da4a73a13e58e7649bc9a748c4a80b49cf hell://file/2ED6JC1KW83QZ4GZ5QCN8Y1JZTQQK2JH9QCQEP8ZSEWPYXTFA2K2KRQBMBRG4MWF2DYFVPNNXXYM8JB4PRBXPTPDBHN4RT2HC598WH?name=COPYING&key=17W5WP8MAAS1Z4WGQHTTBER1DPJAEEGKWP77CJDWK9T8RJM0PJEF

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?name=COPYING2&key=9f85e591452b21f9390bc75a5bb016da4a73a13e58e7649bc9a748c4a80b49cf" "hell://file/2ED6JC1KW83QZ4GZ5QCN8Y1JZTQQK2JH9QCQEP8ZSEWPYXTFA2K2KRQBMBRG4MWF2DYFVPNNXXYM8JB4PRBXPTPDBHN4RT2HC598WH?name=COPYING2&key=17W5WP8MAAS1Z4WGQHTTBER1DPJAEEGKWP77CJDWK9T8RJM0PJEF"
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:
@@ -47,7 +47,7 @@

Then he can type as well:

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

And after short wait read the text of GPL.


@@ -61,11 +61,11 @@

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

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 18GDRMNGGZS1T7HT8WP0G4N77Z5J1A2DMB0EQDGJZY3GTPE9MAECRZMQ84X2MQ4PRD304MNDA60T5PWNMY2Q094XZHSAEDH6MFY479

Now you can refer to your key as "testkey"

@@ -75,7 +75,7 @@

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

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


@@ -85,14 +85,14 @@
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" "hell://file/1M91REN6AP7N3S18MZRD842QBBH17NMA9C9QMCP0TVJA6BKMRXVXTWY9NKBK6G427VX7J4Q8HFF5Q0WHZ8DMSW60K5FY46Q5FEW4QHF"
}

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

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

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

@@ -103,9 +103,9 @@

or

bc. hell-dir push . hell://8da7ec91e46c4b1444bd1b1a151a038a0544fad23266111a8a84178efb9499cb756a265bbe456bd9ec9ba309bf146f8453ba17201ff968e181e36b5efe54fc1f/mydir hell://26TFV4HWHP4P524QMDHM58T0E50AH7TT8S6C48THA21F3QVJJCWPXBA4SDVWHBBV7P9Q8R9QWA6Z12KQ8BJ07ZSD3GR3RVBBVZ59Z0Z/mydir

Publishes current directory as hell://meta/mydir. hell://meta/26TFV4HWHP4P524QMDHM58T0E50AH7TT8S6C48THA21F3QVJJCWPXBA4SDVWHBBV7P9Q8R9QWA6Z12KQ8BJ07ZSD3GR3RVBBVZ59Z0Z/mydir. You can also add ?key=abcdef ?key=ABCDEF to URI in second example to encrypt meta contents.

bc. hell-dir pull . mykey mydir

@@ -113,7 +113,7 @@

If you have directory published, you can serve it via HTTP using hell-serve-meta:

bc. hell-serve-meta 8887 hell://meta/8da7ec91e46c4b1444bd1b1a151a038a0544fad23266111a8a84178efb9499cb756a265bbe456bd9ec9ba309bf146f8453ba17201ff968e181e36b5efe54fc1f/mydir hell://meta/26TFV4HWHP4P524QMDHM58T0E50AH7TT8S6C48THA21F3QVJJCWPXBA4SDVWHBBV7P9Q8R9QWA6Z12KQ8BJ07ZSD3GR3RVBBVZ59Z0Z/mydir

Here 8887 is port on which it will listen.

File: hellnet/protocols/http/index [Diff]

-- a/hellnet/protocols/http/index++ b/hellnet/protocols/http/index
@@ -1,12 +1,12 @@
h1. Hellnet HTTP interfaces

Peers are passing queries via HTTP queries (like GET /chunks/0a/04588fab48f /chunks/AZ/123456 or POST /insert with data piece).

h2. Query types

|_. Query |_. Path |_. Static/dynamic |_. Description |
| GET | @/chunks/([0-9a-f]+)@ @/chunks/([0-9A-Z]+)@ | static | [[/hellnet/tech/chunk|Chunk]] with hash $1 |
| GET | @^hell://meta/([0-9a-f]{64})/([^/]+)/(.*)(/.*)$@ @^hell://meta/([0-9A-Z]{102})/([^/]+)/(.*)(/.*)$@ | static | [[../tech/metatrees|Metatree]] of key $1 and name $2 |
| GET, HEAD | @/hello@ | static | Check whether node is up |
| POST | @/handshake@ | dynamic | Establish a link to node |

File: hellnet/protocols/http/meta [Diff]

-- a/hellnet/protocols/http/meta++ b/hellnet/protocols/http/meta
@@ -6,7 +6,7 @@

h2. Requests

h3. GET @/meta/([0-9a-f]+)/([^/]+)@ @/meta/([0-9A-Z]{102})/([^/]+)@

h4. Parameters



@@ -20,13 +20,13 @@

Metatree link, its date and signature. Example:

h5. GET /meta/7c6578116..32d539/test /meta/FHJQG4B...35N9S/test

bc. {
"updated" : 1258639915,
"key" : "hell://chunk/22fea70fde222e2463b1dd716fa9f7faf75d90ebc6517333643826348c05950021fd2a2b31dcb23c1971149adf952bd1f38763b2338708acd12e97823a5017d2?key=a1234567", "hell://chunk/HFX9RFVRH2W933P7EQ2VX9YZXFEQCGXF352WSKCGW2CD4C0PAG08FX58NK3Q5J7GCQ254TVYAJQMFKGXHV4CW712PD2BMQG8X505YJ?key=2GJ6HB7",
"name" : "test"
"content" : "hell://chunk/e4dfde12d6612f9816d1e924c274689e5236af74db23d14cf76bee0fc49690398f1c32bce9db951305a62906c4344c04a5682b1c6bdf64e219c2dde2810b44da" "hell://chunk/3JDZQGJTSGJZ60PT7MJ9GKMD2F54DNFEKDJ7MACYXNYW3Y4JT83K3RW6AYEKPWN2C2TCA86RGT4R155D0NHRTYZCKH1KGPXWA0GPH6T"
}
<empty line>
<RSA binary signature data>

File: hellnet/tech/URIs/chunk [Diff]

-- a/hellnet/tech/URIs/chunk++ b/hellnet/tech/URIs/chunk
@@ -2,7 +2,7 @@

h2. Regex

@^hell://chunk/([0-9a-f]{64})$@

@^hell://chunk/([A-Z0-9]{102})$@

$1: chunk hash

File: hellnet/tech/URIs/file [Diff]

-- a/hellnet/tech/URIs/file++ b/hellnet/tech/URIs/file
@@ -2,7 +2,7 @@

h2. Regex

@^hell://file/([0-9a-f]{64})$@

@^hell://file/([0-9A-Z]{102})$@

$1: chunk hash

File: hellnet/tech/URIs/meta [Diff]

-- a/hellnet/tech/URIs/meta++ b/hellnet/tech/URIs/meta
@@ -2,7 +2,7 @@

h2. Regex

@^hell://meta/([0-9a-f]{64})/([^/]+)/(.*)(/.*)$@

@^hell://meta/([0-9A-Z]{102})/([^/]+)/(.*)(/.*)$@

$1: public key hash
$2: meta name

File: hellnet/tech/metatrees [Diff]

-- a/hellnet/tech/metatrees++ b/hellnet/tech/metatrees
@@ -4,13 +4,13 @@

Example of metatree:

This would be stored in ./meta/22fea70fde222e2463b1dd716fa9f7faf75d90ebc6517333643826348c05950021fd2a2b31dcb23c1971149adf952bd1f38763b2338708acd12e97823a5017d2/test ./meta/HFX9RFVRH2W933P7EQ2VX9YZXFEQCGXF352WSKCGW2CD4C0PAG08FX58NK3Q5J7GCQ254TVYAJQMFKGXHV4CW712PD2BMQG8X505YJ/test

bc. {
"updated" : 1258639915,
"key" : "22fea70fde222e2463b1dd716fa9f7faf75d90ebc6517333643826348c05950021fd2a2b31dcb23c1971149adf952bd1f38763b2338708acd12e97823a5017d2", "HFX9RFVRH2W933P7EQ2VX9YZXFEQCGXF352WSKCGW2CD4C0PAG08FX58NK3Q5J7GCQ254TVYAJQMFKGXHV4CW712PD2BMQG8X505YJ",
"name" : "test"
"content" : "hell://chunk/e4dfde12d6612f9816d1e924c274689e5236af74db23d14cf76bee0fc49690398f1c32bce9db951305a62906c4344c04a5682b1c6bdf64e219c2dde2810b44da" "hell://chunk/3JDZQGJTSGJZ60PT7MJ9GKMD2F54DNFEKDJ7MACYXNYW3Y4JT83K3RW6AYEKPWN2C2TCA86RGT4R155D0NHRTYZCKH1KGPXWA0GPH6T"
}
<empty line>
<binary RSA signature>


@@ -22,13 +22,13 @@
"name" : name of this meta
"content" : link to meta tree

That would be stored under URI hell://chunk/e4dfde12d6612f9816d1e924c274689e5236af74db23d14cf76bee0fc49690398f1c32bce9db951305a62906c4344c04a5682b1c6bdf64e219c2dde2810b44da: hell://chunk/3JDZQGJTSGJZ60PT7MJ9GKMD2F54DNFEKDJ7MACYXNYW3Y4JT83K3RW6AYEKPWN2C2TCA86RGT4R155D0NHRTYZCKH1KGPXWA0GPH6T:

bc. {
"helloworld" : "hell://file/18895861928ce6793b3386d0fccacfcca35b2aa845fc895f06013fbac50ef9cbf1f77352f041b3f82fbce109b209cd09ff763d2a95c0eba2a21967dbe32f39e5", "hell://file/C8JP31JA6ECY9V6E3D1Z6ASZ6A6PSAN12ZS2AZ0R0KZEP51VWWQWFQED9F0GDKZ0QVSR89P84WT2FZERYJN5E0XEHA46B7VFHJYEF5",
"hellodir" : {
"file1" : "hell://file/7c657811658adf5d5f77bf571270a8ad242ed454fb353ff90f6ad6248edcba14fd155b8a78ad9af53fc4a58dd10464295322655ade5264598a7b5e537032d539", "hell://file/1Y6AY0HCP5DYQAZEYZNE4KGN2PJ8BPMAKXKAFZS1XNDC94EVJX19Z8NBE57HBCTYMZW99CDT4268AAK49JNNQJJCHCRMYTYADR35N9S",
"file2" : "hell://file/2fc800b58bf1903d8b98a007f301d4e59baf69f9e60609e00e4cfa0c6f8307ff8abb2155c8ff2642eb687b296c99ca95ae49e322ef3f95eadddada011149e737" "hell://file/QWG05NHFRS0FCBK2G0FWR1TKJSQBV9Z7K0C2F01S6FM33FGC3ZZ2NV45AWHZS68BNPGYS9DJCWN5DE97HJ5VSZJQNDVPPT048MKSSQ"
}
}

By Voker57 on 2011-01-01 17:16:11 +0000