feat(coordinator): add prover rest api (#716)

Co-authored-by: colinlyguo <colinlyguo@scroll.io>
This commit is contained in:
georgehao
2023-08-04 20:48:17 +08:00
committed by GitHub
parent d11de12637
commit fcf34edbfb
64 changed files with 2366 additions and 15500 deletions

View File

@@ -0,0 +1,32 @@
package api
import (
"sync"
"gorm.io/gorm"
"scroll-tech/coordinator/internal/config"
)
var (
// GetTask the prover task controller
GetTask *GetTaskController
// SubmitProof the submit proof controller
SubmitProof *SubmitProofController
// HealthCheck the health check controller
HealthCheck *HealthCheckController
// Auth the auth controller
Auth *AuthController
initControllerOnce sync.Once
)
// InitController inits Controller with database
func InitController(cfg *config.Config, db *gorm.DB) {
initControllerOnce.Do(func() {
Auth = NewAuthController(db)
HealthCheck = NewHealthCheckController()
GetTask = NewGetTaskController(cfg, db)
SubmitProof = NewSubmitProofController(cfg, db)
})
}