6 log "github.com/sirupsen/logrus"
8 "github.com/vapor/toolbar/federation/api"
9 "github.com/vapor/toolbar/federation/config"
10 "github.com/vapor/toolbar/federation/database"
11 "github.com/vapor/toolbar/common"
12 "github.com/vapor/toolbar/federation/synchron"
16 cfg := config.NewConfig()
17 db, err := common.NewMySQLDB(cfg.MySQLConfig)
19 log.WithField("err", err).Panic("initialize mysql db error")
22 assetStore := database.NewAssetStore(db)
23 go synchron.NewMainchainKeeper(db, assetStore, cfg).Run()
24 go synchron.NewSidechainKeeper(db, assetStore, cfg).Run()
25 go api.NewServer(db, cfg).Run()
27 // keep the main func running in case of terminating goroutines