-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
38 lines (30 loc) · 934 Bytes
/
main.go
File metadata and controls
38 lines (30 loc) · 934 Bytes
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
package main
import (
_ "embed"
"log"
"path/filepath"
"github.com/massalabs/node-manager-plugin/int/api"
"github.com/massalabs/node-manager-plugin/int/config"
"github.com/massalabs/node-manager-plugin/int/utils"
"github.com/massalabs/station/pkg/logger"
)
const pluginLogPath = "pluginLogs"
func main() {
execDir, err := utils.GetExecDirPath()
if err != nil {
log.Fatalf("failed to get executable directory path: %v", err)
}
logPath := filepath.Join(execDir, pluginLogPath, "node-manager-plugin.log")
err = logger.InitializeGlobal(logPath)
if err != nil {
log.Fatalf("failed to initialize logger: %v", err)
}
pluginConfig, err := config.RetrieveConfig()
if err != nil {
logger.Fatalf("failed to load node manager configuration : %v", err)
}
// Create and start the API with the plugin directory
nodePlugin := api.NewAPI(pluginConfig)
nodePlugin.Start()
logger.Warnf("node manager plugin stopped")
}