blob: f002a78038f1d0a99e5b30a6a4a8661d1b471493 [file] [log] [blame]
Klaus Schneidere90a3582019-04-03 17:22:39 -07001ndnputchunks
2============
3
4Synopsis
5--------
6
Davide Pesaventof8a14d82021-03-12 00:42:03 -05007**ndnputchunks** [*option*]... *name*
Klaus Schneidere90a3582019-04-03 17:22:39 -07008
9Description
10-----------
11
Davide Pesaventof8a14d82021-03-12 00:42:03 -050012:program:`ndnputchunks` is a producer program that reads a file from the standard input
13and makes it available as NDN Data segments.
Klaus Schneidere90a3582019-04-03 17:22:39 -070014
Davide Pesaventof8a14d82021-03-12 00:42:03 -050015Version and segment number components are appended to the specified *name* as needed,
16according to the `NDN naming conventions`_.
Klaus Schneidere90a3582019-04-03 17:22:39 -070017
Davide Pesaventodb9613e2023-01-20 20:52:21 -050018.. _NDN naming conventions: https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
Klaus Schneidere90a3582019-04-03 17:22:39 -070019
20Options
21-------
22
23.. option:: -h, --help
24
25 Print help and exit.
26
27.. option:: -f, --freshness MILLISECS
28
Davide Pesavento7c4246c2021-03-12 01:35:22 -050029 FreshnessPeriod of the published Data packets, in milliseconds.
30 The default is 10000 (10 seconds).
Klaus Schneidere90a3582019-04-03 17:22:39 -070031
Klaus Schneidere90a3582019-04-03 17:22:39 -070032.. option:: -s, --size BYTES
33
Davide Pesavento7c4246c2021-03-12 01:35:22 -050034 Maximum chunk size, in bytes. The default is 8000 bytes.
Klaus Schneidere90a3582019-04-03 17:22:39 -070035
Davide Pesaventof8a14d82021-03-12 00:42:03 -050036.. option:: -N, --naming-convention CONVENTION
37
38 Select the convention used to encode NDN name components. The available choices are:
39
40 * ``marker`` (shorthand: ``m`` or ``1``) for the old marker-based encoding;
41 * ``typed`` (shorthand: ``t`` or ``2``) for the new encoding based on typed name components.
42
43 If this option is not specified, the ndn-cxx library's default is used.
44
Klaus Schneidere90a3582019-04-03 17:22:39 -070045.. option:: -S, --signing-info STRING
46
Davide Pesaventof8a14d82021-03-12 00:42:03 -050047 Specify the parameters used to sign the Data packets. If omitted, the default key
48 of the default identity is used. The general syntax is ``<scheme>:<name>``. The
49 most common supported combinations are as follows:
Klaus Schneidere90a3582019-04-03 17:22:39 -070050
Davide Pesavento7de32c12019-07-26 20:08:21 -040051 * Sign with the default certificate of the default key of an identity: ``id:/<my-identity>``.
52 * Sign with the default certificate of a specific key: ``key:/<my-identity>/ksk-1``.
Eric Newberrya209f672021-03-26 10:52:09 -070053 * Sign with a specific certificate: ``cert:/<my-identity>/KEY/ksk-1/ID-CERT/v=1``.
Davide Pesavento7de32c12019-07-26 20:08:21 -040054 * Sign with a SHA-256 digest: ``id:/localhost/identity/digest-sha256``. Note that this
55 is only a hash function, not a real signature, but it can significantly speed up
56 packet signing operations.
Klaus Schneidere90a3582019-04-03 17:22:39 -070057
Davide Pesaventof8a14d82021-03-12 00:42:03 -050058.. option:: -p, --print-data-version
59
60 Print version of the published Data to the standard output.
61
Klaus Schneidere90a3582019-04-03 17:22:39 -070062.. option:: -q, --quiet
63
64 Turn off all non-error output.
65
66.. option:: -v, --verbose
67
68 Produce verbose output.
69
70.. option:: -V, --version
71
72 Print program version and exit.
73
Davide Pesaventoa420e972021-02-25 00:56:25 -050074Examples
75--------
Klaus Schneidere90a3582019-04-03 17:22:39 -070076
Davide Pesaventof8a14d82021-03-12 00:42:03 -050077The following command will publish the text of the GPL-3 license under the ``/localhost/demo/gpl3``
Klaus Schneidere90a3582019-04-03 17:22:39 -070078prefix::
79
80 ndnputchunks /localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3
81
Davide Pesaventoa420e972021-02-25 00:56:25 -050082To see the published version, you can run the program with the **-p** option::
Klaus Schneidere90a3582019-04-03 17:22:39 -070083
84 ndnputchunks -p /localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3
85
86This command will print the published version to the standard output.
87
88To publish Data with a specific version, you must append a version component to the end of the
89prefix. The version component must follow the aforementioned NDN naming conventions.
Davide Pesaventof8a14d82021-03-12 00:42:03 -050090For example, the following command will publish version 1615519151142 of ``/localhost/demo/gpl3``
91using the "typed" naming convention::
Klaus Schneidere90a3582019-04-03 17:22:39 -070092
Davide Pesaventof8a14d82021-03-12 00:42:03 -050093 ndnputchunks -Nt /localhost/demo/gpl3/v=1615519151142 < /usr/share/common-licenses/GPL-3
Klaus Schneidere90a3582019-04-03 17:22:39 -070094
Davide Pesaventof8a14d82021-03-12 00:42:03 -050095See Also
96--------
97
98.. target-notes::