]> Cypherpunks.ru repositories - nncp.git/blob - doc/spool.texi
61ec8c3513928fbb13eb33941382e5edab309c19
[nncp.git] / doc / spool.texi
1 @node Spool
2 @unnumbered Spool directory
3
4 Spool directory holds @ref{Encrypted, encrypted packets} received from
5 remote nodes and queued for sending to them. It has the following
6 example structure with just single outbound (@code{tx}) packet
7 @code{LYT64MWSNDK34CVYOO7TA6ZCJ3NWI2OUDBBMX2A4QWF34FIRY4DQ} to the node
8 @code{2WHBV3TPZHDOZGUJEH563ZEK7M33J4UESRFO4PDKWD5KZNPROABQ}:
9
10 @example
11 spool/2WHBV3TPZHDOZGUJEH563ZEK7M33J4UESRFO4PDKWD5KZNPROABQ/toss.lock
12 spool/2WHBV3TPZHDOZGUJEH563ZEK7M33J4UESRFO4PDKWD5KZNPROABQ/rx.lock
13 spool/2WHBV3TPZHDOZGUJEH563ZEK7M33J4UESRFO4PDKWD5KZNPROABQ/rx/
14 spool/2WHBV3TPZHDOZGUJEH563ZEK7M33J4UESRFO4PDKWD5KZNPROABQ/tx.lock
15 spool/2WHBV3TPZHDOZGUJEH563ZEK7M33J4UESRFO4PDKWD5KZNPROABQ/tx/LYT64MWSNDK34CVYOO7TA6ZCJ3NWI2OUDBBMX2A4QWF34FIRY4DQ
16 spool/tmp
17 @end example
18
19 @table @file
20
21 @item tmp
22 directory contains various temporary files that under normal
23 circumstances are renamed to necessary files inside other directories.
24 All directories in @file{spool} @strong{have to} be on the same
25 filesystem for working renaming.
26
27 @item 2WHBV3TPZHDOZGUJEH563ZEK7M33J4UESRFO4PDKWD5KZNPROABQ
28 is an example Base32-encoded neighbour identifier.
29
30 @item rx, tx
31 directories are for incoming and outgoing encrypted packets. @file{rx}
32 contains currently unfinished, non-checked, unprocessed, etc packets.
33
34 @item toss.lock, rx.lock, tx.lock
35 Lock files. Only single process can work with @file{rx}/@file{tx}
36 directories at once.
37
38 @item LYT64MWSNDK34CVYOO7TA6ZCJ3NWI2OUDBBMX2A4QWF34FIRY4DQ
39 is an example @ref{Encrypted, encrypted packet}. Its filename is Base32
40 encoded @ref{MTH} hash of the whole contents. It can be integrity checked
41 anytime.
42
43 @item LYT64MWSNDK34CVYOO7TA6ZCJ3NWI2OUDBBMX2A4QWF34FIRY4DQ.part
44 is an example @strong{partly} received file. It can appear only when
45 online transfer is used. Its filename is sent by remote side and until
46 file is fully downloaded -- it plays no role.
47
48 @item LYT64MWSNDK34CVYOO7TA6ZCJ3NWI2OUDBBMX2A4QWF34FIRY4DQ.nock
49 non-checksummed (NoCK) @strong{fully} received file. Its checksum is
50 verified against its filename either by @ref{nncp-check}, or by working
51 online daemons. If it is correct, then its extension is trimmed.
52
53 @item seen/LYT64MWSNDK34CVYOO7TA6ZCJ3NWI2OUDBBMX2A4QWF34FIRY4DQ
54 @ref{nncp-toss} utility can be invoked with @option{-seen} option,
55 leading to creation of @file{seen/} files, telling that the file with
56 specified hash has already been processed before. It could be useful
57 when there are use-cases where multiple ways of packets transfer
58 available and there is possibility of duplicates reception. You have to
59 manually remove them, when you do not need them (probably because they
60 are expired).
61
62 @anchor{HdrFile}
63 @item hdr/LYT64MWSNDK34CVYOO7TA6ZCJ3NWI2OUDBBMX2A4QWF34FIRY4DQ
64 If no @ref{CfgNoHdr, nohdr} option is enabled in configuration file,
65 then @file{hdr/} files are automatically created for every ordinary
66 (fully received and checksummed) packet. It literally contains just the
67 header of the corresponding packet. It will be automatically created
68 even during simple @ref{nncp-stat} call. On filesystems with big
69 blocksize (ZFS for example) it can greatly help listing the packets in
70 directories, because it prevents unnecessary read-amplification. On
71 other filesystems probably it won't help at all, or even harm
72 performance.
73
74 There is a hack: you can create more dense @file{hdr/} allocation by
75 removing all @file{hdr/} files and then running @command{nncp-stat},
76 that will recreate them. In many cases many @file{hdr/} files will be
77 allocated more or less linearly on the disk, decreasing listing time
78 even more.
79
80 @end table