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
9b89a3dd
Commit
9b89a3dd
authored
Jun 19, 2015
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1398 from ipfs/tk/publish-local-peer-id
core/commands/publish: Allow explicit local node ID
parents
ed5374da
e700c02c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
+19
-4
core/commands/publish.go
core/commands/publish.go
+7
-4
test/sharness/t0100-name.sh
test/sharness/t0100-name.sh
+12
-0
No files found.
core/commands/publish.go
View file @
9b89a3dd
...
...
@@ -72,16 +72,19 @@ Publish an <ipfs-path> to another public key (not implemented):
return
}
var
name
string
var
pstr
string
switch
len
(
args
)
{
case
2
:
//
name = args[0]
name
=
args
[
0
]
pstr
=
args
[
1
]
if
name
!=
n
.
Identity
.
Pretty
()
{
res
.
SetError
(
errors
.
New
(
"keychains not yet implemented"
),
cmds
.
ErrNormal
)
return
}
case
1
:
// name = n.Identity.
ID.String
()
// name = n.Identity.
Pretty
()
pstr
=
args
[
0
]
}
...
...
test/sharness/t0100-name.sh
View file @
9b89a3dd
...
...
@@ -52,4 +52,16 @@ test_expect_success "resolve output looks good" '
test_cmp output expected4
'
# publish with an explicit node ID
test_expect_success
"'ipfs name publish <local-id> <hash>' succeeds"
'
PEERID=`ipfs id --format="<id>"` &&
ipfs name publish "${PEERID}" "/ipfs/$HASH_WELCOME_DOCS" >actual_node_id_publish
'
test_expect_success
"publish with our explicit node ID looks good"
'
echo "Published to ${PEERID}: /ipfs/$HASH_WELCOME_DOCS" >expected_node_id_publish &&
test_cmp expected_node_id_publish actual_node_id_publish
'
test_done
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