Browse Source

config: supply the host ID to fx

This is needed to construct the insecure transport.
pull/1887/head
Marten Seemann 2 years ago
parent
commit
133f002117
  1. 1
      config/config.go

1
config/config.go

@ -182,6 +182,7 @@ func (cfg *Config) addTransports(h host.Host) error {
fx.ParamTags(`group:"security"`), fx.ParamTags(`group:"security"`),
)), )),
fx.Supply(cfg.Muxers), fx.Supply(cfg.Muxers),
fx.Supply(h.ID()),
fx.Provide(func() host.Host { return h }), fx.Provide(func() host.Host { return h }),
fx.Provide(func() crypto.PrivKey { return h.Peerstore().PrivKey(h.ID()) }), fx.Provide(func() crypto.PrivKey { return h.Peerstore().PrivKey(h.ID()) }),
fx.Provide(func() connmgr.ConnectionGater { return cfg.ConnectionGater }), fx.Provide(func() connmgr.ConnectionGater { return cfg.ConnectionGater }),

Loading…
Cancel
Save