cmds2: mount exmplae
Juan Batiz-Benet committed
Nov 14, 2014 at 01:29 UTC
5e598f9a52d82a51d19155336ca5aa0fe7f3c822
1 file changed
+46
-3
core/commands2/mount_unix.go
+46
-3
@@ -21,9 +21,52 @@ var mountCmd = &cmds.Command{
21
Helptext: cmds.HelpText{
22
Tagline: "Mounts IPFS to the filesystem (read-only)",
23
ShortDescription: `
24
-Mount ipfs at a read-only mountpoint on the OS. All ipfs objects
25
-will be accessible under that directory. Note that the root will
26
-not be listable, as it is virtual. Accessing known paths directly.
24
+Mount ipfs at a read-only mountpoint on the OS (default: /ipfs and /ipns).
25
+All ipfs objects will be accessible under that directory. Note that the
26
+root will not be listable, as it is virtual. Access known paths directly.
27
+
28
+You may kave to create /ipfs and /ipfs before using 'ipfs mount':
29
+
30
+> sudo mkdir /ipfs /ipns
31
+> sudo chown ` + "`" + `whoami` + "`" + ` /ipfs /ipns
32
+> ipfs mount
33
+`,
34
+ LongDescription: `
35
+Mount ipfs at a read-only mountpoint on the OS (default: /ipfs and /ipns).
36
+All ipfs objects will be accessible under that directory. Note that the
37
+root will not be listable, as it is virtual. Access known paths directly.
38
+
39
+> sudo mkdir /ipfs /ipns
40
+> sudo chown ` + "`" + `whoami` + "`" + ` /ipfs /ipns
41
+> ipfs mount
42
+
43
+EXAMPLE:
44
+
45
+# setup
46
+> mkdir foo
47
+> echo "baz" > foo/bar
48
+> ipfs add -r foo
49
+added QmWLdkp93sNxGRjnFHPaYg8tCQ35NBY3XPn6KiETd3Z4WR foo/bar
50
+added QmSh5e7S6fdcu75LAbXNZAFY2nGyZUJXyLCJDvn2zRkWyC foo
51
+> ipfs ls QmSh5e7S6fdcu75LAbXNZAFY2nGyZUJXyLCJDvn2zRkWyC
52
+QmWLdkp93sNxGRjnFHPaYg8tCQ35NBY3XPn6KiETd3Z4WR 12 bar
53
+> ipfs cat QmWLdkp93sNxGRjnFHPaYg8tCQ35NBY3XPn6KiETd3Z4WR
54
+baz
55
+
56
+# mount
57
+> ipfs daemon &
58
+> ipfs mount
59
+IPFS mounted at: /ipfs
60
+IPNS mounted at: /ipns
61
+> cd /ipfs/QmSh5e7S6fdcu75LAbXNZAFY2nGyZUJXyLCJDvn2zRkWyC
62
+> ls
63
+bar
64
+> cat bar
65
+baz
66
+> cat /ipfs/QmSh5e7S6fdcu75LAbXNZAFY2nGyZUJXyLCJDvn2zRkWyC/bar
67
+baz
68
+> cat /ipfs/QmWLdkp93sNxGRjnFHPaYg8tCQ35NBY3XPn6KiETd3Z4WR
69
+baz
70
`,
71
},
72