Skip to content

Project Structure

github-actions[bot] edited this page Oct 9, 2026 · 18 revisions

Project Structure

urnetwork-3.23-fix/
โ”œโ”€โ”€ *.go                          # Core network stack (root package)
โ”œโ”€โ”€ go.mod / go.sum               # Module: github.com/urnetwork/connect (Go 1.27)
โ”œโ”€โ”€ Dockerfile                    # Alpine multi-arch provider image
โ”œโ”€โ”€ CHANGELOG.md                  # Version history with per-release notes
โ”œโ”€โ”€ FORK_CHANGES.md               # Delta summary vs upstream urnetwork/connect
โ”œโ”€โ”€ CODESTYLE.md                  # Go conventions for this codebase
โ”‚
โ”œโ”€โ”€ provider/                     # Provider CLI binary
โ”‚   โ”œโ”€โ”€ main.go                   # Entrypoint: auth / provide / auth-provide commands
โ”‚   โ”œโ”€โ”€ proxy_health_log.go       # Per-proxy health state machine and dead-proxy detection
โ”‚   โ”œโ”€โ”€ proxy_slow_retry.go       # Slow-retry state: 24h daily gate, 14-day drop ceiling, persistence
โ”‚   โ”œโ”€โ”€ proxy_reload.go           # SIGHUP-triggered hot-reload of proxy list
โ”‚   โ”œโ”€โ”€ proxy_state.go            # In-memory proxy registry with startup stagger
โ”‚   โ”œโ”€โ”€ proxy_benchmark.go        # Optional per-proxy SOCKS5 latency probes
โ”‚   โ”œโ”€โ”€ bandwidth_reporter.go     # Posts bandwidth metrics to configured fleet target
โ”‚   โ”œโ”€โ”€ proxy_id.go               # Stable proxy identity across reloads
โ”‚   โ”œโ”€โ”€ claim_credential.go       # `provider claim` credential choice (store client, client jwt file, legacy coldkey)
โ”‚   โ”œโ”€โ”€ thrash_watchdog.go        # Swap-thrash watchdog, supervised exit-75 restart, container opt-in
โ”‚   โ”œโ”€โ”€ shmlog_linux.go           # Linux shared-memory log ring buffer
โ”‚   โ”œโ”€โ”€ shmlog_fallback.go        # Fallback for non-Linux builds
โ”‚   โ”œโ”€โ”€ direct.go                 # Dynamic direct native connection controller
โ”‚   โ”œโ”€โ”€ proxy_paste.go            # Bulk proxy ingestion and format normalization
โ”‚   โ”œโ”€โ”€ ssrf_guard.go             # SSRF guard for proxy source URL fetching
โ”‚   โ”œโ”€โ”€ doh_cache.go              # Persistent DNS-over-HTTPS resolver cache
โ”‚   โ”œโ”€โ”€ client_jwt_hotrestart.go  # Identity snapshotting across hot restarts
โ”‚   โ”œโ”€โ”€ read_fd_frac_unix.go      # Linux/Unix file descriptor pressure reader
โ”‚   โ”œโ”€โ”€ read_fd_frac_windows.go   # Windows file descriptor pressure stub
โ”‚   โ”œโ”€โ”€ dup_linux_arm64.go        # ARM64-specific fd dup shim
โ”‚   โ”œโ”€โ”€ dup_linux_generic.go      # Generic Linux fd dup shim
โ”‚   โ”œโ”€โ”€ hotswap_windows.go        # Windows HotSwap via named pipes
โ”‚   โ”œโ”€โ”€ hotswap_unix.go           # Linux HotSwap via Unix sockets
โ”‚   โ”œโ”€โ”€ hotswap.go                # HotSwap handoff coordination (spawn, takeover, drain)
โ”‚   โ”œโ”€โ”€ control_socket.go         # Control socket server (hotswap, shutdown, status commands)
โ”‚   โ”œโ”€โ”€ audit_ring.go             # 1000-entry command audit ring, persisted to audit.json
โ”‚   โ”œโ”€โ”€ systemd_status.go         # Proxy-liveness counters and sliding STATUS= severity
โ”‚   โ”œโ”€โ”€ control_state.go          # Persistent provider state management
โ”‚   โ”œโ”€โ”€ restrict_socket_windows.go # Windows DACL socket permission hardening
โ”‚   โ”œโ”€โ”€ metrics_listen.go         # Prometheus /metrics HTTP listener
โ”‚   โ”œโ”€โ”€ metrics_provider.go       # Provider-specific metrics registration
โ”‚   โ”œโ”€โ”€ contract_metrics.go       # Per-contract Prometheus counters
โ”‚   โ”œโ”€โ”€ lifetime_metrics.go       # Provider lifetime Prometheus gauges
โ”‚   โ”œโ”€โ”€ oom_cap.go                # OOM-aware start cap (shadow by default) and kill switch
โ”‚   โ”œโ”€โ”€ action_ledger.go          # Audit ledger of capacity decisions (autopilot.jsonl)
โ”‚   โ”œโ”€โ”€ baseline.go               # Local behaviour record (baseline.jsonl) for upgrade comparison
โ”‚   โ”œโ”€โ”€ h3_direct.go              # H3 settings and eligibility for the direct identity
โ”‚   โ”œโ”€โ”€ node_internals.go         # Internals snapshot (goroutines, heap, transport split) served to `top`
โ”‚   โ”œโ”€โ”€ memory_headroom.go        # Low free-memory watcher (host or cgroup headroom log)
โ”‚   โ”œโ”€โ”€ resource_config_warn.go   # Startup warning when memory limits are short for the pool
โ”‚   โ”œโ”€โ”€ smart_dialer_probe.go     # Background connect probes for the smart dialer
โ”‚   โ”œโ”€โ”€ proxy_spread_sampler.go   # Content-keyed spread sampler for the stage-1 table probe
โ”‚   โ”œโ”€โ”€ proxy_direct_grade.go     # Read-only direct-path health grade (~/.urnetwork/direct_grade.json)
โ”‚   โ””โ”€โ”€ Makefile                  # Cross-compile targets (amd64, arm64, darwin)
โ”‚
โ”œโ”€โ”€ protocol/                     # Protobuf definitions and generated Go code
โ”‚   โ”œโ”€โ”€ *.proto                   # Source definitions (ip, transfer, frame, extender, audit)
โ”‚   โ”œโ”€โ”€ *.pb.go                   # Generated โ€” do not edit directly
โ”‚   โ””โ”€โ”€ Makefile                  # Runs protoc to regenerate pb.go files
โ”‚
โ”œโ”€โ”€ extender/                     # Extender transport implementation
โ”‚   โ”œโ”€โ”€ extender.go               # Client-side extender connection handler
โ”‚   โ””โ”€โ”€ extender_test.go
โ”‚
โ”œโ”€โ”€ connectctl/                   # connectctl CLI (upstream tool, unmodified)
โ”‚
โ”œโ”€โ”€ api/                          # API client bindings
โ”‚   โ”œโ”€โ”€ bringyour.yml             # API endpoint definitions
โ”‚   โ””โ”€โ”€ test.sh
โ”‚
โ”œโ”€โ”€ docker/                       # Docker startup scripts
โ”‚   โ”œโ”€โ”€ scripts/                  # start_jwt.sh, start_stable.sh, start_nightly.sh, urnet-tools.sh
โ”‚   โ””โ”€โ”€ ...                       # Selected by BUILD env var at container start
โ”‚
โ”œโ”€โ”€ pelican/                      # Pelican game-server panel egg
โ”‚   โ”œโ”€โ”€ egg-urnetwork-323fix.json # PLCN_v3 egg definition (BUILD, USER_AUTH, PASSWORD, AUTHCODE)
โ”‚   โ””โ”€โ”€ README.md                 # Panel deployment guide, env vars, PELICAN-gated updates
โ”‚
โ”œโ”€โ”€ workers/                      # Cloudflare Worker sources (dl.fullbars.xyz + friends)
โ”‚   โ”œโ”€โ”€ dl/                       # Script proxy + install.fullbars.xyz smart dispatcher/landing page
โ”‚   โ”œโ”€โ”€ dl-fullbars/               # latest-version + releases/download GitHub release mirror
โ”‚   โ”œโ”€โ”€ geo/                       # geo.fullbars.xyz โ€” client geo/RTT info endpoint
โ”‚   โ”œโ”€โ”€ provider-redirect/         # provider.fullbars.xyz -> GitHub 301 redirect
โ”‚   โ””โ”€โ”€ README.md                  # Routes, deploy notes, wrangler usage
โ”‚
โ”œโ”€โ”€ cmd/                         # Go binaries (v3.23.0-fix.27.0+)
โ”‚   โ”œโ”€โ”€ urnet-tools/             # Provider-aware fleet ops tool (process/systemd)
โ”‚   โ””โ”€โ”€ urnet-docker/            # Container variant (docker exec delegation)
โ”‚
โ”œโ”€โ”€ internal/urnettools/         # Shared Go core for the urnet-tools binaries
โ”‚   โ”œโ”€โ”€ cli.go                   # Dispatch, flag parsing, confirm gates
โ”‚   โ”œโ”€โ”€ target.go                # Targeting (--unit/--user/--network/--network-id/--state-dir)
โ”‚   โ”œโ”€โ”€ discover.go              # Provider discovery (/proc + systemd units)
โ”‚   โ”œโ”€โ”€ update.go                # Interactive-first update, digest verify, atomic swap
โ”‚   โ”œโ”€โ”€ legacy_cmds.go           # Reporting config, lifecycle, tuning, and proxy commands
โ”‚   โ”œโ”€โ”€ autopilot.go             # autopilot log: timeline of capacity decisions (OOM cap, trim)
โ”‚   โ”œโ”€โ”€ baseline.go              # baseline show/mark/compare: this box's own record
โ”‚   โ”œโ”€โ”€ internals.go             # Internals snapshot for the `top` panel (transport split)
โ”‚   โ”œโ”€โ”€ log_stream.go            # Native log follower: last lines, then follow; rotation and truncation aware
โ”‚   โ”œโ”€โ”€ log_follow_open_*.go     # Per-OS open for the follower (Windows: FILE_SHARE_DELETE, paths over MAX_PATH)
โ”‚   โ”œโ”€โ”€ lifecycle_start_windows.go   # Windows provider start (schtasks/detached)
โ”‚   โ”œโ”€โ”€ lifecycle_stop_windows.go    # Windows provider stop (socket shutdown + TerminateProcess)
โ”‚   โ”œโ”€โ”€ lifecycle_restart_windows.go # Windows provider restart (HotSwap fallback)
โ”‚   โ”œโ”€โ”€ lifecycle_windows.go         # Windows lifecycle helpers (schtasks, task naming)
โ”‚   โ”œโ”€โ”€ lifecycle_stubs_notwindows.go # Stubs for non-Windows builds
โ”‚   โ”œโ”€โ”€ hotswap_windows.go           # Windows HotSwap candidate launch
โ”‚   โ””โ”€โ”€ ...                      # + tests (~73)
โ”‚
โ”œโ”€โ”€ scripts/                      # Installer and test scripts (installer stays shell)
โ”‚   โ”œโ”€โ”€ Provider_Install_Linux.sh # One-command provider install for Linux (installs the Go urnet-tools)
โ”‚   โ”œโ”€โ”€ Provider_Install_Win32.ps1
โ”‚   โ”œโ”€โ”€ Provider_Uninstall_Linux.sh
โ”‚   โ”œโ”€โ”€ Provider_Uninstall_Win32.ps1
โ”‚   โ”œโ”€โ”€ test_provider_install.sh  # CI: validates installer script logic
โ”‚   โ””โ”€โ”€ test_fallback_logic.sh    # CI: validates fallback behavior
โ”‚
โ”œโ”€โ”€ docs/                         # Operational documentation
โ”‚   โ”œโ”€โ”€ Configuration.md
โ”‚   โ”œโ”€โ”€ Docker-Deployment.md
โ”‚   โ”œโ”€โ”€ Installation.md
โ”‚   โ”œโ”€โ”€ High-Volume-Performance-Tuning.md
โ”‚   โ”œโ”€โ”€ Multi-Container-Scaling.md
โ”‚   โ”œโ”€โ”€ Proxy-Management.md
โ”‚   โ”œโ”€โ”€ Proxy-URL-Sources.md
โ”‚   โ”œโ”€โ”€ Traffic-Amplification.md
โ”‚   โ”œโ”€โ”€ Adding-Proxies.md
โ”‚   โ”œโ”€โ”€ Bittensor-Operations.md
โ”‚   โ”œโ”€โ”€ Troubleshooting.md
โ”‚   โ””โ”€โ”€ design/                   # Internal design docs (proxy health, hot-reload, bandwidth)
โ”‚
โ”œโ”€โ”€ monitoring/                   # Prometheus + Grafana observability stack
โ”‚   โ”œโ”€โ”€ docker-compose.yml        # Prometheus + Grafana stack
โ”‚   โ”œโ”€โ”€ grafana/                  # Grafana dashboards and provisioning
โ”‚   โ”œโ”€โ”€ prometheus/               # Prometheus scrape configuration
โ”‚   โ””โ”€โ”€ setup.sh                  # Monitoring stack setup script
โ”‚
โ”œโ”€โ”€ releases/                     # Per-version release notes (v3.23.0-fix.*)
โ”‚
โ”œโ”€โ”€ .github/workflows/
โ”‚   โ”œโ”€โ”€ build.yml                 # CI: parallel test-and-lint + build-and-push Docker (multi-arch)
โ”‚   โ”œโ”€โ”€ release.yml               # Tag push: builds provider binaries (multi-GOOS), scans (VirusTotal + ClamAV), publishes the release
โ”‚   โ”œโ”€โ”€ shakedown.yml             # Pre-release shakedown: fresh-droplet install + proxy + URL + docker test on v3.23.0-fix.* tags
โ”‚   โ”œโ”€โ”€ docker-shakedown.yml      # Docker shakedown on v3.23.0-fix.* tags
โ”‚   โ”œโ”€โ”€ codeql.yml                # Weekly scheduled CodeQL security scan
โ”‚   โ”œโ”€โ”€ dash-compat.yml           # Dash/POSIX compatibility check
โ”‚   โ”œโ”€โ”€ unix-lifecycle.yml        # Unix lifecycle verification (push to main + PR)
โ”‚   โ”œโ”€โ”€ windows-lifecycle.yml     # Windows lifecycle verification (push to main + PR)
โ”‚   โ”œโ”€โ”€ lifecycle-stress.yml      # Lifecycle stress test (PRs touching provider/, daily, manual)
โ”‚   โ”œโ”€โ”€ docker-multi-container.yml # Multi-container scaling test (fix/* pushes + manual)
โ”‚   โ”œโ”€โ”€ tool-functional-smoke.yml # urnet-tools functional smoke (main + PR, manual)
โ”‚   โ”œโ”€โ”€ functional-soak.yml       # Three-hour functional soak (manual only)
โ”‚   โ”œโ”€โ”€ cfaa-blocklist-sync.yml   # Twice-daily CFAA blocklist data refresh from upstream
โ”‚   โ”œโ”€โ”€ upstream_monitor.yml      # Twice-daily: watch urnetwork/connect PRs and commits, Discord alerts
โ”‚   โ”œโ”€โ”€ wiki-sync.yml             # On docs/** push: copy docs/*.md into the GitHub wiki
โ”‚   โ””โ”€โ”€ pr-labeler.yml            # Label pull requests
โ”‚
โ””โ”€โ”€ Root package files (core network stack):
    โ”œโ”€โ”€ ip.go                     # IP packet relay core (81 KB)
    โ”œโ”€โ”€ ip_remote_multi_client.go # Multi-client relay coordinator
    โ”œโ”€โ”€ ip_security.go            # Pre-compiled IP blocklist (2.3 MB)
    โ”œโ”€โ”€ transfer.go               # Contract-based bandwidth allocation
    โ”œโ”€โ”€ transfer_contract_manager.go  # Per-proxy contract lifecycle
    โ”œโ”€โ”€ transfer_route_manager.go     # Adaptive routing with RTT tracking
    โ”œโ”€โ”€ transfer_rtt.go           # RTT window measurement
    โ”œโ”€โ”€ transfer_encrypt.go       # Per-contract encryption
    โ”œโ”€โ”€ transfer_queue.go         # Backpressure queue
    โ”œโ”€โ”€ transport.go              # Transport abstraction layer
    โ”œโ”€โ”€ transport_h3_gate.go      # Runtime on/off gate for the H3 transport
    โ”œโ”€โ”€ transport_h3_counted.go   # Byte-counting wrapper for the H3 UDP socket
    โ”œโ”€โ”€ transport_h3_datagram.go  # QUIC DATAGRAM message layer and receive route
    โ”œโ”€โ”€ transport_h3_datagram_lane.go  # Bounded send lane for outgoing datagrams
    โ”œโ”€โ”€ transport_h3_datagram_state.go # DATAGRAM counters shown on the [health] line
    โ”œโ”€โ”€ transport_h3_memory.go    # H3 memory bound
    โ”œโ”€โ”€ transport_mode_stats.go   # Payload frames and bytes per transport mode
    โ”œโ”€โ”€ transport_p2p_webrtc.go   # WebRTC P2P transport
    โ”œโ”€โ”€ transport_pt.go           # Pluggable tunnel transport
    โ”œโ”€โ”€ net_http.go               # HTTP proxy with chunked encoding
    โ”œโ”€โ”€ net_http_doh.go           # DNS-over-HTTPS resolver
    โ”œโ”€โ”€ net_http_smart_dialer.go  # Smart dialer: measured-cost transport preference (off by default)
    โ”œโ”€โ”€ emoji/                    # Network tag validation and suggestion (copied from upstream)
    โ”œโ”€โ”€ net_resilient.go          # Platform-aware resilient connections
    โ”œโ”€โ”€ message_pool.go           # GC-reducing byte buffer pool
    โ”œโ”€โ”€ proxy_health.go           # Proxy health scoring
    โ”œโ”€โ”€ tuning.go                 # Auto-tuning (turbo/lowmem modes)
    โ”œโ”€โ”€ log.go                    # Structured logging helpers
    โ”œโ”€โ”€ metrics_prometheus.go     # Prometheus metrics registry and collector
    โ””โ”€โ”€ connect.go                # Top-level client/server entrypoint

Clone this wiki locally