package main

import (
	"github.com/gin-gonic/gin"

	"chain33-pai/pkg/logging"
	"chain33-pai/pkg/setting"
	"chain33-pai/models"
	"chain33-pai/pkg/util"
	"chain33-pai/miner"
	"chain33-pai/pkg/chain33"
	"net/http"
)

func init() {
	setting.Setup()
	models.Setup()
	logging.Setup()
	//gredis.Setup()
	chain33.Setup()
	util.Setup()
	miner.Setup()
}

// @title Golang Gin API
// @version 1.0
// @description An example of gin
// @termsOfService https://chain33-pai
// @license.name MIT
// @license.url https://chain33-pai/blob/master/LICENSE
func main() {
	gin.SetMode(setting.ServerSetting.RunMode)
	go func() {
		http.ListenAndServe("0.0.0.0:6061", nil)
	}()
	go miner.SyncBlock()
	select{}
}
