1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-06 08:20:57 +08:00

startup: always load the private key

Loading this at the last minute means we need a bunch of special cases
in *every* command that needs routing, namesys, or even the public key.

If we ever have a case where we don't want to do this, we can add an option to
the (eventual) IPFS constructor. Handling this up-front is going to be
significantly less error prone.

Motivation: https://github.com/ipfs/go-ipfs/pull/5825/files#diff-fe35ea64d478c4f3fb767a3f618e5d01R863

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
This commit is contained in:
Steven Allen
2018-12-12 18:17:54 -08:00
parent 451f7b3484
commit 2eafa3f3ca
10 changed files with 20 additions and 120 deletions

View File

@ -79,18 +79,6 @@ Resolve the value of an IPFS DAG path:
return err
}
n, err := cmdenv.GetNode(env)
if err != nil {
return err
}
if !n.OnlineMode() {
err := n.SetupOfflineRouting()
if err != nil {
return err
}
}
name := req.Arguments[0]
recursive, _ := req.Options[resolveRecursiveOptionName].(bool)