4 "github.com/gin-gonic/gin"
5 "github.com/jinzhu/gorm"
7 "github.com/vapor/toolbar/federation/config"
8 serverCommon "github.com/vapor/toolbar/server"
17 func NewServer(db *gorm.DB, cfg *config.Config) *Server {
22 if cfg.API.IsReleaseMode {
23 gin.SetMode(gin.ReleaseMode)
29 func (s *Server) setupRouter() {
31 r.Use(serverCommon.Middleware(s))
33 v1 := r.Group("/api/v1")
34 v1.POST("/federation/list-crosschain-txs", serverCommon.HandlerMiddleware(s.ListCrosschainTxs))
35 v1.GET("/federation/list-chains", serverCommon.HandlerMiddleware(s.ListChains))
40 func (s *Server) Run() {