dero-swaps/main.go

41 lines
628 B
Go
Raw Permalink Normal View History

2024-04-11 14:35:17 +02:00
package main
import (
"log"
"os"
2024-04-20 22:23:48 +02:00
"swap-client/cfg"
"swap-client/coin"
2024-04-11 14:35:17 +02:00
"github.com/robfig/cron/v3"
)
func Init() {
// create all swap directories
os.MkdirAll("swaps/active", 0755)
os.MkdirAll("swaps/expired", 0755)
os.MkdirAll("swaps/done", 0755)
}
func main() {
Init()
cfg.LoadConfig()
if !cfg.CheckConfig() {
log.Println("Configuration error. Please check config file!")
os.Exit(1)
}
2024-04-20 22:23:48 +02:00
cfg.LoadWallets()
2024-04-11 14:35:17 +02:00
coin.Locked.LoadLockedBalance()
c := cron.New()
c.AddFunc("@every 1m", UpdateMarkets)
c.AddFunc("@every 2m", Delay.CheckBackoff)
c.Start()
go Swap_Controller()
2024-04-20 22:23:48 +02:00
StartClient(cfg.Server_URL)
2024-04-11 14:35:17 +02:00
}