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-unixfs
Commits
4284e8e9
Commit
4284e8e9
authored
10 years ago
by
Juan Batiz-Benet
Committed by
Brian Tiger Chow
10 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config: use PeerID in bootstrap config
parent
9ea715cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
config/config.go
config/config.go
+1
-0
core/core.go
core/core.go
+9
-1
No files found.
config/config.go
View file @
4284e8e9
...
...
@@ -25,6 +25,7 @@ type Datastore struct {
type
SavedPeer
struct
{
Address
string
PeerID
string
// until multiaddr supports ipfs, use another field.
}
// Config is used to load IPFS config files.
...
...
This diff is collapsed.
Click to expand it.
core/core.go
View file @
4284e8e9
...
...
@@ -186,13 +186,21 @@ func initIdentity(cfg *config.Config) (*peer.Peer, error) {
func
initConnections
(
cfg
*
config
.
Config
,
route
*
dht
.
IpfsDHT
)
{
for
_
,
p
:=
range
cfg
.
Peers
{
if
p
.
PeerID
==
""
{
u
.
PErr
(
"error: peer does not include PeerID. %v
\n
"
,
p
)
}
maddr
,
err
:=
ma
.
NewMultiaddr
(
p
.
Address
)
if
err
!=
nil
{
u
.
PErr
(
"error: %v
\n
"
,
err
)
continue
}
_
,
err
=
route
.
Connect
(
maddr
)
// setup peer
npeer
:=
&
peer
.
Peer
{
ID
:
peer
.
DecodePrettyID
(
p
.
PeerID
)}
npeer
.
AddAddress
(
maddr
)
_
,
err
=
route
.
Connect
(
npeer
)
if
err
!=
nil
{
u
.
PErr
(
"Bootstrapping error: %v
\n
"
,
err
)
}
...
...
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