blob: acaab8ff0fac8c4dfb1365ef5faf234c1fc88c03 [file] [log] [blame] [view]
Davide Pesavento8ca94572025-04-20 14:52:00 -04001# ndnserve
2
3**ndnserve** is a producer program that reads a file from the standard input, and makes it
4available 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/).
7
8Files published by ndnserve can be fetched with [ndnget](../get/README.md).
9
10## Usage examples
11
12The following command will publish the text of the GPL-3 license under the `/localhost/demo/gpl3`
13prefix:
14
15 ndnserve /localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3
16
17To find the published version you have to start ndnserve with the `-p` command line option,
18for example:
19
20 ndnserve -p /localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3
21
22This command will print the published version to standard output.
23
24To 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:
27
28 ndnserve -Nt /localhost/demo/gpl3/v=1449078495094 < /usr/share/common-licenses/GPL-3
29
30If the specified version component is not valid, ndnserve will exit with an error. If no version
31component is specified, one will be generated and appended to the name.