2019-07-24 01:13:56 +00:00
|
|
|
package impl
|
2019-07-08 19:07:16 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2019-08-12 18:30:20 +00:00
|
|
|
|
2019-07-08 19:07:16 +00:00
|
|
|
"github.com/filecoin-project/go-lotus/api"
|
2019-07-11 02:36:43 +00:00
|
|
|
"github.com/filecoin-project/go-lotus/chain/address"
|
|
|
|
"github.com/filecoin-project/go-lotus/miner"
|
2019-08-20 16:48:33 +00:00
|
|
|
"github.com/filecoin-project/go-lotus/node/impl/full"
|
2019-07-23 17:27:45 +00:00
|
|
|
logging "github.com/ipfs/go-log"
|
2019-07-08 19:07:16 +00:00
|
|
|
)
|
|
|
|
|
2019-07-23 17:27:45 +00:00
|
|
|
var log = logging.Logger("node")
|
|
|
|
|
2019-08-20 17:19:24 +00:00
|
|
|
type FullNodeAPI struct {
|
2019-07-24 00:58:31 +00:00
|
|
|
CommonAPI
|
2019-08-20 16:48:33 +00:00
|
|
|
full.ChainAPI
|
|
|
|
full.ClientAPI
|
|
|
|
full.MpoolAPI
|
|
|
|
full.PaychAPI
|
|
|
|
full.StateAPI
|
|
|
|
full.WalletAPI
|
2019-07-24 00:58:31 +00:00
|
|
|
|
2019-08-20 16:48:33 +00:00
|
|
|
Miner *miner.Miner
|
2019-08-09 15:59:12 +00:00
|
|
|
}
|
|
|
|
|
2019-08-21 15:14:38 +00:00
|
|
|
func (a *FullNodeAPI) MinerAddresses(context.Context) ([]address.Address, error) {
|
|
|
|
return a.Miner.Addresses()
|
|
|
|
}
|
|
|
|
|
2019-08-20 17:19:24 +00:00
|
|
|
func (a *FullNodeAPI) MinerRegister(ctx context.Context, addr address.Address) error {
|
2019-08-20 16:48:33 +00:00
|
|
|
return a.Miner.Register(addr)
|
2019-08-13 04:27:54 +00:00
|
|
|
}
|
|
|
|
|
2019-08-20 18:05:17 +00:00
|
|
|
func (a *FullNodeAPI) MinerUnregister(ctx context.Context, addr address.Address) error {
|
|
|
|
return a.Miner.Unregister(ctx, addr)
|
|
|
|
}
|
|
|
|
|
2019-08-20 17:19:24 +00:00
|
|
|
var _ api.FullNode = &FullNodeAPI{}
|