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
8920ecee
Unverified
Commit
8920ecee
authored
Feb 05, 2020
by
Steven Allen
Committed by
GitHub
Feb 05, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6872 from ipfs/fix/id-addr-format
fix: fix id addr format
parents
f27d04fe
26c5e385
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
core/commands/id.go
core/commands/id.go
+7
-3
core/commands/swarm.go
core/commands/swarm.go
+2
-1
No files found.
core/commands/id.go
View file @
8920ecee
...
...
@@ -14,6 +14,7 @@ import (
cmds
"github.com/ipfs/go-ipfs-cmds"
ic
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/host"
peer
"github.com/libp2p/go-libp2p-core/peer"
pstore
"github.com/libp2p/go-libp2p-core/peerstore"
kb
"github.com/libp2p/go-libp2p-kbucket"
...
...
@@ -184,9 +185,12 @@ func printSelf(node *core.IpfsNode) (interface{}, error) {
info
.
PublicKey
=
base64
.
StdEncoding
.
EncodeToString
(
pkb
)
if
node
.
PeerHost
!=
nil
{
for
_
,
a
:=
range
node
.
PeerHost
.
Addrs
()
{
s
:=
a
.
String
()
+
"/ipfs/"
+
info
.
ID
info
.
Addresses
=
append
(
info
.
Addresses
,
s
)
addrs
,
err
:=
peer
.
AddrInfoToP2pAddrs
(
host
.
InfoFromHost
(
node
.
PeerHost
))
if
err
!=
nil
{
return
nil
,
err
}
for
_
,
a
:=
range
addrs
{
info
.
Addresses
=
append
(
info
.
Addresses
,
a
.
String
())
}
}
info
.
ProtocolVersion
=
identify
.
LibP2PVersion
...
...
core/commands/swarm.go
View file @
8920ecee
...
...
@@ -298,10 +298,11 @@ var swarmAddrsLocalCmd = &cmds.Command{
}
var
addrs
[]
string
p2pProtocolName
:=
ma
.
ProtocolWithCode
(
ma
.
P_P2P
)
.
Name
for
_
,
addr
:=
range
maddrs
{
saddr
:=
addr
.
String
()
if
showid
{
saddr
=
path
.
Join
(
saddr
,
"ipfs"
,
self
.
ID
()
.
Pretty
())
saddr
=
path
.
Join
(
saddr
,
p2pProtocolName
,
self
.
ID
()
.
Pretty
())
}
addrs
=
append
(
addrs
,
saddr
)
}
...
...
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