Register miner address from storageminer process
This commit is contained in:
+5
-5
@@ -3,6 +3,10 @@ package impl
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/filecoin-project/go-lotus/api"
|
||||
"github.com/filecoin-project/go-lotus/build"
|
||||
"github.com/filecoin-project/go-lotus/node/modules/dtypes"
|
||||
|
||||
"github.com/gbrlsnchs/jwt/v3"
|
||||
"github.com/libp2p/go-libp2p-core/host"
|
||||
"github.com/libp2p/go-libp2p-core/network"
|
||||
@@ -10,16 +14,12 @@ import (
|
||||
ma "github.com/multiformats/go-multiaddr"
|
||||
"go.uber.org/fx"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-lotus/api"
|
||||
"github.com/filecoin-project/go-lotus/build"
|
||||
"github.com/filecoin-project/go-lotus/node/modules"
|
||||
)
|
||||
|
||||
type CommonAPI struct {
|
||||
fx.In
|
||||
|
||||
APISecret *modules.APIAlg
|
||||
APISecret *dtypes.APIAlg
|
||||
Host host.Host
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
var log = logging.Logger("node")
|
||||
|
||||
type API struct {
|
||||
type FullNodeAPI struct {
|
||||
CommonAPI
|
||||
full.ChainAPI
|
||||
full.ClientAPI
|
||||
@@ -24,8 +24,8 @@ type API struct {
|
||||
Miner *miner.Miner
|
||||
}
|
||||
|
||||
func (a *API) MinerRegister(ctx context.Context, addr address.Address) error {
|
||||
func (a *FullNodeAPI) MinerRegister(ctx context.Context, addr address.Address) error {
|
||||
return a.Miner.Register(addr)
|
||||
}
|
||||
|
||||
var _ api.FullNode = &API{}
|
||||
var _ api.FullNode = &FullNodeAPI{}
|
||||
|
||||
Reference in New Issue
Block a user