hello: Invohe RunHello
This commit is contained in:
@@ -73,6 +73,7 @@ func New(ctx context.Context) (api.API, error) {
|
||||
fx.Invoke(
|
||||
lp2p.PstoreAddSelfKeys,
|
||||
lp2p.StartListening(defaultListenAddrs),
|
||||
modules.RunHello,
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
+2
-1
@@ -15,6 +15,7 @@ import (
|
||||
)
|
||||
|
||||
const ProtocolID = "/fil/hello/1.0.0"
|
||||
|
||||
var log = logging.Logger("hello")
|
||||
|
||||
func init() {
|
||||
@@ -96,4 +97,4 @@ func (hs *Service) SayHello(ctx context.Context, pid peer.ID) error {
|
||||
}*/
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"go.uber.org/fx"
|
||||
)
|
||||
|
||||
func HandleHello(mctx helpers.MetricsCtx, lc fx.Lifecycle, h host.Host, svc *hello.Service) error {
|
||||
func RunHello(mctx helpers.MetricsCtx, lc fx.Lifecycle, h host.Host, svc *hello.Service) {
|
||||
h.SetStreamHandler(hello.ProtocolID, svc.HandleStream)
|
||||
|
||||
bundle := inet.NotifyBundle{
|
||||
|
||||
Reference in New Issue
Block a user