mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-01-10 22:48:14 -05:00
Co-authored-by: noelwei <fan@scroll.io> Co-authored-by: Rohit Narurkar <rohit.narurkar@proton.me> Co-authored-by: jonastheis <4181434+jonastheis@users.noreply.github.com> Co-authored-by: colinlyguo <colinlyguo@scroll.io> Co-authored-by: colin <102356659+colinlyguo@users.noreply.github.com> Co-authored-by: Morty <70688412+yiweichi@users.noreply.github.com> Co-authored-by: omerfirmak <omerfirmak@users.noreply.github.com>
35 lines
1.1 KiB
Go
35 lines
1.1 KiB
Go
package api
|
|
|
|
import (
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
"github.com/scroll-tech/go-ethereum/log"
|
|
"github.com/scroll-tech/go-ethereum/params"
|
|
"gorm.io/gorm"
|
|
|
|
"scroll-tech/coordinator/internal/config"
|
|
"scroll-tech/coordinator/internal/logic/verifier"
|
|
)
|
|
|
|
var (
|
|
// GetTask the prover task controller
|
|
GetTask *GetTaskController
|
|
// SubmitProof the submit proof controller
|
|
SubmitProof *SubmitProofController
|
|
// Auth the auth controller
|
|
Auth *AuthController
|
|
)
|
|
|
|
// InitController inits Controller with database
|
|
func InitController(cfg *config.Config, chainCfg *params.ChainConfig, db *gorm.DB, reg prometheus.Registerer) {
|
|
vf, err := verifier.NewVerifier(cfg.ProverManager.Verifier)
|
|
if err != nil {
|
|
panic("proof receiver new verifier failure")
|
|
}
|
|
|
|
log.Info("verifier created", "chunkVerifier", vf.ChunkVKMap, "batchVerifier", vf.BatchVKMap, "bundleVerifier", vf.BundleVkMap, "openVmVerifier", vf.OpenVMVkMap)
|
|
|
|
Auth = NewAuthController(db, cfg, vf)
|
|
GetTask = NewGetTaskController(cfg, chainCfg, db, reg)
|
|
SubmitProof = NewSubmitProofController(cfg, chainCfg, db, vf, reg)
|
|
}
|