Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
da1890e5
Commit
da1890e5
authored
10 years ago
by
Jeromy
Committed by
Juan Batiz-Benet
10 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add run command
parent
b5fd9492
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
1 deletion
+40
-1
cmd/ipfs/ipfs.go
cmd/ipfs/ipfs.go
+1
-0
cmd/ipfs/run.go
cmd/ipfs/run.go
+34
-0
fuse/readonly/readonly_unix.go
fuse/readonly/readonly_unix.go
+5
-1
No files found.
cmd/ipfs/ipfs.go
View file @
da1890e5
...
...
@@ -51,6 +51,7 @@ Use "ipfs help <command>" for more information about a command.
cmdIpfsMount
,
cmdIpfsInit
,
cmdIpfsServe
,
cmdIpfsRun
,
},
Flag
:
*
flag
.
NewFlagSet
(
"ipfs"
,
flag
.
ExitOnError
),
}
...
...
This diff is collapsed.
Click to expand it.
cmd/ipfs/run.go
0 → 100644
View file @
da1890e5
package
main
import
(
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/gonuts/flag"
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/commander"
"github.com/jbenet/go-ipfs/daemon"
u
"github.com/jbenet/go-ipfs/util"
)
var
cmdIpfsRun
=
&
commander
.
Command
{
UsageLine
:
"run"
,
Short
:
"run local ifps node."
,
Long
:
`run a local ipfs node with no other interface.
`
,
Run
:
runCmd
,
Flag
:
*
flag
.
NewFlagSet
(
"ipfs-run"
,
flag
.
ExitOnError
),
}
func
runCmd
(
c
*
commander
.
Command
,
inp
[]
string
)
error
{
u
.
Debug
=
true
n
,
err
:=
localNode
(
true
)
if
err
!=
nil
{
return
err
}
dl
,
err
:=
daemon
.
NewDaemonListener
(
n
,
"localhost:12345"
)
if
err
!=
nil
{
return
err
}
dl
.
Listen
()
dl
.
Close
()
return
nil
}
This diff is collapsed.
Click to expand it.
fuse/readonly/readonly_unix.go
View file @
da1890e5
...
...
@@ -98,7 +98,11 @@ func (s *Node) Attr() fuse.Attr {
case
mdag
.
PBData_File
,
mdag
.
PBData_Raw
:
u
.
DOut
(
"this is a file.
\n
"
)
size
,
_
:=
s
.
Nd
.
Size
()
return
fuse
.
Attr
{
Mode
:
0444
,
Size
:
uint64
(
size
)}
return
fuse
.
Attr
{
Mode
:
0444
,
Size
:
uint64
(
size
),
Blocks
:
uint64
(
len
(
s
.
Nd
.
Links
)),
}
default
:
u
.
PErr
(
"Invalid data type."
)
return
fuse
.
Attr
{}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment