Project

General

Profile

Tools » History » Version 2

Weiqi Shi, 08/20/2014 11:09 AM

1 1 Weiqi Shi
Tools
2
=====
3
repo tools use the command line to instruct different behavior of repo.
4
5
## ndnputfile
6
7
This tool is used to insert data into repo.
8
9
    $ndnputfile <command> repo-prefix  ndn-name  filename
10
11
Here is a list of commands supported so far:
12
13
     $ndnputfile -h
14
          -u: unversioned: do not add a version component
15
          -s: single: do not add version or segment component, implies -u
16
          -D: use DigestSha256 signing method instead of SignatureSha256WithRsa
17
          -i: specify identity used for signing Data
18
          -I: specify identity used for signing commands
19
          -x: FreshnessPeriod in milliseconds
20
          -l: InterestLifetime in milliseconds for each command
21
          -w: timeout in milliseconds for whole process (default unlimited)
22
          -v: be verbose
23 2 Weiqi Shi
24
Next, we will introduce these commands one-by-one:
25
26
#### List
27
28
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
29
30
    $ndnputfile -u /exmaple/repo/1  /example/data/1/%FD%00%00%01G%F0%C8%AD-  test.txt
31
    $ndnputfile /exmaple/repo/1  /example/data/1/ test.txt
32
33
In both cases, the real nun-name is /example/data/1/%FD%00%00%01G%F0%C8%AD-.
34
35
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 
36
37
    $ndnputfile -s /exmaple/repo/1  /example/data/1/  test.txt
38
39
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-.
40
41
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.
42
43
    $ndnputfile /exmaple/repo/1 /example/data/1/ test.jpg
44
45
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.
46
47
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.
48
49
You can specify -D to choose the DigestSha256 as the signing method to sign data packet and command interest
50
51
    $ndnputfile -D /exmaple/repo/1  /example/data/1/  test.txt
52
53
You can also specify the identity to sign command interest or data by using -I and -i respectively.
54
55
    $ndnputfile -I /ndn/test/alice /exmaple/repo/1  /example/data/1/  test.txt
56
    $ndnputfile -i /ndn/test/bob /exmaple/repo/1  /example/data/1/  test.txt