OSDN Git Service

feat: init cross_tx keepers (#146)
[bytom/vapor.git] / cmd / fedd / main.go
1 package main
2
3 import (
4         "sync"
5
6         log "github.com/sirupsen/logrus"
7
8         "github.com/vapor/federation/config"
9         "github.com/vapor/federation/database"
10         "github.com/vapor/federation/synchron"
11 )
12
13 func main() {
14         cfg := config.NewConfig()
15         db, err := database.NewMySQLDB(cfg.MySQLConfig)
16         if err != nil {
17                 log.WithField("err", err).Panic("initialize mysql db error")
18         }
19
20         go synchron.NewMainchainKeeper(db, &cfg.Mainchain).Run()
21         go synchron.NewSidechainKeeper(db, &cfg.Sidechain).Run()
22
23         // keep the main func running in case of terminating goroutines
24         var wg sync.WaitGroup
25         wg.Add(1)
26         wg.Wait()
27 }