@@ -17,13 +17,15 @@ import (
17
17
oldcmds "github.com/ipfs/go-ipfs/commands"
18
18
"github.com/ipfs/go-ipfs/core"
19
19
commands "github.com/ipfs/go-ipfs/core/commands"
20
+ coreapi "github.com/ipfs/go-ipfs/core/coreapi"
20
21
corehttp "github.com/ipfs/go-ipfs/core/corehttp"
21
22
corerepo "github.com/ipfs/go-ipfs/core/corerepo"
22
23
nodeMount "github.com/ipfs/go-ipfs/fuse/node"
23
24
fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo"
24
25
migrate "github.com/ipfs/go-ipfs/repo/fsrepo/migrations"
25
26
26
27
ma "gx/ipfs/QmNTCey11oxhb1AxDnQBRHtdhap6Ctud872NjAYPYYXPuc/go-multiaddr"
28
+ goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess"
27
29
"gx/ipfs/QmTQuFQWHAWy4wMH6ZyPfGiawA5u9T8rs79FENoV8yXaoS/client_golang/prometheus"
28
30
mprome "gx/ipfs/QmVMcMs6duiwLzvhF6xWM3yc4GgjpNoctKFhvtBch5tpgo/go-metrics-prometheus"
29
31
cmds "gx/ipfs/QmWGm4AbZEbnmdgVTza52MSNpEmBdFVqzmAysRbjrRyGbH/go-ipfs-cmds"
@@ -355,6 +357,18 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
355
357
return node , nil
356
358
}
357
359
360
+ // Start "core" plugins. We want to do this *before* starting the HTTP
361
+ // API as the user may be relying on these plugins.
362
+ api , err := coreapi .NewCoreAPI (node )
363
+ if err != nil {
364
+ return err
365
+ }
366
+ err = cctx .Plugins .Start (api )
367
+ if err != nil {
368
+ return err
369
+ }
370
+ node .Process ().AddChild (goprocess .WithTeardown (cctx .Plugins .Close ))
371
+
358
372
// construct api endpoint - every time
359
373
apiErrc , err := serveHTTPApi (req , cctx )
360
374
if err != nil {
@@ -391,6 +405,7 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
391
405
// initialize metrics collector
392
406
prometheus .MustRegister (& corehttp.IpfsNodeCollector {Node : node })
393
407
408
+ // The daemon is *finally* ready.
394
409
fmt .Printf ("Daemon is ready\n " )
395
410
396
411
// Give the user some immediate feedback when they hit C-c
0 commit comments