Skip to content

Project Structure

github-actions[bot] edited this page Oct 8, 2026 · 3 revisions

Project Structure

meso-miner/
โ”œโ”€โ”€ *.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
โ”‚   โ”œโ”€โ”€ 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
โ”‚   โ”œโ”€โ”€ control_socket.go         # Control socket server (hotswap, shutdown, status commands)
โ”‚   โ”œโ”€โ”€ 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
โ”‚   โ””โ”€โ”€ Makefile                  # Cross-compile targets (amd64, arm64, darwin)
โ”‚
โ”œโ”€โ”€ hub/                          # [REMOVED v31.3+] Fleet bandwidth dashboard server (deprecated)
โ”‚
โ”œโ”€โ”€ 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
โ”‚
โ”œโ”€โ”€ 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
โ”‚   โ”œโ”€โ”€ 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
โ”‚   โ”œโ”€โ”€ Hub-Setup.md              # [deprecated v31.3+]
โ”‚   โ”œโ”€โ”€ Hub-Dashboard.md          # [deprecated v31.3+]
โ”‚   โ”œโ”€โ”€ 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)
โ”‚   โ”œโ”€โ”€ dash-compat.yml           # Dash/POSIX compatibility check
โ”‚   โ”œโ”€โ”€ release.yml               # Tags a new release, scans (VirusTotal + ClamAV), uploads provider binaries
โ”‚   โ”œโ”€โ”€ shakedown.yml             # Pre-release shakedown: fresh-droplet install + proxy + URL + docker test on v3.23.0-fix.* tags
โ”‚   โ”œโ”€โ”€ shakedown-sweeper.yml     # Every 15 min: destroy orphaned shakedown-ci droplets >3h, reap stale SSH keys
โ”‚   โ”œโ”€โ”€ codeql.yml                # Weekly scheduled CodeQL security scan
โ”‚   โ””โ”€โ”€ upstream_monitor.yml      # Twice-daily: watch urnetwork/connect PRs and commits, Discord alerts
โ”‚
โ””โ”€โ”€ 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_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_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