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
79015e78
Commit
79015e78
authored
Nov 04, 2014
by
Brian Tiger Chow
Committed by
Juan Batiz-Benet
Nov 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(ipfs2/init) declarative
parent
e305e45e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
19 deletions
+24
-19
cmd/ipfs2/init.go
cmd/ipfs2/init.go
+24
-19
No files found.
cmd/ipfs2/init.go
View file @
79015e78
...
@@ -85,41 +85,46 @@ func doInit(configRoot string, dspath string, force bool, nBitsForKeypair int) e
...
@@ -85,41 +85,46 @@ func doInit(configRoot string, dspath string, force bool, nBitsForKeypair int) e
return
errors
.
New
(
"ipfs configuration file already exists!
\n
Reinitializing would overwrite your keys.
\n
(use -f to force overwrite)"
)
return
errors
.
New
(
"ipfs configuration file already exists!
\n
Reinitializing would overwrite your keys.
\n
(use -f to force overwrite)"
)
}
}
}
}
cfg
:=
new
(
config
.
Config
)
ds
,
err
:=
datastoreConfig
(
dspath
)
ds
,
err
:=
datastoreConfig
(
dspath
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
cfg
.
Datastore
=
ds
identity
,
err
:=
identityConfig
(
nBitsForKeypair
)
identity
,
err
:=
identityConfig
(
nBitsForKeypair
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
cfg
.
Identity
=
identity
// setup the node addresses.
conf
:=
config
.
Config
{
cfg
.
Addresses
=
config
.
Addresses
{
Swarm
:
"/ip4/0.0.0.0/tcp/4001"
,
API
:
"/ip4/127.0.0.1/tcp/5001"
,
}
// setup the node mount points.
// setup the node addresses.
cfg
.
Mounts
=
config
.
Mounts
{
Addresses
:
config
.
Addresses
{
IPFS
:
"/ipfs"
,
Swarm
:
"/ip4/0.0.0.0/tcp/4001"
,
IPNS
:
"/ipns"
,
API
:
"/ip4/127.0.0.1/tcp/5001"
,
}
},
Bootstrap
:
defaultPeers
,
Datastore
:
ds
,
Identity
:
identity
,
cfg
.
Bootstrap
=
defaultPeers
// setup the node mount points.
Mounts
:
config
.
Mounts
{
IPFS
:
"/ipfs"
,
IPNS
:
"/ipns"
,
},
// tracking ipfs version used to generate the init folder and adding update checker default setting.
// tracking ipfs version used to generate the init folder and adding
cfg
.
Version
=
config
.
Version
{
// update checker default setting.
Check
:
"error"
,
Version
:
config
.
Version
{
Current
:
updates
.
Version
,
Check
:
"error"
,
Current
:
updates
.
Version
,
},
}
}
err
=
config
.
WriteConfigFile
(
configFilename
,
cf
g
)
err
=
config
.
WriteConfigFile
(
configFilename
,
c
on
f
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
...
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