Don't build full API in storage miner
This commit is contained in:
@@ -44,7 +44,7 @@ var runCmd = &cli.Command{
|
||||
return xerrors.Errorf("repo at '%s' is not initialized, run 'lotus-storage-miner init' to set it up", cctx.String(FlagStorageRepo))
|
||||
}
|
||||
|
||||
minerapi, err := node.New(ctx,
|
||||
err = node.New(ctx,
|
||||
node.StorageMiner(),
|
||||
node.Online(),
|
||||
node.Repo(r),
|
||||
@@ -66,7 +66,7 @@ var runCmd = &cli.Command{
|
||||
log.Infof("Remote version %s", v)
|
||||
|
||||
rpcServer := jsonrpc.NewServer()
|
||||
rpcServer.Register("Filecoin", minerapi)
|
||||
//rpcServer.Register("Filecoin", minerapi)
|
||||
http.Handle("/rpc/v0", rpcServer)
|
||||
return http.ListenAndServe("127.0.0.1:"+cctx.String("api"), http.DefaultServeMux)
|
||||
},
|
||||
|
||||
+6
-1
@@ -4,6 +4,8 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/filecoin-project/go-lotus/api"
|
||||
"github.com/multiformats/go-multiaddr"
|
||||
"gopkg.in/urfave/cli.v2"
|
||||
|
||||
@@ -32,7 +34,10 @@ var DaemonCmd = &cli.Command{
|
||||
return err
|
||||
}
|
||||
|
||||
api, err := node.New(ctx,
|
||||
var api api.API
|
||||
err = node.New(ctx,
|
||||
node.FullAPI(&api),
|
||||
|
||||
node.Online(),
|
||||
node.Repo(r),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user