ceremonyclient/node/app/wire_gen.go

91 lines
3.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/consensus"
2023-09-25 02:43:35 +00:00
"source.quilibrium.com/quilibrium/monorepo/node/consensus/ceremony"
2023-09-03 23:47:09 +00:00
"source.quilibrium.com/quilibrium/monorepo/node/consensus/master"
2023-09-25 02:43:35 +00:00
ceremony2 "source.quilibrium.com/quilibrium/monorepo/node/execution/ceremony"
2023-09-03 23:47:09 +00:00
"source.quilibrium.com/quilibrium/monorepo/node/keys"
"source.quilibrium.com/quilibrium/monorepo/node/p2p"
2023-09-09 23:45:47 +00:00
"source.quilibrium.com/quilibrium/monorepo/node/store"
2023-09-03 23:47:09 +00:00
)
// Injectors from wire.go:
func NewNode(configConfig *config.Config) (*Node, error) {
zapLogger := logger()
engineConfig := configConfig.Engine
2023-09-25 02:43:35 +00:00
keyConfig := configConfig.Key
fileKeyManager := keys.NewFileKeyManager(keyConfig, zapLogger)
2023-09-09 23:45:47 +00:00
dbConfig := configConfig.DB
db := store.NewPebbleDB(dbConfig)
pebbleClockStore := store.NewPebbleClockStore(db, zapLogger)
2023-09-25 02:43:35 +00:00
pebbleKeyStore := store.NewPebbleKeyStore(db, zapLogger)
2023-09-03 23:47:09 +00:00
p2PConfig := configConfig.P2P
blossomSub := p2p.NewBlossomSub(p2PConfig, zapLogger)
2023-09-25 02:43:35 +00:00
ceremonyDataClockConsensusEngine := ceremony.NewCeremonyDataClockConsensusEngine(engineConfig, zapLogger, fileKeyManager, pebbleClockStore, pebbleKeyStore, blossomSub)
ceremonyExecutionEngine := ceremony2.NewCeremonyExecutionEngine(zapLogger, ceremonyDataClockConsensusEngine, engineConfig, fileKeyManager, blossomSub, pebbleClockStore, pebbleKeyStore)
2023-09-09 23:45:47 +00:00
masterClockConsensusEngine := master.NewMasterClockConsensusEngine(engineConfig, zapLogger, pebbleClockStore, fileKeyManager, blossomSub)
2023-09-25 02:43:35 +00:00
node, err := newNode(ceremonyExecutionEngine, masterClockConsensusEngine)
2023-09-03 23:47:09 +00:00
if err != nil {
return nil, err
}
return node, nil
}
2023-09-09 23:45:47 +00:00
func NewDBConsole(configConfig *config.Config) (*DBConsole, error) {
dbConfig := configConfig.DB
db := store.NewPebbleDB(dbConfig)
zapLogger := logger()
pebbleClockStore := store.NewPebbleClockStore(db, zapLogger)
dbConsole, err := newDBConsole(pebbleClockStore)
if err != nil {
return nil, err
}
return dbConsole, nil
}
2023-09-03 23:47:09 +00:00
// wire.go:
func logger() *zap.Logger {
log, err := zap.NewProduction()
if err != nil {
panic(err)
}
return log
}
var loggerSet = wire.NewSet(
logger,
)
var keyManagerSet = wire.NewSet(wire.FieldsOf(new(*config.Config), "Key"), keys.NewFileKeyManager, wire.Bind(new(keys.KeyManager), new(*keys.FileKeyManager)))
2023-09-25 02:43:35 +00:00
var storeSet = wire.NewSet(wire.FieldsOf(new(*config.Config), "DB"), store.NewPebbleDB, store.NewPebbleClockStore, store.NewPebbleKeyStore, wire.Bind(new(store.ClockStore), new(*store.PebbleClockStore)), wire.Bind(new(store.KeyStore), new(*store.PebbleKeyStore)))
2023-09-09 23:45:47 +00:00
2023-09-03 23:47:09 +00:00
var pubSubSet = wire.NewSet(wire.FieldsOf(new(*config.Config), "P2P"), p2p.NewBlossomSub, wire.Bind(new(p2p.PubSub), new(*p2p.BlossomSub)))
2023-09-25 02:43:35 +00:00
var dataConsensusSet = wire.NewSet(wire.FieldsOf(new(*config.Config), "Engine"), ceremony.NewCeremonyDataClockConsensusEngine, wire.Bind(
new(consensus.DataConsensusEngine),
new(*ceremony.CeremonyDataClockConsensusEngine),
),
)
var engineSet = wire.NewSet(ceremony2.NewCeremonyExecutionEngine)
2023-09-03 23:47:09 +00:00
2023-09-25 02:43:35 +00:00
var consensusSet = wire.NewSet(master.NewMasterClockConsensusEngine, wire.Bind(
2023-09-09 23:45:47 +00:00
new(consensus.ConsensusEngine),
new(*master.MasterClockConsensusEngine),
),
)