Project

General

Profile

Actions

Tools » History » Revision 2

« Previous | Revision 2/7 (diff) | Next »
Weiqi Shi, 08/20/2014 11:09 AM


Tools

repo tools use the command line to instruct different behavior of repo.

ndnputfile

This tool is used to insert data into repo.

$ndnputfile <command> repo-prefix  ndn-name  filename

Here is a list of commands supported so far:

 $ndnputfile -h
      -u: unversioned: do not add a version component
      -s: single: do not add version or segment component, implies -u
      -D: use DigestSha256 signing method instead of SignatureSha256WithRsa
      -i: specify identity used for signing Data
      -I: specify identity used for signing commands
      -x: FreshnessPeriod in milliseconds
      -l: InterestLifetime in milliseconds for each command
      -w: timeout in milliseconds for whole process (default unlimited)
      -v: be verbose

Next, we will introduce these commands one-by-one:

List

If you want to add a version number manually after the ndn-name, you can specify -u. Otherwise, ndnputfile will automatically append a version number according to current time. For example

$ndnputfile -u /exmaple/repo/1  /example/data/1/%FD%00%00%01G%F0%C8%AD-  test.txt
$ndnputfile /exmaple/repo/1  /example/data/1/ test.txt

In both cases, the real nun-name is /example/data/1/%FD%00%00%01G%F0%C8%AD-.

If you want to use exact one data to storage your file, you can specify -s. Otherwise, your file content will be separated into multiple segmented data

$ndnputfile -s /exmaple/repo/1  /example/data/1/  test.txt

In this way, all you content will be stored in one data packet and no segment number will be appended. The real ndn-name for example will be /example/data/1/%FD%00%00%01G%F0%C8%AD-.

If the file is large enough and cannot be stored into one data packet, you should not specify -s. In this way, ndnputfile will automatically separate the data content and use the segment number to identify different segments.

$ndnputfile /exmaple/repo/1 /example/data/1/ test.jpg

In this case, data will be segmented and the segment number starts from 0. The real ndn-name could be /example/data/1/%FD%00%00%01G%F0%C8%AD-/%00%00.

Notice: If the data is not large enough to use segmented data to insert, not specify -s will only generate one segment, whose real ndn-name contain a segment number /%00%00.

You can specify -D to choose the DigestSha256 as the signing method to sign data packet and command interest

$ndnputfile -D /exmaple/repo/1  /example/data/1/  test.txt

You can also specify the identity to sign command interest or data by using -I and -i respectively.

$ndnputfile -I /ndn/test/alice /exmaple/repo/1  /example/data/1/  test.txt
$ndnputfile -i /ndn/test/bob /exmaple/repo/1  /example/data/1/  test.txt

Updated by Weiqi Shi over 9 years ago · 2 revisions