blob: 2c68eed088d931aff1b56f5c4e018c075f00f6fe [file] [log] [blame] [view]
Davide Pesavento0b6e1db2025-04-19 19:23:11 -04001# ndnputchunks
Andrea Tosatto672b9a72016-01-05 16:18:20 +01002
Davide Pesavento0b6e1db2025-04-19 19:23:11 -04003**ndnputchunks** is a producer program that reads a file from the standard input, and makes
4it available as a set of NDN Data segments. It appends version and segment number components
5to the specified name as needed, according to the [NDN naming conventions](
6https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/).
Andrea Tosatto672b9a72016-01-05 16:18:20 +01007
Davide Pesavento0b6e1db2025-04-19 19:23:11 -04008Files published by ndnputchunks can be fetched with [ndnget](../get/README.md).
Andrea Tosatto672b9a72016-01-05 16:18:20 +01009
10## Usage examples
11
Andrea Tosatto672b9a72016-01-05 16:18:20 +010012The following command will publish the text of the GPL-3 license under the `/localhost/demo/gpl3`
13prefix:
14
Chavoosh Ghasemibb2d2802019-03-26 16:07:58 -070015 ndnputchunks /localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3
Andrea Tosatto672b9a72016-01-05 16:18:20 +010016
17To find the published version you have to start ndnputchunks with the `-p` command line option,
18for example:
19
Chavoosh Ghasemibb2d2802019-03-26 16:07:58 -070020 ndnputchunks -p /localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3
Andrea Tosatto672b9a72016-01-05 16:18:20 +010021
Eric Newberrya209f672021-03-26 10:52:09 -070022This command will print the published version to standard output.
Andrea Tosatto672b9a72016-01-05 16:18:20 +010023
Eric Newberrya209f672021-03-26 10:52:09 -070024To publish Data with a specific version, you need to append a version component to the end of the
25prefix. The version component must follow the aforementioned NDN naming conventions. For example,
26the following command will publish the version 1449078495094 of the `/localhost/demo/gpl3` prefix:
Andrea Tosatto672b9a72016-01-05 16:18:20 +010027
Eric Newberrya209f672021-03-26 10:52:09 -070028 ndnputchunks -Nt /localhost/demo/gpl3/v=1449078495094 < /usr/share/common-licenses/GPL-3
Andrea Tosatto672b9a72016-01-05 16:18:20 +010029
Eric Newberrya209f672021-03-26 10:52:09 -070030If the specified version component is not valid, ndnputchunks will exit with an error. If no version
31component is specified, one will be generated and appended to the name.