-
Notifications
You must be signed in to change notification settings - Fork 13
/
main.go
43 lines (34 loc) · 922 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package main
import (
"fmt"
"github.com/tonkeeper/tongo/liteapi"
"time"
"github.com/tonkeeper/tonproof/config"
_ "net/http/pprof"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
log "github.com/sirupsen/logrus"
)
func main() {
log.Info("Tonproof is running")
config.LoadConfig()
e := echo.New()
e.Use(middleware.RecoverWithConfig(middleware.RecoverConfig{
Skipper: nil,
DisableStackAll: true,
DisablePrintStack: false,
}))
e.Use(middleware.Logger())
var err error
networks["-239"], err = liteapi.NewClientWithDefaultMainnet()
if err != nil {
log.Fatal(err)
}
networks["-3"], err = liteapi.NewClientWithDefaultTestnet()
if err != nil {
log.Fatal(err)
}
h := newHandler(config.Proof.PayloadSignatureKey, time.Duration(config.Proof.ProofLifeTimeSec)*time.Second)
registerHandlers(e, h)
log.Fatal(e.Start(fmt.Sprintf(":%v", config.Config.Port)))
}