]> Cypherpunks.ru repositories - nncp.git/blob - doc/cmds.texi
Documentation updates
[nncp.git] / doc / cmds.texi
1 @node Commands
2 @unnumbered Commands
3
4 Nearly all commands have the following common options:
5
6 @table @code
7 @item -debug
8     Print debug messages. Normally this option should not be used.
9 @item -nice
10     Set desired outgoing packet niceness level. 1-255 values are
11     allowed. Higher value means lower priority. In some commands that
12     means processing of packets that have equal or lower nice value.
13     That is used for controlling network QoS.
14 @item -node
15     Process only single specified node.
16 @item -quiet
17     Print only errors, omit simple informational messages. In any case
18     those messages are logged, so you can reread them using
19     @ref{nncp-log} command.
20 @item -version
21     Print version information.
22 @item -warranty
23     Print warranty information (no warranty).
24 @end table
25
26 @node nncp-call
27 @section nncp-call
28
29 @verbatim
30 % nncp-call [options] [-rx|-tx] NODE[:ADDR] [FORCEADDR]
31 @end verbatim
32
33 Call (connect to) specified @code{NODE} and run @ref{Sync,
34 synchronization} protocol with the @ref{nncp-daemon, daemon} on the
35 remote side. Normally this command could be run any time you wish to
36 either check for incoming packets, or to send out queued ones.
37 Synchronization protocol allows resuming and bidirectional packets
38 transfer.
39
40 If @code{-rx} option is specified then only inbound packets transmission
41 is performed. If @code{-tx} option is specified, then only outbound
42 transmission is performed.
43
44 Each @code{NODE} can contain several uniquely identified
45 @code{ADDR}esses in @ref{Configuration, configuration} file. If you do
46 not specify the exact one, then all will be tried until the first
47 success. Optionally you can force @code{FORCEADDR} address usage,
48 instead of addresses taken from configuration file.
49
50 Pay attention that this command run integrity check for each completely
51 received packet in the background. This can be time consuming and
52 connection could be lost during that check time and remote node won't be
53 notified that file is done. But after successful integrity check that
54 file will be renamed from @code{.part} one and when you rerun
55 @code{nncp-call} again, remote node will receive completion at once.
56
57 @node nncp-check
58 @section nncp-check
59
60 @verbatim
61 % nncp-check [options]
62 @end verbatim
63
64 Perform @ref{Spool, spool} directory integrity check. Read all files
65 that has Base32-encoded filenames and compare it with recalculated
66 BLAKE2b hash output of their contents. This supplementary command should
67 not be used often in practice, if ever.
68
69 @node nncp-daemon
70 @section nncp-daemon
71
72 @verbatim
73 % nncp-daemon [options] [-maxconn INT] [-bind ADDR]
74 @end verbatim
75
76 Start listening TCP daemon, wait for incoming connections and run
77 @ref{Sync, sync protocol} with each of them. You can run @ref{nncp-toss}
78 utility in background to process inbound packets from time to time.
79
80 @code{-maxconn} option specifies how many simultaneous clients daemon
81 can handle. @code{-bind} option specifies @code{addr:port} it must bind
82 to and listen.
83
84 @node nncp-file
85 @section nncp-file
86
87 @verbatim
88 % nncp-file [options] SRC NODE:[DST]
89 @end verbatim
90
91 Send @code{SRC} file to remote @code{NODE}. @code{DST} specifies
92 destination file name in remote's @ref{Configuration, incoming}
93 directory. If this file already exists there, then counter will be
94 appended to it.
95
96 This command queues file in @ref{Spool, spool} directory immediately
97 (through the temporary file of course) -- so pay attention that sending
98 2 GiB file will create 2 GiB outbound encrypted packet.
99
100 If @ref{Configuration, notification} is enabled on the remote side for
101 file transmissions, then it will sent simple letter after successful
102 file receiving.
103
104 @node nncp-freq
105 @section nncp-freq
106
107 @verbatim
108 % nncp-freq [options] NODE:SRC DST
109 @end verbatim
110
111 Send file request to @code{NODE}, asking it to send its @code{SRC} file
112 from @ref{Configuration, freq} directory to our node under @code{DST}
113 filename in our @ref{Configuration, incoming} one.
114
115 If @ref{Configuration, notification} is enabled on the remote side for
116 file request, then it will sent simple letter after successful file
117 queuing.
118
119 @node nncp-log
120 @section nncp-log
121
122 @verbatim
123 % nncp-log [options]
124 @end verbatim
125
126 Parse @ref{Log, log} file and print out its records in human-readable form.
127
128 @node nncp-mail
129 @section nncp-mail
130
131 @verbatim
132 % nncp-mail [options] NODE USER ...
133 @end verbatim
134
135 Send mail, that is read from stdin, to @code{NODE} and specified
136 @code{USER}s. Mail message will be compressed. After receiving, remote
137 side will execute specified @ref{Configuration, sendmail} command with
138 @code{USER}s appended as a command line argument and feed decompressed
139 mail body to that command's stdin.
140
141 @node nncp-newnode
142 @section nncp-newnode
143
144 @verbatim
145 % nncp-newnode [options] > mynewnode.yaml
146 @end verbatim
147
148 Generate new node: private keys, example configuration file and print it
149 to stdout. You must use this command when you setup the new node.
150
151 Pay attention that private keys generation consumes an entropy from your
152 operating system.
153
154 @node nncp-pkt
155 @section nncp-pkt
156
157 @verbatim
158 % nncp-pkt [options] < pkt
159 % nncp-pkt [options] -dump < pkt > payload
160 @end verbatim
161
162 Low level packet parser. Normally it should not be used, but can help in
163 debugging.
164
165 By default it will print packet's type, for example:
166 @verbatim
167 Packet type: encrypted
168 Niceness: 64
169 Sender: 2WHBV3TPZHDOZGUJEH563ZEK7M33J4UESRFO4PDKWD5KZNPROABQ
170 Payload size: 4.0 MiB (4162852 bytes)
171 @end verbatim
172
173 If you specify @code{-dump} option and provide an @ref{Encrypted,
174 encrypted} packet, then it will verify and decrypt it to stdout.
175 Encrypted packets contain @ref{Plain, plain} ones, that also can be fed
176 to @code{nncp-pkt}:
177
178 @verbatim
179 Packet type: plain
180 Payload type: transitional
181 Path: VHMTRWDOXPLK7BR55ICZ5N32ZJUMRKZEMFNGGCEAXV66GG43PEBQ
182
183 Packet type: plain
184 Payload type: mail
185 Path: stargrave@stargrave.org
186 @end verbatim
187
188 And with the @code{-dump} option it will give you the actual payload
189 (the whole file, mail message, and so on).
190
191 @node nncp-stat
192 @section nncp-stat
193
194 @verbatim
195 % nncp-stat [options]
196 @end verbatim
197
198 Print current @ref{Spool, spool} statistics about unsent and unprocessed
199 packets. For each node and each niceness level there will be printed how
200 many packets (with the total size) are in inbound (Rx) and outbound (Tx)
201 queues.
202
203 @node nncp-toss
204 @section nncp-toss
205
206 @verbatim
207 % nncp-toss [options] [-dryrun]
208 @end verbatim
209
210 Perform "tossing" operation on all inbound packets. This is the tool
211 that decrypts all packets and processes all payload packets in them:
212 copies files, sends mails, sends out file requests and relays transition
213 packets. It should be run after each online/offline exchange.
214
215 @code{-dryrun} option does not perform any writing and sending, just
216 tells what it will do.
217
218 @node nncp-xfer
219 @section nncp-xfer
220
221 @verbatim
222 % nncp-xfer [options] [-force] [-keep] [-rx|-tx] DIR
223 @end verbatim
224
225 Search for directory in @code{DIR} containing inbound packets for us and
226 move them to local @ref{Spool, spool} directory. Also search for known
227 neighbours directories and move locally queued outbound packets to them.
228 This command is used for offline packets transmission.
229
230 If @code{-force} option is specified, then outbound neighbour(s)
231 directories will be created. This is useful for the first time usage,
232 when storage device does not have any directories tree.
233
234 If @code{-keep} option is specified, then keep copied files, do not
235 remove them.
236
237 @code{-rx} option tells only to move inbound packets addressed to us.
238 @code{-tx} option tells exactly the opposite: move only outbound packets.
239
240 @code{DIR} directory has the following structure:
241 @code{RECIPIENT/SENDER/PACKET}, where @code{RECIPIENT} is Base32 encoded
242 destination node, @code{SENDER} is Base32 encoded sender node.