-
Notifications
You must be signed in to change notification settings - Fork 8
/
main.go
47 lines (37 loc) · 1.06 KB
/
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
44
45
46
47
package main
import (
"embed"
"log"
walletServer "github.com/massalabs/station-massa-wallet/cmd/massa-wallet"
"github.com/massalabs/station-massa-wallet/internal/initialize"
walletApp "github.com/massalabs/station-massa-wallet/pkg/app"
"github.com/massalabs/station-massa-wallet/pkg/wails"
"github.com/massalabs/station-massa-wallet/pkg/wallet"
"github.com/massalabs/station/pkg/logger"
)
//nolint:typecheck,nolintlint
//go:embed all:wails-frontend/dist
var wailsAssets embed.FS
func main() {
err := initialize.Logger()
if err != nil {
log.Fatalf("Failed to initialize logger: %v", err)
}
defer logger.Close()
wallet, err := wallet.New("")
if err != nil {
logger.Fatalf("Failed to initialize wallet: %v", err)
}
app := walletApp.NewWalletApp(wallet)
if walletApp.IsTestMode() {
logger.Info("Wallet is running in test mode")
walletServer.StartServer(app)
} else {
wailApp := wails.NewWailsApp(app, wailsAssets)
go walletServer.StartServer(app)
err = wailApp.Run()
if err != nil {
logger.Fatalf("Failed to run Wails app: %v", err)
}
}
}