cmd

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const Copyright string = `` /* 188-byte string literal not displayed */

Variables

View Source
var CommonFlags []cli.Flag = []cli.Flag{
	&cli.StringFlag{
		Name:    "config",
		Usage:   "Specify a path to a edgevpn config file",
		EnvVars: []string{"EDGEVPNCONFIG"},
	},
	&cli.StringSliceFlag{
		Name:    "listen-maddrs",
		Usage:   "Override default 0.0.0.0 listen multiaddresses",
		EnvVars: []string{"EDGEVPNLISTENMADDRS"},
	},
	&cli.StringSliceFlag{
		Name:    "dht-announce-maddrs",
		Usage:   "Override listen-maddrs on DHT announce",
		EnvVars: []string{"EDGEVPNDHTANNOUNCEMADDRS"},
	},
	&cli.StringFlag{
		Name:    "timeout",
		Usage:   "Specify a default timeout for connection stream",
		EnvVars: []string{"EDGEVPNTIMEOUT"},
		Value:   "15s",
	},
	&cli.IntFlag{
		Name:    "mtu",
		Usage:   "Specify a mtu",
		EnvVars: []string{"EDGEVPNMTU"},
		Value:   1200,
	},
	&cli.BoolFlag{
		Name:    "bootstrap-iface",
		Usage:   "Setup interface on startup (need privileges)",
		EnvVars: []string{"EDGEVPNBOOTSTRAPIFACE"},
		Value:   true,
	},
	&cli.IntFlag{
		Name:    "packet-mtu",
		Usage:   "Specify a mtu",
		EnvVars: []string{"EDGEVPNPACKETMTU"},
		Value:   1420,
	},
	&cli.IntFlag{
		Name:    "channel-buffer-size",
		Usage:   "Specify a channel buffer size",
		EnvVars: []string{"EDGEVPNCHANNELBUFFERSIZE"},
		Value:   0,
	},
	&cli.IntFlag{
		Name:    "discovery-interval",
		Usage:   "DHT discovery interval time",
		EnvVars: []string{"EDGEVPNDHTINTERVAL"},
		Value:   720,
	},
	&cli.IntFlag{
		Name:    "ledger-announce-interval",
		Usage:   "Ledger announce interval time",
		EnvVars: []string{"EDGEVPNLEDGERINTERVAL"},
		Value:   10,
	},
	&cli.StringFlag{
		Name:    "autorelay-discovery-interval",
		Usage:   "Autorelay discovery interval",
		EnvVars: []string{"EDGEVPNAUTORELAYDISCOVERYINTERVAL"},
		Value:   "5m",
	},
	&cli.BoolFlag{
		Name:    "autorelay-static-only",
		Usage:   "Use only defined static relays",
		EnvVars: []string{"EDGEVPNAUTORELAYSTATICONLY"},
	},
	&cli.IntFlag{
		Name:    "ledger-synchronization-interval",
		Usage:   "Ledger synchronization interval time",
		EnvVars: []string{"EDGEVPNLEDGERSYNCINTERVAL"},
		Value:   10,
	},
	&cli.IntFlag{
		Name:    "nat-ratelimit-global",
		Usage:   "Rate limit global requests",
		EnvVars: []string{"EDGEVPNNATRATELIMITGLOBAL"},
		Value:   10,
	},
	&cli.IntFlag{
		Name:    "nat-ratelimit-peer",
		Usage:   "Rate limit perr requests",
		EnvVars: []string{"EDGEVPNNATRATELIMITPEER"},
		Value:   10,
	},
	&cli.IntFlag{
		Name:    "nat-ratelimit-interval",
		Usage:   "Rate limit interval",
		EnvVars: []string{"EDGEVPNNATRATELIMITINTERVAL"},
		Value:   60,
	},
	&cli.BoolFlag{
		Name:    "nat-ratelimit",
		Usage:   "Changes the default rate limiting configured in helping other peers determine their reachability status",
		EnvVars: []string{"EDGEVPNNATRATELIMIT"},
		Value:   true,
	},
	&cli.IntFlag{
		Name:    "max-connections",
		Usage:   "Max connections",
		EnvVars: []string{"EDGEVPNMAXCONNS"},
		Value:   0,
	},
	&cli.StringFlag{
		Name:    "ledger-state",
		Usage:   "Specify a ledger state directory",
		EnvVars: []string{"EDGEVPNLEDGERSTATE"},
	},
	&cli.BoolFlag{
		Name:    "mdns",
		Usage:   "Enable mDNS for peer discovery",
		EnvVars: []string{"EDGEVPNMDNS"},
		Value:   true,
	},
	&cli.BoolFlag{
		Name:    "autorelay",
		Usage:   "Automatically act as a relay if the node can accept inbound connections",
		EnvVars: []string{"EDGEVPNAUTORELAY"},
		Value:   true,
	},
	&cli.IntFlag{
		Name:  "concurrency",
		Usage: "Number of concurrent requests to serve",
		Value: runtime.NumCPU(),
	},
	&cli.BoolFlag{
		Name:    "holepunch",
		Usage:   "Automatically try holepunching when possible",
		EnvVars: []string{"EDGEVPNHOLEPUNCH"},
		Value:   true,
	},
	&cli.BoolFlag{
		Name:    "natservice",
		Usage:   "Tries to determine reachability status of nodes",
		EnvVars: []string{"EDGEVPNNATSERVICE"},
		Value:   true,
	},
	&cli.BoolFlag{
		Name:    "natmap",
		Usage:   "Tries to open a port in the firewall via upnp",
		EnvVars: []string{"EDGEVPNNATMAP"},
		Value:   true,
	},
	&cli.BoolFlag{
		Name:    "dht",
		Usage:   "Enable DHT for peer discovery",
		EnvVars: []string{"EDGEVPNDHT"},
		Value:   true,
	},
	&cli.BoolFlag{
		Name:    "low-profile",
		Usage:   "Enable low profile. Lowers connections usage",
		EnvVars: []string{"EDGEVPNLOWPROFILE"},
		Value:   true,
	},
	&cli.IntFlag{
		Name:    "aliveness-healthcheck-interval",
		Usage:   "Healthcheck interval",
		EnvVars: []string{"HEALTHCHECKINTERVAL"},
		Value:   120,
	},
	&cli.IntFlag{
		Name:    "aliveness-healthcheck-scrub-interval",
		Usage:   "Healthcheck scrub interval",
		EnvVars: []string{"HEALTHCHECKSCRUBINTERVAL"},
		Value:   600,
	},
	&cli.IntFlag{
		Name:    "aliveness-healthcheck-max-interval",
		Usage:   "Healthcheck max interval. Threshold after a node is determined offline",
		EnvVars: []string{"HEALTHCHECKMAXINTERVAL"},
		Value:   900,
	},
	&cli.StringFlag{
		Name:    "log-level",
		Usage:   "Specify loglevel",
		EnvVars: []string{"EDGEVPNLOGLEVEL"},
		Value:   "info",
	},
	&cli.StringFlag{
		Name:    "libp2p-log-level",
		Usage:   "Specify libp2p loglevel",
		EnvVars: []string{"EDGEVPNLIBP2PLOGLEVEL"},
		Value:   "fatal",
	},
	&cli.StringSliceFlag{
		Name:    "discovery-bootstrap-peers",
		Usage:   "List of discovery peers to use",
		EnvVars: []string{"EDGEVPNBOOTSTRAPPEERS"},
	},
	&cli.IntFlag{
		Name:    "connection-high-water",
		Usage:   "max number of connection allowed",
		EnvVars: []string{"EDGEVPN_CONNECTION_HIGH_WATER"},
		Value:   0,
	},
	&cli.IntFlag{
		Name:    "connection-low-water",
		Usage:   "low number of connection allowed",
		EnvVars: []string{"EDGEVPN_CONNECTION_LOW_WATER"},
		Value:   0,
	},
	&cli.StringSliceFlag{
		Name:    "autorelay-static-peer",
		Usage:   "List of autorelay static peers to use",
		EnvVars: []string{"EDGEVPNAUTORELAYPEERS"},
	},
	&cli.BoolFlag{
		Name:    "relay-service",
		Usage:   "Offer the circuit-v2 relay service to cluster peers (i.e. let other peers reserve a slot on this node and route relayed traffic through us). Disabling does NOT prevent this node from USING other relays as a client via AutoRelay — set this to false on resource-constrained nodes or nodes that should not act as relays.",
		EnvVars: []string{"EDGEVPN_RELAY_SERVICE"},
		Value:   true,
	},
	&cli.BoolFlag{
		Name:    "relay-service-network-only",
		Usage:   "Restrict incoming relay reservations to peers observed in the local ledger's alive bucket (cluster members). Strangers that found us via the public DHT or another relay discovery path are rejected. Requires the alive service to be running. During a short bootstrap window — before the alive bucket is first observed — every reservation is allowed so the node itself can finish joining the cluster. Default ON: secure by default; pass --relay-service-network-only=false to open the relay to all peers.",
		EnvVars: []string{"EDGEVPN_RELAY_SERVICE_NETWORK_ONLY"},
		Value:   true,
	},
	&cli.StringFlag{
		Name:    "relay-service-acl-refresh",
		Usage:   "Cadence at which the NetworkOnly relay-service ACL re-snapshots the alive bucket (Go duration). Should be <= the alive-service announce interval so peer churn is reflected within a couple of ticks.",
		EnvVars: []string{"EDGEVPN_RELAY_SERVICE_ACL_REFRESH"},
		Value:   config.DefaultRelayServiceACLRefresh.String(),
	},
	&cli.Int64Flag{
		Name:    "relay-service-max-data",
		Usage:   "Bytes (per direction) a relayed connection may carry before reset. Higher values let cluster peers carry larger relayed transfers (e.g. model files for distributed inference) at the cost of a larger memory footprint per relay client. Set lower for resource-constrained deployments.",
		EnvVars: []string{"EDGEVPN_RELAY_MAX_DATA"},
		Value:   int64(config.DefaultRelayServiceMaxData),
	},
	&cli.StringFlag{
		Name:    "relay-service-max-duration",
		Usage:   "Maximum lifetime of a single relayed connection (Go duration). Higher values let cluster peers carry longer-running relayed transfers at the cost of holding circuits open. Set lower for resource-constrained deployments.",
		EnvVars: []string{"EDGEVPN_RELAY_MAX_DURATION"},
		Value:   config.DefaultRelayServiceMaxDuration.String(),
	},
	&cli.IntFlag{
		Name:    "relay-service-max-circuits",
		Usage:   "Maximum number of concurrent relay circuits per peer. Higher values let more peers tunnel through this node simultaneously at the cost of a larger memory footprint. Set lower for resource-constrained deployments.",
		EnvVars: []string{"EDGEVPN_RELAY_MAX_CIRCUITS"},
		Value:   config.DefaultRelayServiceMaxCircuits,
	},
	&cli.StringFlag{
		Name:    "relay-service-reservation-ttl",
		Usage:   "Time-to-live of a relay reservation (Go duration). Higher values reduce reservation churn for stable cluster peers; lower values free relay slots faster.",
		EnvVars: []string{"EDGEVPN_RELAY_RESERVATION_TTL"},
		Value:   config.DefaultRelayServiceReservationTTL.String(),
	},
	&cli.IntFlag{
		Name:    "relay-service-buffer-size",
		Usage:   "Per-circuit relayed connection buffer size in bytes. Higher values improve throughput of large relayed transfers at the cost of memory per relay client. Set lower for resource-constrained deployments.",
		EnvVars: []string{"EDGEVPN_RELAY_BUFFER_SIZE"},
		Value:   config.DefaultRelayServiceBufferSize,
	},
	&cli.StringSliceFlag{
		Name:    "blacklist",
		Usage:   "List of peers/cidr to gate",
		EnvVars: []string{"EDGEVPNBLACKLIST"},
	},
	&cli.StringFlag{
		Name:    "token",
		Usage:   "Specify an edgevpn token in place of a config file",
		EnvVars: []string{"EDGEVPNTOKEN"},
	},
	&cli.BoolFlag{
		Name:    "limit-enable",
		Usage:   "Enable resource management",
		EnvVars: []string{"LIMITENABLE"},
	},
	&cli.StringFlag{
		Name:    "limit-file",
		Usage:   "Specify a resource limit config (json)",
		EnvVars: []string{"LIMITFILE"},
	},
	&cli.StringFlag{
		Name:    "limit-scope",
		Usage:   "Specify a limit scope",
		EnvVars: []string{"LIMITSCOPE"},
		Value:   "system",
	},
	&cli.IntFlag{
		Name:    "limit-config-streams",
		Usage:   "Streams resource limit configuration",
		EnvVars: []string{"LIMITCONFIGSTREAMS"},
		Value:   200,
	},
	&cli.IntFlag{
		Name:    "limit-config-streams-inbound",
		Usage:   "Inbound streams resource limit configuration",
		EnvVars: []string{"LIMITCONFIGSTREAMSINBOUND"},
		Value:   30,
	},
	&cli.IntFlag{
		Name:    "limit-config-streams-outbound",
		Usage:   "Outbound streams resource limit configuration",
		EnvVars: []string{"LIMITCONFIGSTREAMSOUTBOUND"},
		Value:   30,
	},
	&cli.IntFlag{
		Name:    "limit-config-conn",
		Usage:   "Connections resource limit configuration",
		EnvVars: []string{"LIMITCONFIGCONNS"},
		Value:   200,
	},
	&cli.IntFlag{
		Name:    "limit-config-conn-inbound",
		Usage:   "Inbound connections resource limit configuration",
		EnvVars: []string{"LIMITCONFIGCONNSINBOUND"},
		Value:   30,
	},
	&cli.IntFlag{
		Name:    "limit-config-conn-outbound",
		Usage:   "Outbound connections resource limit configuration",
		EnvVars: []string{"LIMITCONFIGCONNSOUTBOUND"},
		Value:   30,
	},
	&cli.IntFlag{
		Name:    "limit-config-fd",
		Usage:   "Max fd resource limit configuration",
		EnvVars: []string{"LIMITCONFIGFD"},
		Value:   30,
	},
	&cli.BoolFlag{
		Name:    "peerguard",
		Usage:   "Enable peerguard. (Experimental)",
		EnvVars: []string{"PEERGUARD"},
	},
	&cli.StringFlag{
		Name:    "ownership",
		Usage:   "Ledger ownership enforcement mode: 'enforce' (sign + reject unauthorized writes, default), 'observe' (sign + log violations), or 'off' (legacy opt-out). Aliases: 'log' and 'log-only' map to observe; 'on' maps to enforce. Invalid values fail fast. All nodes on network must use the same mode (breaking wire format change).",
		EnvVars: []string{"EDGEVPNOWNERSHIP"},
		Value:   "enforce",
	},
	&cli.IntFlag{
		Name:    "ownership-ttl",
		Usage:   "Liveness window in seconds after which an inactive owner's ledger entries may be reclaimed/reaped (0 = default).",
		EnvVars: []string{"EDGEVPNOWNERSHIPTTL"},
		Value:   0,
	},
	&cli.BoolFlag{
		Name:    "privkey-cache",
		Usage:   "Enable privkey caching. (Experimental)",
		EnvVars: []string{"EDGEVPNPRIVKEYCACHE"},
	},
	&cli.StringFlag{
		Name:    "privkey-cache-dir",
		Usage:   "Specify a directory used to store the generated privkey",
		EnvVars: []string{"EDGEVPNPRIVKEYCACHEDIR"},
		Value:   stateDir(),
	},
	&cli.StringSliceFlag{
		Name:    "static-peertable",
		Usage:   "List of static peers to use (in `ip:peerid` format)",
		EnvVars: []string{"EDGEVPNSTATICPEERTABLE"},
	},
	&cli.StringSliceFlag{
		Name:    "whitelist",
		Usage:   "List of peers in the whitelist",
		EnvVars: []string{"EDGEVPNWHITELIST"},
	},
	&cli.BoolFlag{
		Name:    "peergate",
		Usage:   "Enable peergating. (Experimental)",
		EnvVars: []string{"PEERGATE"},
	},
	&cli.BoolFlag{
		Name:    "peergate-autoclean",
		Usage:   "Enable peergating autoclean. (Experimental)",
		EnvVars: []string{"PEERGATE_AUTOCLEAN"},
	},
	&cli.BoolFlag{
		Name:    "peergate-relaxed",
		Usage:   "Enable peergating relaxation. (Experimental)",
		EnvVars: []string{"PEERGATE_RELAXED"},
	},
	&cli.StringFlag{
		Name:    "peergate-auth",
		Usage:   "Peergate auth",
		EnvVars: []string{"PEERGATE_AUTH"},
		Value:   "",
	},
	&cli.IntFlag{
		Name:    "peergate-interval",
		Usage:   "Peergater interval time",
		EnvVars: []string{"EDGEVPNPEERGATEINTERVAL"},
		Value:   120,
	},
}

Functions

func API

func API() *cli.Command

func ConfigFromContext

func ConfigFromContext(c *cli.Context) *config.Config

ConfigFromContext returns a config object from a cli context

func DNS

func DNS() *cli.Command

func FileReceive

func FileReceive() *cli.Command

func FileSend

func FileSend() *cli.Command

func Main

func Main() func(c *cli.Context) error

func MainFlags

func MainFlags() []cli.Flag

func Peergate

func Peergate() *cli.Command

func Proxy

func Proxy() *cli.Command

func ServiceAdd

func ServiceAdd() *cli.Command

func ServiceConnect

func ServiceConnect() *cli.Command

func Start

func Start() *cli.Command

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址