Removed dead code

This commit is contained in:
anonpenguin23 2026-02-11 07:24:27 +02:00
parent b305f562d7
commit 888df0385e
7 changed files with 3 additions and 105 deletions

View File

@ -478,11 +478,6 @@ func GetAPIKey() string {
return apiKey
}
// GetJWT returns the gateway JWT token (currently not auto-discovered)
func GetJWT() string {
return ""
}
// GetBootstrapPeers returns bootstrap peer addresses from config
func GetBootstrapPeers() []string {
cacheMutex.RLock()
@ -748,10 +743,6 @@ func NewNetworkClient(t *testing.T) client.NetworkClient {
cfg.APIKey = GetAPIKey()
cfg.QuietMode = true // Suppress debug logs in tests
if jwt := GetJWT(); jwt != "" {
cfg.JWT = jwt
}
if peers := GetBootstrapPeers(); len(peers) > 0 {
cfg.BootstrapPeers = peers
}

View File

@ -249,9 +249,7 @@ var (
ErrNoNodesAvailable = &DeploymentError{Message: "no nodes available for deployment"}
ErrDeploymentNotFound = &DeploymentError{Message: "deployment not found"}
ErrNamespaceNotAssigned = &DeploymentError{Message: "namespace has no home node assigned"}
ErrInvalidDeploymentType = &DeploymentError{Message: "invalid deployment type"}
ErrSubdomainTaken = &DeploymentError{Message: "subdomain already in use"}
ErrDomainReserved = &DeploymentError{Message: "domain is reserved"}
)
// DeploymentError represents a deployment-related error

View File

@ -24,7 +24,6 @@ type HTTPGateway struct {
logger *logging.ColoredLogger
config *config.HTTPGatewayConfig
router chi.Router
reverseProxies map[string]*httputil.ReverseProxy
mu sync.RWMutex
server *http.Server
}
@ -47,7 +46,6 @@ func NewHTTPGateway(logger *logging.ColoredLogger, cfg *config.HTTPGatewayConfig
logger: logger,
config: cfg,
router: chi.NewRouter(),
reverseProxies: make(map[string]*httputil.ReverseProxy),
}
// Set up router middleware
@ -110,8 +108,6 @@ func (hg *HTTPGateway) initializeRoutes() error {
}
}
hg.reverseProxies[routeName] = proxy
// Register route handler
hg.registerRouteHandler(routeName, routeConfig, proxy)

View File

@ -77,19 +77,6 @@ func parseIPFSPort(rawURL string) (int, error) {
return port, nil
}
func parsePeerHostAndPort(multiaddr string) (string, int) {
parts := strings.Split(multiaddr, "/")
var hostStr string
var port int
for i, part := range parts {
if part == "ip4" || part == "dns" || part == "dns4" {
hostStr = parts[i+1]
} else if part == "tcp" {
fmt.Sscanf(parts[i+1], "%d", &port)
}
}
return hostStr, port
}
func extractIPFromMultiaddrForCluster(maddr string) string {
parts := strings.Split(maddr, "/")

View File

@ -363,23 +363,3 @@ func (cns *ClusterNodeSelector) calculateCapacityScore(
return totalScore
}
// GetNodeByID retrieves a node's information by ID
func (cns *ClusterNodeSelector) GetNodeByID(ctx context.Context, nodeID string) (*nodeInfo, error) {
internalCtx := client.WithInternalAuth(ctx)
var results []nodeInfo
query := `SELECT id, ip_address, COALESCE(internal_ip, ip_address) as internal_ip FROM dns_nodes WHERE id = ? LIMIT 1`
err := cns.db.Query(internalCtx, &results, query, nodeID)
if err != nil {
return nil, &ClusterError{
Message: "failed to query node",
Cause: err,
}
}
if len(results) == 0 {
return nil, nil
}
return &results[0], nil
}

View File

@ -81,36 +81,3 @@ func (m *ModuleLifecycle) ValidateModule(module wazero.CompiledModule) error {
return nil
}
// InstantiateModule creates a module instance for execution.
// Note: This method is currently unused but kept for potential future use.
func (m *ModuleLifecycle) InstantiateModule(ctx context.Context, compiled wazero.CompiledModule, config wazero.ModuleConfig) error {
if compiled == nil {
return fmt.Errorf("compiled module is nil")
}
instance, err := m.runtime.InstantiateModule(ctx, compiled, config)
if err != nil {
return fmt.Errorf("failed to instantiate module: %w", err)
}
// Close immediately - this is just for validation
_ = instance.Close(ctx)
return nil
}
// ModuleInfo provides information about a compiled module.
type ModuleInfo struct {
CID string
SizeBytes int
Compiled bool
}
// GetModuleInfo returns information about a module.
func (m *ModuleLifecycle) GetModuleInfo(wasmCID string, wasmBytes []byte, isCompiled bool) *ModuleInfo {
return &ModuleInfo{
CID: wasmCID,
SizeBytes: len(wasmBytes),
Compiled: isCompiled,
}
}

View File

@ -438,27 +438,6 @@ func (r *Registry) uploadWASM(ctx context.Context, wasmBytes []byte, name string
return resp.Cid, nil
}
// getLatestVersion returns the latest version number for a function.
func (r *Registry) getLatestVersion(ctx context.Context, namespace, name string) (int, error) {
query := `SELECT MAX(version) FROM functions WHERE namespace = ? AND name = ?`
var maxVersion sql.NullInt64
var results []struct {
MaxVersion sql.NullInt64 `db:"max(version)"`
}
if err := r.db.Query(ctx, &results, query, namespace, name); err != nil {
return 0, err
}
if len(results) == 0 || !results[0].MaxVersion.Valid {
return 0, ErrFunctionNotFound
}
maxVersion = results[0].MaxVersion
return int(maxVersion.Int64), nil
}
// getByNameInternal retrieves a function by name regardless of status.
func (r *Registry) getByNameInternal(ctx context.Context, namespace, name string) (*Function, error) {
namespace = strings.TrimSpace(namespace)