ceremonyclient/node/app/wire_gen.go

140 lines
5.9 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"
"source.quilibrium.com/quilibrium/monorepo/node/consensus/master"
2024-02-13 07:04:56 +00:00
"source.quilibrium.com/quilibrium/monorepo/node/consensus/time"
"source.quilibrium.com/quilibrium/monorepo/node/crypto"
"source.quilibrium.com/quilibrium/monorepo/node/execution/intrinsics/token"
2023-09-03 23:47:09 +00:00
"source.quilibrium.com/quilibrium/monorepo/node/keys"
"source.quilibrium.com/quilibrium/monorepo/node/p2p"
2024-03-01 07:12:31 +00:00
"source.quilibrium.com/quilibrium/monorepo/node/protobufs"
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 NewDHTNode(configConfig *config.Config) (*DHTNode, error) {
p2PConfig := configConfig.P2P
zapLogger := debugLogger()
blossomSub := p2p.NewBlossomSub(p2PConfig, zapLogger)
dhtNode, err := newDHTNode(blossomSub)
if err != nil {
return nil, err
}
return dhtNode, nil
}
func NewDebugNode(configConfig *config.Config, selfTestReport *protobufs.SelfTestReport) (*Node, error) {
zapLogger := debugLogger()
dbConfig := configConfig.DB
pebbleDB := store.NewPebbleDB(dbConfig)
2024-06-08 11:32:45 +00:00
pebbleDataProofStore := store.NewPebbleDataProofStore(pebbleDB, zapLogger)
pebbleClockStore := store.NewPebbleClockStore(pebbleDB, zapLogger)
keyConfig := configConfig.Key
fileKeyManager := keys.NewFileKeyManager(keyConfig, zapLogger)
p2PConfig := configConfig.P2P
blossomSub := p2p.NewBlossomSub(p2PConfig, zapLogger)
engineConfig := configConfig.Engine
2024-06-08 11:32:45 +00:00
kzgInclusionProver := crypto.NewKZGInclusionProver(zapLogger)
wesolowskiFrameProver := crypto.NewWesolowskiFrameProver(zapLogger)
masterTimeReel := time.NewMasterTimeReel(zapLogger, pebbleClockStore, engineConfig, wesolowskiFrameProver)
inMemoryPeerInfoManager := p2p.NewInMemoryPeerInfoManager(zapLogger)
masterClockConsensusEngine := master.NewMasterClockConsensusEngine(engineConfig, zapLogger, pebbleClockStore, fileKeyManager, blossomSub, kzgInclusionProver, wesolowskiFrameProver, masterTimeReel, inMemoryPeerInfoManager, selfTestReport)
2024-06-08 11:32:45 +00:00
node, err := newNode(zapLogger, pebbleDataProofStore, pebbleClockStore, fileKeyManager, blossomSub, masterClockConsensusEngine)
if err != nil {
return nil, err
}
return node, nil
}
2024-03-01 07:12:31 +00:00
func NewNode(configConfig *config.Config, selfTestReport *protobufs.SelfTestReport) (*Node, error) {
2023-09-03 23:47:09 +00:00
zapLogger := logger()
2023-09-09 23:45:47 +00:00
dbConfig := configConfig.DB
2024-01-03 07:31:42 +00:00
pebbleDB := store.NewPebbleDB(dbConfig)
2024-06-08 11:32:45 +00:00
pebbleDataProofStore := store.NewPebbleDataProofStore(pebbleDB, zapLogger)
2024-01-03 07:31:42 +00:00
pebbleClockStore := store.NewPebbleClockStore(pebbleDB, zapLogger)
2023-10-28 02:23:55 +00:00
keyConfig := configConfig.Key
fileKeyManager := keys.NewFileKeyManager(keyConfig, zapLogger)
2023-09-03 23:47:09 +00:00
p2PConfig := configConfig.P2P
blossomSub := p2p.NewBlossomSub(p2PConfig, zapLogger)
engineConfig := configConfig.Engine
2024-06-08 11:32:45 +00:00
kzgInclusionProver := crypto.NewKZGInclusionProver(zapLogger)
2024-02-13 07:04:56 +00:00
wesolowskiFrameProver := crypto.NewWesolowskiFrameProver(zapLogger)
masterTimeReel := time.NewMasterTimeReel(zapLogger, pebbleClockStore, engineConfig, wesolowskiFrameProver)
2024-03-21 07:14:45 +00:00
inMemoryPeerInfoManager := p2p.NewInMemoryPeerInfoManager(zapLogger)
masterClockConsensusEngine := master.NewMasterClockConsensusEngine(engineConfig, zapLogger, pebbleClockStore, fileKeyManager, blossomSub, kzgInclusionProver, wesolowskiFrameProver, masterTimeReel, inMemoryPeerInfoManager, selfTestReport)
2024-06-08 11:32:45 +00:00
node, err := newNode(zapLogger, pebbleDataProofStore, pebbleClockStore, fileKeyManager, blossomSub, 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) {
dbConsole, err := newDBConsole(configConfig)
2023-09-09 23:45:47 +00:00
if err != nil {
return nil, err
}
return dbConsole, nil
}
func NewClockStore(configConfig *config.Config) (store.ClockStore, error) {
dbConfig := configConfig.DB
2024-01-03 07:31:42 +00:00
pebbleDB := store.NewPebbleDB(dbConfig)
zapLogger := logger()
2024-01-03 07:31:42 +00:00
pebbleClockStore := store.NewPebbleClockStore(pebbleDB, zapLogger)
return pebbleClockStore, 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
}
func debugLogger() *zap.Logger {
log, err := zap.NewDevelopment()
if err != nil {
panic(err)
}
return log
}
2023-09-03 23:47:09 +00:00
var loggerSet = wire.NewSet(
logger,
)
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)))
var storeSet = wire.NewSet(wire.FieldsOf(new(*config.Config), "DB"), store.NewPebbleDB, wire.Bind(new(store.KVDB), new(*store.PebbleDB)), store.NewPebbleClockStore, store.NewPebbleCoinStore, store.NewPebbleKeyStore, store.NewPebbleDataProofStore, store.NewPeerstoreDatastore, wire.Bind(new(store.ClockStore), new(*store.PebbleClockStore)), wire.Bind(new(store.CoinStore), new(*store.PebbleCoinStore)), wire.Bind(new(store.KeyStore), new(*store.PebbleKeyStore)), wire.Bind(new(store.DataProofStore), new(*store.PebbleDataProofStore)), wire.Bind(new(store.Peerstore), new(*store.PeerstoreDatastore)))
2023-09-09 23:45:47 +00:00
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)))
2023-09-03 23:47:09 +00:00
var engineSet = wire.NewSet(wire.FieldsOf(new(*config.Config), "Engine"), crypto.NewWesolowskiFrameProver, wire.Bind(new(crypto.FrameProver), new(*crypto.WesolowskiFrameProver)), crypto.NewKZGInclusionProver, wire.Bind(new(crypto.InclusionProver), new(*crypto.KZGInclusionProver)), time.NewMasterTimeReel, token.NewTokenExecutionEngine)
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),
),
)