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
4588732a
Commit
4588732a
authored
10 years ago
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
address comments from PR
parent
9f4127ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
core/commands2/id.go
core/commands2/id.go
+10
-6
core/commands2/root.go
core/commands2/root.go
+1
-1
No files found.
core/commands2/id.go
View file @
4588732a
...
...
@@ -16,6 +16,9 @@ import (
u
"github.com/jbenet/go-ipfs/util"
)
const
offlineIdErrorMessage
=
`ID command fails when run without daemon, we are working
to fix this In the meantime, please run the daemon if you want to use 'ipfs id'`
type
IdOutput
struct
{
ID
string
PublicKey
string
...
...
@@ -26,9 +29,11 @@ type IdOutput struct {
var
idCmd
=
&
cmds
.
Command
{
Helptext
:
cmds
.
HelpText
{
Tagline
:
"Show IPFS Node IF info"
,
ShortDescription
:
`Prints out information about the specified peer,
if no peer is specified, prints out local peers info.`
,
Tagline
:
"Show IPFS Node ID info"
,
ShortDescription
:
`
Prints out information about the specified peer,
if no peer is specified, prints out local peers info.
`
,
},
Arguments
:
nil
,
Run
:
func
(
req
cmds
.
Request
)
(
interface
{},
error
)
{
...
...
@@ -50,8 +55,7 @@ var idCmd = &cmds.Command{
ctx
,
_
:=
context
.
WithTimeout
(
context
.
TODO
(),
time
.
Second
*
5
)
p
,
err
:=
node
.
Routing
.
FindPeer
(
ctx
,
id
)
if
err
==
kb
.
ErrLookupFailure
{
return
nil
,
errors
.
New
(
`ID command fails when run without daemon, we are working to fix this
In the meantime, please run the daemon if you want to use 'ipfs id'`
)
return
nil
,
errors
.
New
(
offlineIdErrorMessage
)
}
if
err
!=
nil
{
return
nil
,
err
...
...
@@ -80,7 +84,7 @@ func printPeer(p peer.Peer) (interface{}, error) {
info
.
ID
=
p
.
ID
()
.
String
()
if
p
.
PubKey
()
==
nil
{
return
nil
,
errors
.
New
(
`peer publickey not populated on offline runs,
please run the daemon to use ipfs id!`
)
please run the daemon to use ipfs id!`
)
}
pkb
,
err
:=
p
.
PubKey
()
.
Bytes
()
if
err
!=
nil
{
...
...
This diff is collapsed.
Click to expand it.
core/commands2/root.go
View file @
4588732a
...
...
@@ -32,7 +32,7 @@ Tool commands:
update Download and apply go-ipfs updates
version Show ipfs version information
commands List all available commands
id
Show info about ipfs peers
id
Show info about ipfs peers
Advanced Commands:
...
...
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