Don't build full API in storage miner

This commit is contained in:
Łukasz Magiera
2019-07-24 01:48:59 +02:00
parent 8d529d1ae7
commit d0cbf02d36
4 changed files with 31 additions and 16 deletions
+2 -2
View File
@@ -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
View File
@@ -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),