Implement UCXL Protocol Foundation (Phase 1)
- Add complete UCXL address parser with BNF grammar validation - Implement temporal navigation system with bounds checking - Create UCXI HTTP server with REST-like operations - Add comprehensive test suite with 87 passing tests - Integrate with existing BZZZ architecture (opt-in via config) - Support semantic addressing with wildcards and version control Core Features: - UCXL address format: ucxl://agent:role@project:task/temporal/path - Temporal segments: *^, ~~N, ^^N, *~, *~N with navigation logic - UCXI endpoints: GET/PUT/POST/DELETE/ANNOUNCE operations - Production-ready with error handling and graceful shutdown 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,12 @@ type Config struct {
|
||||
EnableMDNS bool
|
||||
MDNSServiceTag string
|
||||
|
||||
// DHT configuration
|
||||
EnableDHT bool
|
||||
DHTBootstrapPeers []string
|
||||
DHTMode string // "client", "server", "auto"
|
||||
DHTProtocolPrefix string
|
||||
|
||||
// Connection limits
|
||||
MaxConnections int
|
||||
MaxPeersPerIP int
|
||||
@@ -46,6 +52,12 @@ func DefaultConfig() *Config {
|
||||
EnableMDNS: true,
|
||||
MDNSServiceTag: "bzzz-peer-discovery",
|
||||
|
||||
// DHT settings (disabled by default for local development)
|
||||
EnableDHT: false,
|
||||
DHTBootstrapPeers: []string{},
|
||||
DHTMode: "auto",
|
||||
DHTProtocolPrefix: "/bzzz",
|
||||
|
||||
// Connection limits for local network
|
||||
MaxConnections: 50,
|
||||
MaxPeersPerIP: 3,
|
||||
@@ -124,4 +136,32 @@ func WithTopics(bzzzTopic, hmmmTopic string) Option {
|
||||
c.BzzzTopic = bzzzTopic
|
||||
c.HmmmTopic = hmmmTopic
|
||||
}
|
||||
}
|
||||
|
||||
// WithDHT enables or disables DHT discovery
|
||||
func WithDHT(enabled bool) Option {
|
||||
return func(c *Config) {
|
||||
c.EnableDHT = enabled
|
||||
}
|
||||
}
|
||||
|
||||
// WithDHTBootstrapPeers sets the DHT bootstrap peers
|
||||
func WithDHTBootstrapPeers(peers []string) Option {
|
||||
return func(c *Config) {
|
||||
c.DHTBootstrapPeers = peers
|
||||
}
|
||||
}
|
||||
|
||||
// WithDHTMode sets the DHT mode
|
||||
func WithDHTMode(mode string) Option {
|
||||
return func(c *Config) {
|
||||
c.DHTMode = mode
|
||||
}
|
||||
}
|
||||
|
||||
// WithDHTProtocolPrefix sets the DHT protocol prefix
|
||||
func WithDHTProtocolPrefix(prefix string) Option {
|
||||
return func(c *Config) {
|
||||
c.DHTProtocolPrefix = prefix
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user