ceremonyclient/node/app/wire_gen.go

50 lines
1.3 KiB
Go
Raw Normal View History

2023-09-03 23:47:09 +00:00
// Code generated by Wire. DO NOT EDIT.
//go:generate go run github.com/google/wire/cmd/wire
//go:build !wireinject
// +build !wireinject
package app
import (
"github.com/google/wire"
"go.uber.org/zap"
"source.quilibrium.com/quilibrium/monorepo/node/config"
"source.quilibrium.com/quilibrium/monorepo/node/keys"
"source.quilibrium.com/quilibrium/monorepo/node/p2p"
)
// Injectors from wire.go:
2024-08-08 05:41:46 +00:00
func NewNode(configConfig *config.Config) (*Node, error) {
logger := debugLogger()
keyConfig := configConfig.Key
2024-08-08 05:41:46 +00:00
fileKeyManager := keys.NewFileKeyManager(keyConfig, logger)
p2PConfig := configConfig.P2P
2024-08-08 05:41:46 +00:00
blossomSub := p2p.NewBlossomSub(p2PConfig, logger)
node, err := newNode(logger, fileKeyManager, blossomSub)
if err != nil {
return nil, err
}
return node, nil
}
2023-09-03 23:47:09 +00:00
// wire.go:
func debugLogger() *zap.Logger {
log, err := zap.NewDevelopment()
if err != nil {
panic(err)
}
return log
}
var debugLoggerSet = wire.NewSet(
debugLogger,
)
2023-09-03 23:47:09 +00:00
var keyManagerSet = wire.NewSet(wire.FieldsOf(new(*config.Config), "Key"), keys.NewFileKeyManager, wire.Bind(new(keys.KeyManager), new(*keys.FileKeyManager)))
2024-03-21 07:14:45 +00:00
var pubSubSet = wire.NewSet(wire.FieldsOf(new(*config.Config), "P2P"), p2p.NewInMemoryPeerInfoManager, p2p.NewBlossomSub, wire.Bind(new(p2p.PubSub), new(*p2p.BlossomSub)), wire.Bind(new(p2p.PeerInfoManager), new(*p2p.InMemoryPeerInfoManager)))