add gateway token-based node registration over host:port and shared nodes manager

This commit is contained in:
DBT
2026-02-24 16:06:44 +00:00
parent 42a5be0cec
commit 07cf54538e
8 changed files with 100 additions and 6 deletions

View File

@@ -23,6 +23,7 @@ import (
"clawgo/pkg/cron"
"clawgo/pkg/heartbeat"
"clawgo/pkg/logger"
"clawgo/pkg/nodes"
"clawgo/pkg/providers"
"clawgo/pkg/runtimecfg"
"clawgo/pkg/sentinel"
@@ -176,6 +177,13 @@ func gatewayCmd() {
fmt.Printf("Error starting channels: %v\n", err)
}
registryServer := nodes.NewRegistryServer(cfg.Gateway.Host, cfg.Gateway.Port, cfg.Gateway.Token, nodes.DefaultManager())
if err := registryServer.Start(ctx); err != nil {
fmt.Printf("Error starting node registry server: %v\n", err)
} else {
fmt.Printf("✓ Node registry server started on %s:%d\n", cfg.Gateway.Host, cfg.Gateway.Port)
}
go agentLoop.Run(ctx)
go runGatewayStartupCompactionCheck(ctx, agentLoop)
go runGatewayBootstrapInit(ctx, cfg, agentLoop)