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
1ef79801
Commit
1ef79801
authored
Oct 14, 2015
by
Juan Benet
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1834 from ipfs/feat/local-resolve
allow ipfs name resolve to respect --local
parents
ab81afbc
73cd3f65
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
core/commands/ipns.go
core/commands/ipns.go
+7
-1
No files found.
core/commands/ipns.go
View file @
1ef79801
...
...
@@ -7,6 +7,7 @@ import (
cmds
"github.com/ipfs/go-ipfs/commands"
namesys
"github.com/ipfs/go-ipfs/namesys"
offline
"github.com/ipfs/go-ipfs/routing/offline"
u
"github.com/ipfs/go-ipfs/util"
)
...
...
@@ -61,6 +62,11 @@ Resolve the value of another name:
}
}
router
:=
n
.
Routing
if
local
,
_
,
_
:=
req
.
Option
(
"local"
)
.
Bool
();
local
{
router
=
offline
.
NewOfflineRouter
(
n
.
Repo
.
Datastore
(),
n
.
PrivateKey
)
}
var
name
string
if
len
(
req
.
Arguments
())
==
0
{
...
...
@@ -80,7 +86,7 @@ Resolve the value of another name:
depth
=
namesys
.
DefaultDepthLimit
}
resolver
:=
namesys
.
NewRoutingResolver
(
n
.
Routing
)
resolver
:=
namesys
.
NewRoutingResolver
(
router
)
output
,
err
:=
resolver
.
ResolveN
(
req
.
Context
(),
name
,
depth
)
if
err
!=
nil
{
res
.
SetError
(
err
,
cmds
.
ErrNormal
)
...
...
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