mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-04 15:52:27 +08:00
添加了节点服务器,各个服务器之间支持多对多
This commit is contained in:
12
cmd/node/application.toml
Normal file
12
cmd/node/application.toml
Normal file
@@ -0,0 +1,12 @@
|
||||
[hk4e]
|
||||
kcp_addr = "127.0.0.1"
|
||||
kcp_port = 22103
|
||||
|
||||
[logger]
|
||||
level = "DEBUG"
|
||||
mode = "BOTH"
|
||||
track = true
|
||||
max_size = 10485760
|
||||
|
||||
[mq]
|
||||
nats_url = "nats://nats:4222"
|
||||
31
cmd/node/main.go
Normal file
31
cmd/node/main.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"fmt"
|
||||
_ "net/http/pprof"
|
||||
"os"
|
||||
|
||||
"hk4e/node/app"
|
||||
"hk4e/pkg/statsviz_serve"
|
||||
)
|
||||
|
||||
var (
|
||||
config = flag.String("config", "application.toml", "config file")
|
||||
)
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
go func() {
|
||||
err := statsviz_serve.Serve("0.0.0.0:1234")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}()
|
||||
err := app.Run(context.TODO(), *config)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user