Start implementing storage deals

This commit is contained in:
Łukasz Magiera
2019-08-07 20:00:49 -07:00
committed by whyrusleeping
parent 5b63e6aefc
commit ad9e433232
6 changed files with 171 additions and 6 deletions
+16
View File
@@ -1,12 +1,15 @@
package modules
import (
"context"
"github.com/libp2p/go-libp2p-core/host"
inet "github.com/libp2p/go-libp2p-core/network"
pubsub "github.com/libp2p/go-libp2p-pubsub"
"go.uber.org/fx"
"github.com/filecoin-project/go-lotus/chain"
"github.com/filecoin-project/go-lotus/chain/deals"
"github.com/filecoin-project/go-lotus/chain/sub"
"github.com/filecoin-project/go-lotus/node/hello"
"github.com/filecoin-project/go-lotus/node/modules/helpers"
@@ -53,3 +56,16 @@ func HandleIncomingMessages(mctx helpers.MetricsCtx, lc fx.Lifecycle, pubsub *pu
go sub.HandleIncomingMessages(ctx, mpool, msgsub)
}
func RunDealClient(lc fx.Lifecycle, c *deals.Client) {
lc.Append(fx.Hook{
OnStart: func(context.Context) error {
c.Run()
return nil
},
OnStop: func(context.Context) error {
c.Stop()
return nil
},
})
}