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()
|
2024-03-27 08:50:52 +00:00
|
|
|
keyConfig := configConfig.Key
|
2024-08-08 05:41:46 +00:00
|
|
|
fileKeyManager := keys.NewFileKeyManager(keyConfig, logger)
|
2024-03-27 08:50:52 +00:00
|
|
|
p2PConfig := configConfig.P2P
|
2024-08-08 05:41:46 +00:00
|
|
|
blossomSub := p2p.NewBlossomSub(p2PConfig, logger)
|
|
|
|
node, err := newNode(logger, fileKeyManager, blossomSub)
|
2024-03-27 08:50:52 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return node, nil
|
|
|
|
}
|
|
|
|
|
2023-09-03 23:47:09 +00:00
|
|
|
// wire.go:
|
|
|
|
|
2024-03-27 08:50:52 +00:00
|
|
|
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)))
|