diff --git a/cmd/ipfs2/daemon.go b/cmd/ipfs2/daemon.go index e0e03feea..0194240a3 100644 --- a/cmd/ipfs2/daemon.go +++ b/cmd/ipfs2/daemon.go @@ -46,12 +46,15 @@ the daemon. } func daemonFunc(req cmds.Request) (interface{}, error) { - cfg, err := req.Context().GetConfig() + ctx := req.Context() + cfg, err := ctx.GetConfig() if err != nil { return nil, err } - node, err := core.NewIpfsNode(cfg, true) + // make sure we construct online node. + ctx.Online = true + node, err := ctx.GetNode() if err != nil { return nil, err } diff --git a/cmd/ipfs2/main.go b/cmd/ipfs2/main.go index 497437dc3..66f3b23bc 100644 --- a/cmd/ipfs2/main.go +++ b/cmd/ipfs2/main.go @@ -181,7 +181,7 @@ func (i *cmdInvocation) constructNode() (*core.IpfsNode, error) { // ok everything is good. set it on the invocation (for ownership) // and return it. - i.node, err = core.NewIpfsNode(cfg, false) + i.node, err = core.NewIpfsNode(cfg, ctx.Online) return i.node, err } diff --git a/commands/request.go b/commands/request.go index 0b6f87f95..112e3dde0 100644 --- a/commands/request.go +++ b/commands/request.go @@ -14,6 +14,7 @@ import ( type optMap map[string]interface{} type Context struct { + Online bool ConfigRoot string config *config.Config