diff --git a/README.md b/README.md index 6551ad4b6f..1eddb1b48c 100644 --- a/README.md +++ b/README.md @@ -4,31 +4,41 @@ Skywire requires a Golang version of `1.16` or higher. # Skywire -- [Skywire](#skywire) -- [Commands and Subcommands](#commands-and-subcommands) -- [Build Overview](#build-overview) -- [Dependencies](#dependencies) -- [Runtime Deps](#runtime-deps) -- [Build Deps](#build-deps) - - - [Prepare](#prepare) - - [Build](#build) - - [Configure Skywire](#configure-skywire) - - [Expose hypervisorUI](#expose-hypervisorui) - - [Add remote hypervisor](#add-remote-hypervisor) - - [Run `skywire-visor`](#run-skywire-visor) - - [Using the Skywire VPN](#using-the-skywire-vpn) - - [Creating a GitHub release](#creating-a-github-release) - - [How to create a GitHub release](#how-to-create-a-github-release) +* [Skywire](#skywire) + * [Commands and Subcommands](#commands-and-subcommands) + * [App documentation](#app-documentation) + * [Installing Skywire](#installing-skywire) + * [Build Overview](#build-overview) + * [Dependencies](#dependencies) + * [Runtime Deps](#runtime-deps) + * [Build Deps](#build-deps) + * [Prepare](#prepare) + * [Build](#build) + * [Install](#install) + * [Skywire\-autoconfig](#skywire-autoconfig) + * [Package tree](#package-tree) + * [Build with make](#build-with-make) + * [Build docker image](#build-docker-image) + * [Run from source](#run-from-source) + * [Files and folders created by skywire](#files-and-folders-created-by-skywire) + * [Configure Skywire](#configure-skywire) + * [Expose hypervisorUI](#expose-hypervisorui) + * [Add remote hypervisor](#add-remote-hypervisor) + * [Run skywire\-visor](#run-skywire-visor) + * [Using the Skywire VPN](#using-the-skywire-vpn) + * [Creating a GitHub release](#creating-a-github-release) + * [How to create a GitHub release](#how-to-create-a-github-release) ## Commands and Subcommands +Documentation on skywire-cli interface as well as available flags for skywire-visor + * [skywire-cli](cmd/skywire-cli/README.md) * [skywire-visor](cmd/skywire-visor/README.md) ## App documentation -apps are not executed by the user, but hosted by the visor process +Apps are not executed by the user, but hosted by the visor process * [skychat](cmd/apps/skychat/README.md) * [skysocks](cmd/apps/skysocks/README.md) @@ -40,6 +50,8 @@ further documentation can be found in the [skywire wiki](https://github.com/skyc ## Installing Skywire +Pre-compiled resouces + * [Windows installer](https://github.com/skycoin/skywire/releases/download/v1.2.1/skywire-installer-v1.2.1-windows-amd64.msi) * [MacOS amd64 package](https://github.com/skycoin/skywire/releases/download/v1.2.1/skywire-installer-v1.2.1-darwin-amd64.pkg) * [MacOS m1 / arm64](https://github.com/skycoin/skywire/releases/download/v1.2.1/skywire-installer-v1.2.1-darwin-arm64.pkg) @@ -53,25 +65,21 @@ A high-level overview of the process for building skywire from source and the pa this and other build variants can be built into a package with a single command, using `yay` on archlinux installing [skywire-bin](https://aur.archlinux.org/packages/skywire-bin) will install the release binaries provided by the release section of this repo - ``` yay -S skywire-bin ``` to build the debian packages using the release binaries - ``` yay --mflags " -p cc.deb.PKGBUILD " -S skywire-bin ``` installing [skywire](https://aur.archlinux.org/packages/skywire) will compile binaries using the source archive for the latest version release - ``` yay -S skywire ``` build from git sources to the develop branch - ``` yay --mflags " -p git.PKGBUILD " -S skywire ``` @@ -298,13 +306,13 @@ output tree ``` ├──skywire-cli └─┬skywire-visor -└─┬apps -├──skychat -├──skysocks -├──skysocks-client -├──vpn-client -├──vpn-server -└──skychat + └─┬apps + ├──skychat + ├──skysocks + ├──skysocks-client + ├──vpn-client + ├──vpn-server + └──skychat ``` install these executables to the `GOPATH` @@ -335,14 +343,14 @@ Running from source as outlined here does not write the config to disk or explic ``` ├──skywire-config.json └─┬local - ├──skychat - ├──skysocks - ├──apps-pid.txt - ├──skychat_log.db - ├──reward.txt - ├──node-info.json - └─┬transport_logs - └──2022-11-12.csv + ├──skychat + ├──skysocks + ├──apps-pid.txt + ├──skychat_log.db + ├──reward.txt + ├──node-info.json + └─┬transport_logs + └──2022-11-12.csv ``` Some of these files are served via the [dmsghttp logserver](https://github.com/skycoin/skywire/wiki/DMSGHTTP-logserver) @@ -440,6 +448,10 @@ docker run --rm -p 8000:8000 --name=skywire skycoin/skywire:test skywire-visor `skywire-visor` can be run on Windows. The setup requires additional setup steps that are specified in [the docs](docs/windows-setup.md). +### Using Skywire connection for apps + +to be documented + ### Using the Skywire VPN If you are interested in running the Skywire VPN as either a client or a server, please refer to the following guides: diff --git a/cmd/skywire-cli/README.md b/cmd/skywire-cli/README.md index 2449b6adff..d0efa44641 100644 --- a/cmd/skywire-cli/README.md +++ b/cmd/skywire-cli/README.md @@ -1,154 +1,223 @@ -# CLI Documentation + +# skywire-cli documentation skywire command line interface - - -- [Install](#install) -- [skywire-cli usage](#skywire-cli-usage) - - [global flags](#global-flags) - - [config usage](#config-usage) - - [gen](#config-gen) - - [update](#config-update) - - [dmsgpty usage](#dmsgpty-usage) - - [dmsgpty ui](#dmsgpty-ui) - - [dmsgpty url](#dmsgpty-url) - - [dmsgpty list](#dmsgpty-list) - - [dmsgpty start](#dmsgpty-start) - - [visor usage](#visor-usage) - - [app](#visor-app) - - [ls](#app-ls) - - [autostart](#app-autostart) - - [start](#app-start) - - [stop](#app-stop) - - [exec](#visor-exec) - - [hvui](#visor-hvui) - - [pk](#visor-pk) - - [hvpk](#visor-hvpk) - - [chvpk](#visor-chvpk) - - [info](#visor-info) - - [version](#visor-version) - - [route](#visor-route) - - [ls rules](#route-ls-rules) - - [rule](#route-rule) - - [add rule](#route-add-rule) - - [rm rule](#route-rm-rule) - - [halt](#visor-halt) - - [start](#visor-start) - - [tp](#visor-tp) - - [type](#tp-type) - - [disc](#tp-disc) - - [id](#tp-id) - - [ls](#tp-ls) - - [add](#tp-add) - - [rm](#tp-rm) - - [vpn](#vpn-usage) - - [list](#vpn-list) - - [ui](#vpn-ui) - - [url](#vpn-url) - - [start](#vpn-start) - - [stop](#vpn-stop) - - [status](#vpn-status) - - [rtfind usage](#rtfind-usage) - - [mdisc usage](#mdisc-usage) - - [servers](#servers) - - [entry](#entry) - - [completion usage](#completion-usage) - - - - -## Install - -```bash -$ cd $GOPATH/src/github.com/skycoin/skywire/cmd/skywire-cli -$ go install ./... -``` - -## skywire-cli usage - -After the installation, you can run `skywire-cli` to see the usage: - -``` -$ skywire-cli + * [skywire\-cli](#skywire-cli) + * [global flags](#global-flags) + * [subcommand tree](#subcommand-tree) + * [config](#config) + * [config gen](#config-gen) + * [config update](#config-update) + * [config update hv](#config-update-hv) + * [config update sc](#config-update-sc) + * [config update ss](#config-update-ss) + * [config update vpnc](#config-update-vpnc) + * [config update vpns](#config-update-vpns) + * [dmsgpty](#dmsgpty) + * [dmsgpty ui](#dmsgpty-ui) + * [dmsgpty url](#dmsgpty-url) + * [dmsgpty list](#dmsgpty-list) + * [dmsgpty start](#dmsgpty-start) + * [visor](#visor) + * [visor app](#visor-app) + * [visor app ls](#visor-app-ls) + * [visor app start](#visor-app-start) + * [visor app stop](#visor-app-stop) + * [visor app log](#visor-app-log) + * [visor app arg](#visor-app-arg) + * [visor app arg autostart](#visor-app-arg-autostart) + * [visor app arg killswitch](#visor-app-arg-killswitch) + * [visor app arg secure](#visor-app-arg-secure) + * [visor app arg passcode](#visor-app-arg-passcode) + * [visor app arg netifc](#visor-app-arg-netifc) + * [visor exec](#visor-exec) + * [visor hv](#visor-hv) + * [visor hv ui](#visor-hv-ui) + * [visor hv cpk](#visor-hv-cpk) + * [visor hv pk](#visor-hv-pk) + * [visor pk](#visor-pk) + * [visor info](#visor-info) + * [visor ver](#visor-ver) + * [visor route](#visor-route) + * [visor route ls\-rules](#visor-route-ls-rules) + * [visor route rule](#visor-route-rule) + * [visor route rm\-rule](#visor-route-rm-rule) + * [visor route add\-rule](#visor-route-add-rule) + * [visor route add\-rule app](#visor-route-add-rule-app) + * [visor route add\-rule fwd](#visor-route-add-rule-fwd) + * [visor route add\-rule intfwd](#visor-route-add-rule-intfwd) + * [visor halt](#visor-halt) + * [visor start](#visor-start) + * [visor tp](#visor-tp) + * [visor tp type](#visor-tp-type) + * [visor tp ls](#visor-tp-ls) + * [visor tp id](#visor-tp-id) + * [visor tp add](#visor-tp-add) + * [visor tp rm](#visor-tp-rm) + * [visor tp disc](#visor-tp-disc) + * [vpn](#vpn) + * [vpn list](#vpn-list) + * [vpn ui](#vpn-ui) + * [vpn url](#vpn-url) + * [vpn start](#vpn-start) + * [vpn stop](#vpn-stop) + * [vpn status](#vpn-status) + * [reward](#reward) + * [survey](#survey) + * [rtfind](#rtfind) + * [mdisc](#mdisc) + * [mdisc entry](#mdisc-entry) + * [mdisc servers](#mdisc-servers) + * [completion](#completion) + * [tree](#tree) + * [doc](#doc) + + +## skywire-cli + +``` ┌─┐┬┌─┬ ┬┬ ┬┬┬─┐┌─┐ ┌─┐┬ ┬ └─┐├┴┐└┬┘││││├┬┘├┤───│ │ │ └─┘┴ ┴ ┴ └┴┘┴┴└─└─┘ └─┘┴─┘┴ -Usage: - skywire-cli [command] - -Available Commands: - config Generate or update a skywire config - dmsgpty Interact with remote visors - visor Query the Skywire Visor - vpn controls for VPN client - rtfind Query the Route Finder - mdisc Query remote DMSG Discovery - completion Generate completion script +Usage: + skywire-cli + +Available Commands: + config Generate or update a skywire config + dmsgpty Interact with remote visors + visor Query the Skywire Visor + vpn controls for VPN client + reward skycoin reward address + survey system survey + rtfind Query the Route Finder + mdisc Query remote DMSG Discovery + completion Generate completion script + tree subcommand tree + doc gnerate markdown docs + -Flags: - --rpc string RPC server address (default "localhost:3435") - -v, --version version for skywire-cli - -Use "skywire-cli [command] --help" for more information about a command. ``` -### global flags + +## global flags The skywire-cli interacts with the running visor via rpc calls. By default the rpc server is available on localhost:3435. The rpc address and port the visor is using may be changed in the config file, once generated. -It is not recommended to expose the rpc server on the local network. -Exposing the rpc allows unsecured access to the machine over the local network +It is not recommended to expose the rpc server on the local network. Exposing the rpc allows unsecured access to the machine over the local network ``` -Global Flags: - --rpc string RPC server address (default "localhost:3435") -``` -### config usage +Global Flags: -A primary function of skywire-cli is generating and updating the config file used by skywire-visor. + --rpc string RPC server address (default "localhost:3435") + + --json bool print output as json + +``` + +## subcommand tree + +A tree representation of the skywire-cli subcommands + +``` +└─┬skywire-cli + ├─┬config + │ ├──gen + │ └─┬update + │ ├──hv + │ ├──sc + │ ├──ss + │ ├──vpnc + │ └──vpns + ├─┬dmsgpty + │ ├──ui + │ ├──url + │ ├──list + │ └──start + ├─┬visor + │ ├─┬app + │ │ ├──ls + │ │ ├──start + │ │ ├──stop + │ │ ├──log + │ │ └─┬arg + │ │ ├──autostart + │ │ ├──killswitch + │ │ ├──secure + │ │ ├──passcode + │ │ └──netifc + │ ├──exec + │ ├─┬hv + │ │ ├──ui + │ │ ├──cpk + │ │ └──pk + │ ├──pk + │ ├──info + │ ├──ver + │ ├─┬route + │ │ ├──ls-rules + │ │ ├──rule + │ │ ├──rm-rule + │ │ └─┬add-rule + │ │ ├──app + │ │ ├──fwd + │ │ └──intfwd + │ ├──halt + │ ├──start + │ └─┬tp + │ ├──type + │ ├──ls + │ ├──id + │ ├──add + │ ├──rm + │ └──disc + ├─┬vpn + │ ├──list + │ ├──ui + │ ├──url + │ ├──start + │ ├──stop + │ └──status + ├──reward + ├──survey + ├──rtfind + ├─┬mdisc + │ ├──entry + │ └──servers + ├──completion + ├──tree + ├──doc + └── + +``` + + +### config ``` -$ skywire-cli config -h -Generate or update a skywire config +A primary function of skywire-cli is generating and updating the config file used by skywire-visor. -Usage: - skywire-cli config [command] +Usage: + skywire-cli config + +Available Commands: + gen Generate a config file + update Update a config file + -Available Commands: - gen Generate a config file - update Update a config file ``` #### config gen ``` -$ skywire-cli config gen --help -Generate a config file - -Usage: - skywire-cli config gen [flags] - -Flags: - -b, --bestproto best protocol (dmsg | direct) based on location - -i, --ishv local hypervisor configuration - -j, --hvpks string list of public keys to use as hypervisor - -o, --out string output config: skywire-config.json - -p, --pkg use path for package: /opt/skywire - -u, --user use paths for user space: /home/user - -r, --regen re-generate existing config & retain keys - -y, --autoconn disable autoconnect to public visors - --all show all flags - -$ skywire-cli config gen --all Generate a config file -Usage: - skywire-cli config gen [flags] - -Flags: +Usage: + skywire-cli config gen [flags] + +Flags: -a, --url string services conf --log-level string level of logging in config (default "info") -b, --bestproto best protocol (dmsg | direct) based on location @@ -160,14 +229,15 @@ Flags: -i, --ishv local hypervisor configuration -j, --hvpks string list of public keys to use as hypervisor -k, --os string (linux / mac / win) paths (default "linux") + -l, --publicip allow display node ip in services -n, --stdout write config to stdout -o, --out string output config: skywire-config.json -p, --pkg use path for package: /opt/skywire - -u, --user use paths for user space: /home/user + -u, --user use paths for user space: /home/d0mo -q, --publicrpc allow rpc requests from LAN -r, --regen re-generate existing config & retain keys -s, --sk cipher.SecKey a random key is generated if unspecified - (default 0000000000000000000000000000000000000000000000000000000000000000) + (default 0000000000000000000000000000000000000000000000000000000000000000) -t, --testenv use test deployment conf.skywire.dev -v, --servevpn enable vpn server -w, --hide dont print the config to the terminal @@ -175,31 +245,18 @@ Flags: -y, --autoconn disable autoconnect to public visors -z, --public publicize visor in service discovery --version string custom version testing override - --binpath string set bin_path + --all show all flags + --binpath string set bin_path + ``` -##### Example defaults - -The default visor config generation assumes the command is run from the root of the cloned repository. -The example further assumes the compiled binary is available in the executable PATH and that GOPATH is set - -
- - -cd $GOPATH/src/github.com/skycoin/skywire && skywire-cli config gen - - ``` -$ cd $GOPATH/src/github.com/skycoin/skywire -$ skywire-cli config gen -[2022-08-15T10:32:29-05:00] INFO []: Fetched service endpoints from 'http://conf.skywire.skycoin.com' -[2022-08-15T10:32:29-05:00] INFO [visor:config]: Flushing config to file. config_version="v1.0.0" filepath="/home/user/go/src/github.com/skycoin/skywire/skywire-config.json" -[2022-08-15T10:32:29-05:00] INFO [skywire-cli]: Updated file 'skywire-config.json' to: +$ skywire-cli config gen -bpirxn { - "version": "v1.0.0", - "sk": "b0b193b38cb970b36bfe4bb05e2354ae96a979283b18bcf516f22a86436ddea3", - "pk": "034b7c206b825e896e727a43ae8685d7d93460ec0f37d4e3bbc3c44e6e771a8455", + "version": "v1.2.0", + "sk": "5fc3b007a6324239066ba84cb05ce7a4af0ff39f0a14cf881c81e629a4138b88", + "pk": "03959334da0e30d2b1987318af159768fe7b32373c1c575212367bc23ce432f29c", "dmsg": { "discovery": "http://dmsgd.skywire.skycoin.com", "sessions_count": 1, @@ -218,7 +275,12 @@ $ skywire-cli config gen "discovery": "http://tpd.skywire.skycoin.com", "address_resolver": "http://ar.skywire.skycoin.com", "public_autoconnect": true, - "transport_setup_nodes": null + "transport_setup_nodes": null, + "log_store": { + "type": "file", + "location": "./local/transport_logs", + "rotation_interval": "168h0m0s" + } }, "routing": { "setup_nodes": [ @@ -265,1613 +327,1557 @@ $ skywire-cli config gen } ], "server_addr": "localhost:5505", - "bin_path": "./apps" + "bin_path": "./apps", + "display_node_ip": false }, "hypervisors": [], "cli_addr": "localhost:3435", "log_level": "info", "local_path": "./local", + "custom_dmsg_http_path": "./local/custom", "stun_servers": [ - "192.46.224.108:3478", - "139.177.185.210:3478", - "139.162.17.54:3478", - "139.162.17.107:3478", - "139.162.17.156:3478", - "45.118.134.168:3478", - "139.177.185.180:3478", - "139.162.17.48:3478" + "192.53.116.178:3478", + "172.105.114.227:3478", + "172.104.47.121:3478", + "172.104.185.252:3478", + "139.162.42.104:3478", + "192.53.172.10:3478", + "172.104.54.73:3478", + "139.162.21.168:3478" ], "shutdown_timeout": "10s", "restart_check_delay": "1s", "is_public": false, "persistent_transports": null } - ``` -
-##### Example hypervisor defaults - -The default configuration is for a visor only. To generate a configuration which provides the hypervisor web interface, -the `-i` or `--is-hypervisor` flag should be specified. - -
- - -skywire-cli config gen -i - +#### config update ``` -$ skywire-cli config gen -i -[2022-08-15T10:33:18-05:00] INFO []: Fetched service endpoints from 'http://conf.skywire.skycoin.com' -[2022-08-15T10:33:18-05:00] INFO [visor:config]: Flushing config to file. config_version="v1.0.0" filepath="/home/user/go/src/github.com/skycoin/skywire/skywire-config.json" -[2022-08-15T10:33:18-05:00] INFO [skywire-cli]: Updated file 'skywire-config.json' to: -{ - "version": "v1.0.0", - "sk": "b0b193b38cb970b36bfe4bb05e2354ae96a979283b18bcf516f22a86436ddea3", - "pk": "034b7c206b825e896e727a43ae8685d7d93460ec0f37d4e3bbc3c44e6e771a8455", - "dmsg": { - "discovery": "http://dmsgd.skywire.skycoin.com", - "sessions_count": 1, - "servers": [] - }, - "dmsgpty": { - "dmsg_port": 22, - "cli_network": "unix", - "cli_address": "/tmp/dmsgpty.sock" - }, - "skywire-tcp": { - "pk_table": null, - "listening_address": ":7777" - }, - "transport": { - "discovery": "http://tpd.skywire.skycoin.com", - "address_resolver": "http://ar.skywire.skycoin.com", - "public_autoconnect": true, - "transport_setup_nodes": null - }, - "routing": { - "setup_nodes": [ - "0324579f003e6b4048bae2def4365e634d8e0e3054a20fc7af49daf2a179658557" - ], - "route_finder": "http://rf.skywire.skycoin.com", - "route_finder_timeout": "10s", - "min_hops": 0 - }, - "uptime_tracker": { - "addr": "http://ut.skywire.skycoin.com" - }, - "launcher": { - "service_discovery": "http://sd.skycoin.com", - "apps": [ - { - "name": "vpn-client", - "auto_start": false, - "port": 43 - }, - { - "name": "skychat", - "args": [ - "-addr", - ":8001" - ], - "auto_start": true, - "port": 1 - }, - { - "name": "skysocks", - "auto_start": true, - "port": 3 - }, - { - "name": "skysocks-client", - "auto_start": false, - "port": 13 - }, - { - "name": "vpn-server", - "auto_start": false, - "port": 44 - } - ], - "server_addr": "localhost:5505", - "bin_path": "./apps" - }, - "hypervisors": [], - "cli_addr": "localhost:3435", - "log_level": "info", - "local_path": "./local", - "stun_servers": [ - "192.46.224.108:3478", - "139.177.185.210:3478", - "139.162.17.54:3478", - "139.162.17.107:3478", - "139.162.17.156:3478", - "45.118.134.168:3478", - "139.177.185.180:3478", - "139.162.17.48:3478" - ], - "shutdown_timeout": "10s", - "restart_check_delay": "1s", - "is_public": false, - "persistent_transports": null, - "hypervisor": { - "db_path": "/home/user/go/src/github.com/skycoin/skywire/users.db", - "enable_auth": false, - "cookies": { - "hash_key": "cd6918c54f4b7b11b50cc395f57b1f78fafa5d08daa6917b246501eeeb00d9ee5557aedf79513f3392c5ffdd5a073711c7a0243460930615424ecfa75f2d3db1", - "block_key": "41caf4a9935b9f48d37fff1b8e950f165e73c29d4effd548def4382c4dff842a", - "expires_duration": 43200000000000, - "path": "/", - "domain": "" - }, - "dmsg_port": 46, - "http_addr": ":8000", - "enable_tls": false, - "tls_cert_file": "./ssl/cert.pem", - "tls_key_file": "./ssl/key.pem" - } -} -``` -
- +Update a config file -Note that it is possible to start the visor with the hypervisor interface explicitly; regardless of how the config was generated; using the -i flag +Usage: + skywire-cli config update [flags] + +Available Commands: + hv update hypervisor config + sc update skysocks-client config + ss update skysocks-server config + vpnc update vpn-client config + vpns update vpn-server config + +Flags: + -a, --endpoints update server endpoints + --log-level string level of logging in config + -b, --url string service config URL: conf.skywire.skycoin.com + -t, --testenv use test deployment: conf.skywire.dev + --public-autoconn string change public autoconnect configuration + --set-minhop int change min hops value (default -1) + -i, --input string path of input config file. + -o, --output string config file to output + -``` -skywire-visor -i ``` -##### Example dmsghttp defaults - -Using dmsghttp routes http traffic used for connecting to the skywire services through dmsg. - -The dmsghttp-config.json file must be present to generate a config with dmsghttp - -The `-b` or `--bestproto` flag will automatically determine if dmsghttp should be used based on region - -The `-d` or `--dmsghttp` flag explicitly creates the config with dmsghttp - -It is recommended to use the `-b` flag for config file generation. - -The example below uses `-d` to create a dmsghttp config - -
- - -skywire-cli config gen -d - +##### config update hv ``` -[2022-08-15T10:34:30-05:00] INFO [skywire-cli]: Found Dmsghttp config: dmsghttp-config.json -[2022-08-15T10:34:31-05:00] INFO []: Fetched service endpoints from 'http://conf.skywire.skycoin.com' -[2022-08-15T10:34:31-05:00] INFO [visor:config]: Flushing config to file. config_version="v1.0.0" filepath="/home/user/go/src/github.com/skycoin/skywire/skywire-config.json" -[2022-08-15T10:34:31-05:00] INFO [skywire-cli]: Updated file 'skywire-config.json' to: -{ - "version": "v1.0.0", - "sk": "b0b193b38cb970b36bfe4bb05e2354ae96a979283b18bcf516f22a86436ddea3", - "pk": "034b7c206b825e896e727a43ae8685d7d93460ec0f37d4e3bbc3c44e6e771a8455", - "dmsg": { - "discovery": "dmsg://022e607e0914d6e7ccda7587f95790c09e126bbd506cc476a1eda852325aadd1aa:80", - "sessions_count": 1, - "servers": [ - { - "version": "", - "sequence": 0, - "timestamp": 0, - "static": "02a2d4c346dabd165fd555dfdba4a7f4d18786fe7e055e562397cd5102bdd7f8dd", - "server": { - "address": "dmsg.server02a2d4c3.skywire.skycoin.com:30081", - "availableSessions": 0 - } - }, - { - "version": "", - "sequence": 0, - "timestamp": 0, - "static": "03717576ada5b1744e395c66c2bb11cea73b0e23d0dcd54422139b1a7f12e962c4", - "server": { - "address": "dmsg.server03717576.skywire.skycoin.com:30082", - "availableSessions": 0 - } - }, - { - "version": "", - "sequence": 0, - "timestamp": 0, - "static": "0228af3fd99c8d86a882495c8e0202bdd4da78c69e013065d8634286dd4a0ac098", - "server": { - "address": "45.118.133.242:30084", - "availableSessions": 0 - } - }, - { - "version": "", - "sequence": 0, - "timestamp": 0, - "static": "03d5b55d1133b26485c664cf8b95cff6746d1e321c34e48c9fed293eff0d6d49e5", - "server": { - "address": "dmsg.server03d5b55d.skywire.skycoin.com:30083", - "availableSessions": 0 - } - }, - { - "version": "", - "sequence": 0, - "timestamp": 0, - "static": "0281a102c82820e811368c8d028cf11b1a985043b726b1bcdb8fce89b27384b2cb", - "server": { - "address": "192.53.114.142:30085", - "availableSessions": 0 - } - }, - { - "version": "", - "sequence": 0, - "timestamp": 0, - "static": "02a49bc0aa1b5b78f638e9189be4ed095bac5d6839c828465a8350f80ac07629c0", - "server": { - "address": "dmsg.server02a4.skywire.skycoin.com:30089", - "availableSessions": 0 - } - }, - { - "version": "", - "sequence": 0, - "timestamp": 0, - "static": "02113579604c79b704e169a4fd94fd78167b86fe40da1016f8146935babcc9abcb", - "server": { - "address": "194.147.142.202:30050", - "availableSessions": 0 - } - } - ] - }, - "dmsgpty": { - "dmsg_port": 22, - "cli_network": "unix", - "cli_address": "/tmp/dmsgpty.sock" - }, - "skywire-tcp": { - "pk_table": null, - "listening_address": ":7777" - }, - "transport": { - "discovery": "dmsg://02b307aee5c8ce1666c63891f8af25ad2f0a47a243914c963942b3ba35b9d095ae:80", - "address_resolver": "dmsg://03234b2ee4128d1f78c180d06911102906c80795dfe41bd6253f2619c8b6252a02:80", - "public_autoconnect": true, - "transport_setup_nodes": null - }, - "routing": { - "setup_nodes": [ - "0324579f003e6b4048bae2def4365e634d8e0e3054a20fc7af49daf2a179658557" - ], - "route_finder": "dmsg://039d89c5eedfda4a28b0c58b0b643eff949f08e4f68c8357278081d26f5a592d74:80", - "route_finder_timeout": "10s", - "min_hops": 0 - }, - "uptime_tracker": { - "addr": "dmsg://022c424caa6239ba7d1d9d8f7dab56cd5ec6ae2ea9ad97bb94ad4b48f62a540d3f:80" - }, - "launcher": { - "service_discovery": "dmsg://0204890f9def4f9a5448c2e824c6a4afc85fd1f877322320898fafdf407cc6fef7:80", - "apps": [ - { - "name": "vpn-client", - "auto_start": false, - "port": 43 - }, - { - "name": "skychat", - "args": [ - "-addr", - ":8001" - ], - "auto_start": true, - "port": 1 - }, - { - "name": "skysocks", - "auto_start": true, - "port": 3 - }, - { - "name": "skysocks-client", - "auto_start": false, - "port": 13 - }, - { - "name": "vpn-server", - "auto_start": false, - "port": 44 - } - ], - "server_addr": "localhost:5505", - "bin_path": "./apps" - }, - "hypervisors": [], - "cli_addr": "localhost:3435", - "log_level": "info", - "local_path": "./local", - "stun_servers": [ - "192.46.224.108:3478", - "139.177.185.210:3478", - "139.162.17.54:3478", - "139.162.17.107:3478", - "139.162.17.156:3478", - "45.118.134.168:3478", - "139.177.185.180:3478", - "139.162.17.48:3478" - ], - "shutdown_timeout": "10s", - "restart_check_delay": "1s", - "is_public": false, - "persistent_transports": null -} -``` -
- - -##### Example package based installation defaults - -This assumes the skywire linux installation is at `/opt/skywire` with binaries and apps in their own subdirectories. -The `-p` flag default paths are provided by the skywire linux / mac packages or windows .msi installer and generate the skywire config within the install dir. +update hypervisor config - -
- - -sudo skywire-cli config gen -bipr - +Usage: + skywire-cli config update hv [flags] + +Flags: + -+, --add-pks string public keys of hypervisors that should be added to this visor + -r, --reset resets hypervisor configuration + +Global Flags: + -i, --input string path of input config file. + -o, --output string config file to output + ``` -$ sudo skywire-cli config gen -bipr -[sudo] password for user: -[2022-08-15T10:35:37-05:00] INFO []: Fetched service endpoints from 'http://conf.skywire.skycoin.com' -[2022-08-15T10:35:37-05:00] INFO [visor:config]: Flushing config to file. config_version="v1.0.0" filepath="/opt/skywire/skywire.json" -[2022-08-15T10:35:37-05:00] INFO [skywire-cli]: Updated file '/opt/skywire/skywire.json' to: -{ - "version": "v1.0.0", - "sk": "4aaa3cc266cb8c4ec9689a0d88c49802646517ae2d2240315c480d461c6af70e", - "pk": "0291b61ab823eebe79575d6d0f8e122e84cd17dae1cab5c7dfb9043f1ee4f0a206", - "dmsg": { - "discovery": "http://dmsgd.skywire.skycoin.com", - "sessions_count": 1, - "servers": [] - }, - "dmsgpty": { - "dmsg_port": 22, - "cli_network": "unix", - "cli_address": "/tmp/dmsgpty.sock" - }, - "skywire-tcp": { - "pk_table": null, - "listening_address": ":7777" - }, - "transport": { - "discovery": "http://tpd.skywire.skycoin.com", - "address_resolver": "http://ar.skywire.skycoin.com", - "public_autoconnect": true, - "transport_setup_nodes": null - }, - "routing": { - "setup_nodes": [ - "0324579f003e6b4048bae2def4365e634d8e0e3054a20fc7af49daf2a179658557" - ], - "route_finder": "http://rf.skywire.skycoin.com", - "route_finder_timeout": "10s", - "min_hops": 0 - }, - "uptime_tracker": { - "addr": "http://ut.skywire.skycoin.com" - }, - "launcher": { - "service_discovery": "http://sd.skycoin.com", - "apps": [ - { - "name": "vpn-client", - "auto_start": false, - "port": 43 - }, - { - "name": "skychat", - "args": [ - "-addr", - ":8001" - ], - "auto_start": true, - "port": 1 - }, - { - "name": "skysocks", - "auto_start": true, - "port": 3 - }, - { - "name": "skysocks-client", - "auto_start": false, - "port": 13 - }, - { - "name": "vpn-server", - "auto_start": false, - "port": 44 - } - ], - "server_addr": "localhost:5505", - "bin_path": "/opt/skywire/apps" - }, - "hypervisors": [], - "cli_addr": "localhost:3435", - "log_level": "info", - "local_path": "/opt/skywire/local", - "stun_servers": [ - "192.46.224.108:3478", - "139.177.185.210:3478", - "139.162.17.54:3478", - "139.162.17.107:3478", - "139.162.17.156:3478", - "45.118.134.168:3478", - "139.177.185.180:3478", - "139.162.17.48:3478" - ], - "shutdown_timeout": "10s", - "restart_check_delay": "1s", - "is_public": false, - "persistent_transports": null, - "hypervisor": { - "db_path": "/opt/skywire/users.db", - "enable_auth": true, - "cookies": { - "hash_key": "2e0337acde4de0c92531c39293839ca5b5398409b2da250c30ed89c814bdf6aab6a3e7ab2cd21e077e5d694997811e90be0de8552ad59a788a480d6d2efdf512", - "block_key": "19035ce3ee7110f6d794bf02bab4fb6ed7360db9b725331da2732999745ddcd3", - "expires_duration": 43200000000000, - "path": "/", - "domain": "" - }, - "dmsg_port": 46, - "http_addr": ":8000", - "enable_tls": false, - "tls_cert_file": "./ssl/cert.pem", - "tls_key_file": "./ssl/key.pem" - } -} -``` -
- -The configuration is written (or rewritten) - -##### Example remote hypervisor configuration for package based installation - -The typical arrangement uses a remote hypervisor if a local instance is not started. - -The desired hypervisor public key can be determined by running the following command on the running hypervisor: +##### config update sc ``` -$ skywire-cli visor pk -``` +update skysocks-client config -configure the visor to use the public key of the remote hypervisor: +Usage: + skywire-cli config update sc [flags] + +Flags: + -+, --add-server string add skysocks server address to skysock-client + -r, --reset reset skysocks-client configuration + +Global Flags: + -i, --input string path of input config file. + -o, --output string config file to output + -``` -# skywire-cli config gen -bprj ``` -The configuration is regenerated - -#### config update +##### config update ss ``` -$ skywire-cli config update --help -Update a config file - -Usage: - skywire-cli config update [flags] - skywire-cli config update [command] +update skysocks-server config -Available Commands: - hv update hypervisor config - sc update skysocks-client config - ss update skysocks-server config - vpnc update vpn-client config - vpns update vpn-server config - -Flags: - -a, --endpoints update server endpoints - --log-level string level of logging in config - -b, --url string service config URL: conf.skywire.skycoin.com - -t, --testenv use test deployment: conf.skywire.dev - --public-autoconn string change public autoconnect configuration - --set-minhop int change min hops value (default -1) - -i, --input string path of input config file. - -o, --output string config file to output +Usage: + skywire-cli config update ss [flags] + +Flags: + -s, --passwd string add passcode to skysocks server + -r, --reset reset skysocks configuration + +Global Flags: + -i, --input string path of input config file. + -o, --output string config file to output + ``` -##### Example - -
+##### config update vpnc - -skywire-cli config update - +``` +update vpn-client config +Usage: + skywire-cli config update vpnc [flags] + +Flags: + -x, --killsw string change killswitch status of vpn-client + --add-server string add server address to vpn-client + -s, --pass string add passcode of server if needed + -r, --reset reset vpn-client configurations + +Global Flags: + -i, --input string path of input config file. + -o, --output string config file to output + ``` -$ skywire-cli config update -[2022-08-15T10:44:31-05:00] INFO [visor:config]: Flushing config to file. config_version="v1.0.0" filepath="/home/user/go/src/github.com/skycoin/skywire/skywire-config.json" -[2022-08-15T10:44:31-05:00] INFO [skywire-cli]: Updated file '/home/user/go/src/github.com/skycoin/skywire/skywire-config.json' to: { - "version": "v1.0.0", - "sk": "b0b193b38cb970b36bfe4bb05e2354ae96a979283b18bcf516f22a86436ddea3", - "pk": "034b7c206b825e896e727a43ae8685d7d93460ec0f37d4e3bbc3c44e6e771a8455", - "dmsg": { - "discovery": "http://dmsgd.skywire.skycoin.com", - "sessions_count": 1, - "servers": [] - }, - "dmsgpty": { - "dmsg_port": 22, - "cli_network": "unix", - "cli_address": "/tmp/dmsgpty.sock" - }, - "skywire-tcp": { - "pk_table": null, - "listening_address": ":7777" - }, - "transport": { - "discovery": "http://tpd.skywire.skycoin.com", - "address_resolver": "http://ar.skywire.skycoin.com", - "public_autoconnect": true, - "transport_setup_nodes": null - }, - "routing": { - "setup_nodes": [ - "0324579f003e6b4048bae2def4365e634d8e0e3054a20fc7af49daf2a179658557" - ], - "route_finder": "http://rf.skywire.skycoin.com", - "route_finder_timeout": "10s", - "min_hops": 0 - }, - "uptime_tracker": { - "addr": "http://ut.skywire.skycoin.com" - }, - "launcher": { - "service_discovery": "http://sd.skycoin.com", - "apps": [ - { - "name": "vpn-client", - "auto_start": false, - "port": 43 - }, - { - "name": "skychat", - "args": [ - "-addr", - ":8001" - ], - "auto_start": true, - "port": 1 - }, - { - "name": "skysocks", - "auto_start": true, - "port": 3 - }, - { - "name": "skysocks-client", - "auto_start": false, - "port": 13 - }, - { - "name": "vpn-server", - "auto_start": false, - "port": 44 - } - ], - "server_addr": "localhost:5505", - "bin_path": "./apps" - }, - "hypervisors": [], - "cli_addr": "localhost:3435", - "log_level": "info", - "local_path": "./local", - "stun_servers": [ - "192.46.224.108:3478", - "139.177.185.210:3478", - "139.162.17.54:3478", - "139.162.17.107:3478", - "139.162.17.156:3478", - "45.118.134.168:3478", - "139.177.185.180:3478", - "139.162.17.48:3478" - ], - "shutdown_timeout": "10s", - "restart_check_delay": "1s", - "is_public": false, - "persistent_transports": null -} + +##### config update vpns + ``` -
+update vpn-server config -### dmsgpty usage +Usage: + skywire-cli config update vpns [flags] + +Flags: + -s, --passwd string add passcode to vpn-server + --secure string change secure mode status of vpn-server + --autostart string change autostart of vpn-server + --netifc string set default network interface + -r, --reset reset vpn-server configurations + +Global Flags: + -i, --input string path of input config file. + -o, --output string config file to output + -The dmsgpty is a means of accessing remote visors which are connected to a locally running hypervisor via the shell. +``` -One can think of it as similar in functionality to ssh. The difference is that the connection, from a remote visor to the hypervisor, is already established. +### dmsgpty ``` -$ skywire-cli dmsgpty Interact with remote visors -Usage: - skywire-cli dmsgpty [command] - -Available Commands: - ui Open dmsgpty UI in default browser - url Show dmsgpty UI URL - list List connected visors - start Start dmsgpty session +Usage: + skywire-cli dmsgpty + +Available Commands: + ui Open dmsgpty UI in default browser + url Show dmsgpty UI URL + list List connected visors + start Start dmsgpty session + ``` #### dmsgpty ui -The dmsgpty ui is accessible from the hypervisor UI, and requires that one has already logged into the hypervisor UI or that the session cookie for the hypervisor UI exists. - -Open dmsgpty UI in default browser - -``` -$ skywire-cli dmsgpty ui -h -Usage: - skywire-cli dmsgpty ui [flags] ``` +Open dmsgpty UI in default browser -``` -Flags: +Usage: + skywire-cli dmsgpty ui [flags] + +Flags: -i, --input string read from specified config file -p, --pkg read from /opt/skywire/skywire.json - -v, --visor string public key of visor to connect to + -v, --visor string public key of visor to connect to + + ``` #### dmsgpty url -Show dmsgpty UI URL -``` -$ skywire-cli dmsgpty url -``` - ``` -Usage: - skywire-cli dmsgpty url [flags] +Show dmsgpty UI URL -Flags: +Usage: + skywire-cli dmsgpty url [flags] + +Flags: -i, --input string read from specified config file -p, --pkg read from /opt/skywire/skywire.json - -v, --visor string public key of visor to connect to + -v, --visor string public key of visor to connect to + ``` #### dmsgpty list -The visors which are shown by this command are currently connected to the hypervisor - +``` List connected visors -``` -$ skywire-cli dmsgpty list +Usage: + skywire-cli dmsgpty list [flags] + +Flags: + --rpc string RPC server address (default "localhost:3435") + + ``` #### dmsgpty start -A public key of a connected remote visor must be provided as an argument. The list command, above, lists remote visors which are connected to the locally running hypervisor. - -Start dmsgpty session - -``` -$ skywire-cli dmsgpty start ``` +Start dmsgpty session -``` -Flags: +Usage: + skywire-cli dmsgpty start [flags] + +Flags: -p, --port string port of remote visor dmsgpty (default "22") + --rpc string RPC server address (default "localhost:3435") + ``` -Starting the dmsgpty-cli will give access via the default shell to the remote visor, as the same user which started the remote visor. - -### visor usage +### visor ``` -$ skywire-cli visor Query the Skywire Visor -Usage: - skywire-cli visor [command] +Usage: + skywire-cli visor [flags] + +Available Commands: + app App settings + exec Execute a command + hv Hypervisor + pk Public key of the visor + info Summary of visor info + ver Version and build info + route View and set rules + halt Stop a running visor + start Start a visor + tp View and set transports + +Flags: + --rpc string RPC server address (default "localhost:3435") + + +``` -Available Commands: - app App settings - exec Execute a command - hvui Hypervisor UI - pk Public key of the visor - hvpk Public key of remote hypervisor - chvpk Public key of connected hypervisors - info Summary of visor info - version Version and build info - route View and set rules - halt Stop a running visor - start Start a visor - tp View and set transports +#### visor app ``` -#### visor exec + App settings -execute a given command +Usage: + skywire-cli visor app [flags] + +Available Commands: + ls List apps + start Launch app + stop Halt app + log Logs from app + arg App args + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + ``` -$ skywire-cli visor exec + +##### visor app ls + ``` -##### Example + List apps -ls +Usage: + skywire-cli visor app ls [flags] + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + -``` -$ skywire-cli visor exec ls -bin -boot -dev -efi -etc -home -lib -lib64 -media -mnt -opt -proc -root -run -sbin -share -srv -sys -tmp -usr -var ``` -echo +##### visor app start -``` -$ skywire-cli visor exec echo "hello world" -hello world ``` -escape a flag + Launch app + +Usage: + skywire-cli visor app start [flags] + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + ``` -$skywire-cli visor exec echo -- "-a" --a + +##### visor app stop + ``` + Halt app -#### visor hvui +Usage: + skywire-cli visor app stop [flags] + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + -open the hypervisor UI in the default browser ``` -$ skywire-cli visor hvui + +##### visor app log + ``` -#### visor pk + Logs from app since RFC3339Nano-formatted timestamp. + + "beginning" is a special timestamp to fetch all the logs -public key of the visor +Usage: + skywire-cli visor app log [flags] + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + -``` -$ skywire-cli visor pk ``` +##### visor app arg + ``` -Flags: - -i, --input string path of input config file. -``` +App args -##### Example +Usage: + skywire-cli visor app arg [flags] + +Available Commands: + autostart Set app autostart + killswitch Set app killswitch + secure Set app secure + passcode Set app passcode + netifc Set app network interface + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + ``` -$ skywire-cli visor pk -0359f02198933550ad5b41a21470a0bbe0f73c0eb6e93d7d279133a0d5bffc645c -``` - -#### visor hvpk -Public key of remote hypervisor(s) set in the config +###### visor app arg autostart ``` -$ skywire-cli visor hvpk +Set app autostart + +Usage: + skywire-cli visor app arg autostart (true|false) [flags] + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + + ``` +###### visor app arg killswitch + ``` -Usage: - skywire-cli visor hvpk [flags] + Set app killswitch -Flags: - -w, --http serve public key via http - -i, --input string path of input config file. - -p, --pkg read from /opt/skywire/skywire.json +Usage: + skywire-cli visor app arg killswitch (true|false) [flags] + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + ``` -##### Example +###### visor app arg secure -``` -$ skywire-cli visor hvpk -[0359f02198933550ad5b41a21470a0bbe0f73c0eb6e93d7d279133a0d5bffc645c] ``` -#### visor chvpk + Set app secure -show conected hypervisor(s) +Usage: + skywire-cli visor app arg secure (true|false) [flags] + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + -``` -$ skywire-cli visor chvpk ``` -##### Example +###### visor app arg passcode -``` -$ skywire-cli visor chvpk -[0359f02198933550ad5b41a21470a0bbe0f73c0eb6e93d7d279133a0d5bffc645c] ``` -#### visor info + Set app passcode. + + "remove" is a special arg to remove the passcode -summary of visor info +Usage: + skywire-cli visor app arg passcode [flags] + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + ``` -$ skywire-cli visor info + +###### visor app arg netifc + ``` +Set app network interface. + + "remove" is a special arg to remove the netifc -##### Example +Usage: + skywire-cli visor app arg netifc [flags] + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + ``` -$ skywire-cli visor info -.:: Visor Summary ::. -Public key: "038229af479f87c8132e84884487b8985f55b49c8e0aa17ac715f0270678c33f2a" -Symmetric NAT: false -IP: 192.168.254.130 -DMSG Server: "0371ab4bcff7b121f4b91f6856d6740c6f9dc1fe716977850aeb5d84378b300a13" -Ping: "477.203238ms" -Visor Version: unknown -Skybian Version: -Uptime Tracker: healthy -Time Online: 4242.082701 seconds -Build Tag: + +#### visor exec ``` -#### visor version + Execute a command -version and build info +Usage: + skywire-cli visor exec [flags] + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + -``` -$ skywire-cli visor version ``` -##### Example +#### visor hv -``` -$ skywire-cli visor version -Version "v1.0.0" built on "2022-05-26T18:18:39Z" against commit "668d5ad8" ``` -#### visor app + Hypervisor + + Access the hypervisor UI + View remote hypervisor public key -``` -$ skywire-cli visor app -app settings +Usage: + skywire-cli visor hv [flags] + +Available Commands: + ui open Hypervisor UI in default browser + cpk Public key of remote hypervisor(s) set in config + pk Public key of remote hypervisor(s) + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + -Usage: - skywire-cli visor app [command] +``` -Available Commands: - ls list apps - start launch app - stop halt app - autostart set autostart flag for app - log logs from app since RFC3339Nano-formated timestamp. - "beginning" is a special timestamp to fetch all the logs +##### visor hv ui ``` -##### app ls + open Hypervisor UI in default browser -list apps +Usage: + skywire-cli visor hv ui [flags] + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + -``` -$ skywire-cli visor app ls ``` -##### Example +##### visor hv cpk -``` -$ skywire-cli visor app ls -app ports auto_start status -skychat 1 true running -skysocks 3 true running -skysocks-client 13 false stopped -vpn-server 44 false stopped -vpn-client 43 false stopped ``` -#### app start + Public key of remote hypervisor(s) set in config -start application +Usage: + skywire-cli visor hv cpk [flags] + +Flags: + -w, --http serve public key via http + -i, --input string path of input config file. + -p, --pkg read from /opt/skywire/skywire.json + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + -``` -$ skywire-cli visor app start ``` -##### Example +##### visor hv pk ``` -$ skywire-cli visor app start vpn-server -OK -``` - -#### app stop +Public key of remote hypervisor(s) which are currently connected to -stop application +Usage: + skywire-cli visor hv pk [flags] + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + -``` -$ skywire-cli visor app stop ``` -##### Example +#### visor pk ``` -$ skywire-cli visor app stop skychat -OK -``` - -#### app autostart + Public key of the visor -set autostart flag for app +Usage: + skywire-cli visor pk [flags] + +Flags: + -w, --http serve public key via http + -i, --input string path of input config file. + -p, --pkg read from /opt/skywire/skywire.json + -x, --prt string serve public key via http (default "7998") + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + -``` -$ skywire-cli visor app autostart (on|off) ``` -##### Example +#### visor info -``` -$ skywire-cli visor app autostart vpn-server on -OK ``` -#### app logs + Summary of visor info -logs from app since RFC3339Nano-formated timestamp. - "beginning" is a special timestamp to fetch all the logs +Usage: + skywire-cli visor info [flags] + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + ``` -$ skywire-cli visor app logs -``` -##### Example +#### visor ver ``` -$ skywire-cli visor app log skysocks beginning - [2022-03-11T21:15:55-06:00] INFO [public_autoconnect]: Fetching public visors - [2022-03-11T21:16:06-06:00] INFO [public_autoconnect]: Fetching public visors - [2022-03-11T21:16:09-06:00] INFO [dmsgC]: Session stopped. error="failed to serve dialed session to 0371ab4bcff7b121f4b91f6856d6740c6f9dc1fe716977850aeb5d84378b300a13: EOF" - [2022-03-11T21:16:09-06:00] WARN [dmsgC]: Stopped accepting streams. error="EOF" session=0371ab4bcff7b121f4b91f6856d6740c6f9dc1fe716977850aeb5d84378b300a13 - [2022-03-11T21:16:10-06:00] INFO [dmsgC]: Dialing session... remote_pk=0281a102c82820e811368c8d028cf11b1a985043b726b1bcdb8fce89b27384b2cb - [2022-03-11T21:16:14-06:00] INFO [dmsgC]: Serving session. remote_pk=0281a102c82820e811368c8d028cf11b1a985043b726b1bcdb8fce89b27384b2cb + + Version and build info + +Usage: + skywire-cli visor ver [flags] + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + + ``` #### visor route ``` -$ skywire-cli visor route -view and set rules -Usage: - skywire-cli visor route [command] + View and set routing rules -Available Commands: - ls-rules list routing rules - rule return routing rule by route ID key - rm-rule remove routing rule - add-rule add routing rule +Usage: + skywire-cli visor route [flags] + +Available Commands: + ls-rules List routing rules + rule Return routing rule by route ID key + rm-rule Remove routing rule + add-rule Add routing rule + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + ``` -#### route add-rule +##### visor route ls-rules -``` -$ skywire-cli visor route add-rule (app | fwd ) [flags] ``` -##### Example + List routing rules -``` -$ skywire-cli visor route add-rule -h -add routing rule +Usage: + skywire-cli visor route ls-rules [flags] + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + -Usage: - skywire-cli visor route add-rule (app | fwd ) [flags] +``` -Flags: - --keep-alive duration duration after which routing rule will expire if no activity is present (default 30s) +##### visor route rule ``` -#### route rm-rule + Return routing rule by route ID key -Removes a routing rule +Usage: + skywire-cli visor route rule [flags] + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + -``` -$ skywire-cli visor route rm-rule ``` -##### Example +##### visor route rm-rule ``` -$ skywire-cli visor route rm-rule -h -Removes a routing rule via route ID key -Usage: - skywire-cli visor rm-rule [flags] + Remove routing rule -``` +Usage: + skywire-cli visor route rm-rule [flags] + +Flags: + -a, --all remove all routing rules + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + -#### route ls-rules +``` -list routing rules +##### visor route add-rule -``` -$ skywire-cli visor route ls-rules ``` -#### route rule + Add routing rule + +Usage: + skywire-cli visor route add-rule ( app | fwd | intfwd ) [flags] + +Available Commands: + app Add app/consume routing rule + fwd Add forward routing rule + intfwd Add intermediary forward routing rule + +Flags: + --keep-alive duration timeout for rule expiration (default 30s) + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + -``` -$ skywire-cli visor route rule ``` -##### Example +###### visor route add-rule app ``` -$ skywire-cli visor route rule -h -Returns a routing rule via route ID key -Usage: - skywire-cli visor route rule [flags] + Add app/consume routing rule + +Usage: + skywire-cli visor route add-rule app \ + \ + \ + \ + \ + \ + || [flags] + +Flags: + -i, --rid string route id + -l, --lpk string local public key + -m, --lpt string local port + -p, --rpk string remote pk + -q, --rpt string remote port + +Global Flags: + --keep-alive duration timeout for rule expiration (default 30s) + --rpc string RPC server address (default "localhost:3435") + ``` -#### visor tp +###### visor route add-rule fwd ``` -view and set transports -Usage: - skywire-cli visor tp [command] + Add forward routing rule -Available Commands: - disc discover transport(s) by ID or public key - type transport types used by the local visor - ls available transports - id transport summary by id - add add a transport - rm remove transport(s) by id +Usage: + skywire-cli visor route add-rule fwd \ + \ + \ + \ + \ + \ + \ + \ + || [flags] + +Flags: + -i, --rid string route id + -j, --nrid string next route id + -k, --ntpid string next transport id + -l, --lpk string local public key + -m, --lpt string local port + -p, --rpk string remote pk + -q, --rpt string remote port + +Global Flags: + --keep-alive duration timeout for rule expiration (default 30s) + --rpc string RPC server address (default "localhost:3435") + ``` -#### tp add - -add transport +###### visor route add-rule intfwd ``` -$ skywire-cli visor tp add [flags] -``` -##### Example + Add intermediary forward routing rule + +Usage: + skywire-cli visor route add-rule intfwd \ + \ + \ + \ + || [flags] + +Flags: + -i, --rid string route id + -n, --nrid string next route id + -t, --tpid string next transport id + +Global Flags: + --keep-alive duration timeout for rule expiration (default 30s) + --rpc string RPC server address (default "localhost:3435") + ``` -$ skywire-cli visor tp add -h -Adds a new transport -Usage: - skywire-cli visor add-tp [flags] +#### visor halt -Flags: - --public whether to make the transport public (deprecated) - -t, --timeout duration if specified, sets an operation timeout - --type string type of transport to add; if unspecified, cli will attempt to establish a transport in the following order: stcp, stcpr, sudph, dmsg ``` -#### tp disc + Stop a running visor -discover transport(s) by ID or public key +Usage: + skywire-cli visor halt [flags] + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + -``` -$ skywire-cli visor tp disc (--id= | --pk=) ``` -##### Example +#### visor start ``` -$ skywire-cli visor tp disc -h -discover transport(s) by ID or public key -Usage: - skywire-cli visor tp disc (--id= | --pk=) [flags] + Start a visor -Flags: - --id transportID if specified, obtains a single transport of given ID (default 00000000-0000-0000-0000-000000000000) - --pk cipher.PubKey if specified, obtains transports associated with given public key (default 000000000000000000000000000000000000000000000000000000000000000000) +Usage: + skywire-cli visor start [flags] + +Flags: + -s, --src 'go run' external commands from the skywire sources + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + ``` -#### tp id - -transport summary by id +#### visor tp ``` -$ skywire-cli visor tp id -``` -##### Example + Transports are bidirectional communication protocols + used between two Skywire Visors (or Transport Edges) + + Each Transport is represented as a unique 16 byte (128 bit) + UUID value called the Transport ID + and has a Transport Type that identifies + a specific implementation of the Transport. + +Usage: + skywire-cli visor tp [flags] + +Available Commands: + type Transport types used by the local visor + ls Available transports + id Transport summary by id + add Add a transport + rm Remove transport(s) by id + disc Discover remote transport(s) + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + ``` -$ skywire-cli visor tp id -h -transport summary by id -Usage: -skywire-cli visor tp [flags] +##### visor tp type + ``` -#### tp ls + Transport types used by the local visor -list transports +Usage: + skywire-cli visor tp type + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + -``` -$ skywire-cli visor tp ls ``` -##### Example +##### visor tp ls -``` -$ skywire-cli visor tp ls -type id remote mode is_up ``` -#### tp type + Available transports -Lists transport types used by the local visor + displays transports of the local visor + +Usage: + skywire-cli visor tp ls [flags] + +Flags: + -t, --types strings show transport(s) type(s) comma-separated + -p, --pks strings show transport(s) for public key(s) comma-separated + -l, --logs show transport logs (default true) + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + -``` -$ skywire-cli visor tp type ``` -##### Example +##### visor tp id -``` -$ skywire-cli visor tp type -dmsg -stcp -stcpr -sudph ``` -#### tp rm + Transport summary by id -remove transport +Usage: + skywire-cli visor tp id (-i) + +Flags: + -i, --id string transport ID + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + -``` -$ skywire-cli visor tp rm ``` -##### Example +##### visor tp add ``` -$ skywire-cli visor tp rm -h -Removes transport with given id - -Usage: - skywire-cli visor tp rm [flags] -``` + Add a transport + If the transport type is unspecified, + the visor will attempt to establish a transport + in the following order: skywire-tcp, stcpr, sudph, dmsg -#### visor start +Usage: + skywire-cli visor tp add (-p) + +Flags: + -r, --rpk string remote public key. + -o, --timeout duration if specified, sets an operation timeout + -t, --type string type of transport to add. + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + -Start a visor -``` -$ skywire-cli visor start ``` -``` -Flags: - -s, --src 'go run' external commands from the skywire sources +##### visor tp rm + ``` -#### visor halt + Remove transport(s) by id -Stop a running visor +Usage: + skywire-cli visor tp rm ( -a || -i ) + +Flags: + -a, --all remove all transports + -i, --id string remove transport of given ID + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + ``` -$ skywire-cli visor halt + +##### visor tp disc + ``` -### vpn usage + Discover remote transport(s) by ID or public key -vpn interface +Usage: + skywire-cli visor tp disc (--id= || --pk=) + +Flags: + -i, --id string obtain transport of given ID + -p, --pk string obtain transports by public key + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + +``` + +### vpn ``` -$ skywire-cli vpn controls for VPN client -Usage: - skywire-cli vpn [command] - -Available Commands: - list List public VPN servers - ui Open VPN UI in default browser - url Show VPN UI URL - start start the vpn for - stop stop the vpn - status vpn status +Usage: + skywire-cli vpn [flags] + +Available Commands: + list List public VPN servers + ui Open VPN UI in default browser + url Show VPN UI URL + start start the vpn for + stop stop the vpn + status vpn status + +Flags: + --rpc string RPC server address (default "localhost:3435") + ``` #### vpn list -The vpn list subcommand queries the list of [public VPN servers](https://sd.skycoin.com/api/services?type=vpn) from the service discovery, with optional filters for country and version. - -List [public VPN servers](https://sd.skycoin.com/api/services?type=vpn) - ``` -Usage: - skywire-cli vpn list [flags] +List public VPN servers -Flags: +Usage: + skywire-cli vpn list [flags] + +Flags: -c, --country string filter results by country -n, --nofilter provide unfiltered results - -s, --stats return only a count of the resuts - -y, --systray format results for systray - -v, --ver string filter results by version + -s, --stats return only a count of the results + -v, --ver string filter results by version + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + ``` -##### Example +#### vpn ui ``` -$ skywire-cli vpn list -s -293 VPN Servers +Open VPN UI in default browser -$ skywire-cli vpn list -[ - { - "address": "0214948797b58e60febb3c9f977c92203474a3fde470c28fe0b2adc91bf6f3015b:44", - "type": "vpn", - "geo": { - "lat": 0.52, - "lon": 101.44, - "country": "ID", - "region": "RI" - }, - "version": "v0.6.0" - }, - { - "address": "0231fb93b9f5b4e2b9a71a58aa35165b16eaae7df764a839561d008e221d58b148:44", - "type": "vpn", - "geo": { - "lat": 40.5992, - "lon": -77.5768, - "country": "US", - "region": "PA" - }, - "version": "v0.5.1" - }, - { - "address": "02fc1c9e9e78c644e0818cbfbd66585c9c8d664ada0fbf1b89c1afd42178739559:44", - "type": "vpn", - "geo": { - "lat": 33.14, - "lon": -96.75, - "country": "US", - "region": "TX" - }, - "version": "v1.0.0" - }, - { - "address": "029fffe4ffc40d15d2d739b21c8d69c1a7b63e72ad9a6827c6c370cea01dc8e5d4:44", - "type": "vpn", - "geo": { - "lat": 46.88, - "lon": -71.34, - "country": "CA", - "region": "QC" - }, - "version": "v1.0.1" - }, +Usage: + skywire-cli vpn ui [flags] + +Flags: + -c, --config string config path + -p, --pkg use package config path + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + -$ skywire-cli vpn list -y -03287341eb55277a0e8a1c20328900fe955d9fa184989c10dc4218e494e77d7bf3 | GR -031888409f7d5ae26c0dd46b970cc06d75d1b494feacac7c152008811e3c5cc797 | ID -021e95f178a1cace6658d22fa9445101c7001531c75b444fc2f1b92d44bfbba753 | ID -039b61cb88caf9d18104cd661a242607ba174f33fa5df548e6eb5308414002f570 | CA -021d2bb4e3f414bb39fbe2a2f273004b55e611ebfb8fcff7d0795340945e27e36f | US -0277b420e9abeae438a98c63c175ad3f5ba6f02181eb230f1b00eaf16858eef71b | NL -0278df107bdcade217f0a75330122f7d9df3e43f2635686824506f61b21fae2fb5 | BH -03b99bbebafb5dcb0035faf86d84766355fb989da8497ad7128d789bc511e46e52 | ID -02921cd31fc4aaec49b6f460ec87103cfd931cecd6b84007c5d66b1e7af1ba98b8 | CA -03a367c310c4d921a3315dbc3940673f32dcbecb401439c20aeb713558cf6726b2 | US -03fbbacd70dcc16d4336f006d5a5316a4a3e0ea21839ea70228ae164921a731d53 | GR -0280b94366b93d3f145b4ee7a5c4e36a23ee673043a0d9bb8d69fd983fedbf67c6 | ID -03ec7911e471ce4da2ede75c0c1cfe0ead7416c77bfac8b94d8d2456d9d7148abc - -$ skywire-cli vpn list -c US -v 1.0.1 -[ - { - "address": "03a367c310c4d921a3315dbc3940673f32dcbecb401439c20aeb713558cf6726b2:44", - "type": "vpn", - "geo": { - "lat": 39.37, - "lon": -104.86, - "country": "US", - "region": "CO" - }, - "version": "v1.0.1" - }, - { - "address": "0356c02912e2df48afe47b258b98e28b2dea3dd04eb9a6b0d4975ee962959c3834:44", - "type": "vpn", - "geo": { - "lat": 36, - "lon": -83.91, - "country": "US", - "region": "TN" - }, - "version": "v1.0.1" - }, - { - "address": "0311112186dabc0371dce9b8ae0d1a7b4429ec5b8197dd316d3a67b6ec8d5acb9a:44", - "type": "vpn", - "geo": { - "lat": 37.76, - "lon": -122.49, - "country": "US", - "region": "CA" - }, - "version": "v1.0.1" - }, - { - "address": "023d87ddc1ceb2cff04315781a7a70cc8ee7c664a532e428de8da994e815608f1c:44", - "type": "vpn", - "geo": { - "lat": 37.76, - "lon": -122.49, - "country": "US", - "region": "CA" - }, - "version": "v1.0.1" - }, - { - "address": "024034dd09cbff03787db740124496ce8fdbe0cac2a51e20366cb59be10b665506:44", - "type": "vpn", - "geo": { - "lat": 33.14, - "lon": -96.75, - "country": "US", - "region": "TX" - }, - "version": "v1.0.1" - }, - { - "address": "025530eb5e5fd04c1c91d02b405787552d71bde13c9946d33a9a43acf67b7031fc:44", - "type": "vpn", - "geo": { - "lat": 37.76, - "lon": -122.49, - "country": "US", - "region": "CA" - }, - "version": "v1.0.1" - }, -... ``` -#### vpn start - -The vpn start subcommand requires a vpn server public key as argument. -A key may be selected from the output of `skywire-cli vpn list` +#### vpn url ``` -$ skywire-cli vpn start -h -start the vpn for +Show VPN UI URL -Usage: - skywire-cli vpn start [flags] +Usage: + skywire-cli vpn url [flags] + +Flags: + -c, --config string config path + -p, --pkg use package config path + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + ``` -#### vpn stop - -stop the vpn +#### vpn start ``` -$ skywire-cli vpn stop -h +start the vpn for -Usage: - skywire-cli vpn stop [flags] +Usage: + skywire-cli vpn start [flags] + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + ``` -#### vpn status - -vpn status +#### vpn stop ``` -Usage: - skywire-cli vpn status [flags] -``` +stop the vpn -##### Example +Usage: + skywire-cli vpn stop [flags] + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + ``` -$ skywire-cli vpn status -stopped -``` +#### vpn status -#### vpn ui +``` +vpn status -Open VPN UI in default browser +Usage: + skywire-cli vpn status [flags] + +Global Flags: + --rpc string RPC server address (default "localhost:3435") + ``` -$ skywire-cli vpn ui -``` +### reward -##### Example - -``` -$ skywire-cli vpn ui ``` -the VPN user interface is opened in the default browser + reward address setting -#### vpn url + Sets the skycoin reward address for the visor. + The config is written to the root of the default local directory -Show VPN UI URL + this config is served via dmsghttp along with transport logs + and the system hardware survey for automating reward distribution -``` -$ skywire-cli vpn url -``` +Usage: + skywire-cli reward
|| [flags] + +Flags: + --all show all flags + +``` -##### Example +### survey ``` -$ skywire-cli visor vpn url -http://127.0.0.1:8000/#/vpn/027087fe40d97f7f0be4a0dc768462ddbb371d4b9e7679d4f11f117d757b9856ed/ -``` +print the system survey +Usage: + skywire-cli survey + +Flags: + -s, --sha generate checksum of system survey + -### rtfind usage +``` ``` -skywire-cli rtfind +{ + "public_key": "000000000000000000000000000000000000000000000000000000000000000000", + "go_os": "linux", + "go_arch": "amd64", + "zcalusic_sysinfo": { + "sysinfo": { + "version": "0.9.5", + "timestamp": "2022-11-06T15:20:05.362595094-06:00" + }, + "node": { + "hostname": "mainframe", + "machineid": "42830379b8ff476696287310f5a62b25", + "timezone": "America/Chicago" + }, + "os": { + "name": "EndeavourOS", + "vendor": "endeavouros", + "architecture": "amd64" + }, + "kernel": { + "release": "6.0.2-arch1-1", + "version": "#1 SMP PREEMPT_DYNAMIC Sat, 15 Oct 2022 14:00:49 +0000", + "architecture": "x86_64" + }, + "product": { + "name": "System Product Name", + "vendor": "System manufacturer", + "version": "System Version", + "serial": "System Serial Number" + }, + "board": { + "name": "P8Z77-V LK", + "vendor": "ASUSTeK COMPUTER INC.", + "version": "Rev X.0x", + "serial": "130106735703073", + "assettag": "To be filled by O.E.M." + }, + "chassis": { + "type": 3, + "vendor": "Chassis Manufacture", + "version": "Chassis Version", + "serial": "Chassis Serial Number", + "assettag": "Asset-1234567890" + }, + "bios": { + "vendor": "American Megatrends Inc.", + "version": "1402", + "date": "03/21/2014" + }, + "cpu": { + "vendor": "GenuineIntel", + "model": "Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz", + "speed": 3511, + "cache": 8192, + "cpus": 1, + "cores": 4, + "threads": 8 + }, + "memory": { + "type": "DDR3", + "speed": 1333, + "size": 32768 + }, + "storage": [ + { + "name": "nvme0n1", + "model": "SPCC M.2 PCIe SSD", + "serial": "2A1407950FDE00144440", + "size": 512 + }, + { + "name": "sda", + "driver": "sd", + "vendor": "ATA", + "model": "JAJS600M128C", + "serial": "30040655310", + "size": 128 + }, + { + "name": "sdb", + "driver": "sd", + "vendor": "ATA", + "model": "WDC WD10EURX-61U", + "serial": "WD-WCC4J1FTPZKE", + "size": 1000 + }, + { + "name": "sdc", + "driver": "sd", + "vendor": "ATA", + "model": "SanDisk SDSSDA12", + "serial": "174470463509", + "size": 120 + }, + { + "name": "sdd", + "driver": "sd", + "vendor": "ATA", + "model": "WDC WD20EVDS-63T", + "serial": "WD-WCAVY3707401", + "size": 2000 + }, + { + "name": "sde", + "driver": "sd", + "vendor": "Generic", + "model": "STORAGE DEVICE", + "serial": "000000001532" + } + ], + "network": [ + { + "name": "enp3s0", + "driver": "r8169", + "macaddress": "60:a4:4c:5e:97:68", + "port": "tp/mii", + "speed": 1000 + } + ] + }, + "ip.skycoin.com": { + "ip_address": "70.121.6.231", + "latitude": 33.1371, + "longitude": -96.7488, + "postal_code": "75035", + "continent_code": "NA", + "country_code": "US", + "country_name": "United States", + "region_code": "TX", + "region_name": "Texas", + "province_code": "", + "province_name": "", + "city_name": "Frisco", + "timezone": "America/Chicago" + }, + "ip_addr": [ + { + "ifindex": 1, + "ifname": "lo", + "flags": [ + "LOOPBACK", + "UP", + "LOWER_UP" + ], + "mtu": 65536, + "qdisc": "noqueue", + "operstate": "UNKNOWN", + "group": "default", + "txqlen": 1000, + "link_type": "loopback", + "address": "00:00:00:00:00:00", + "broadcast": "00:00:00:00:00:00", + "addr_info": [ + { + "family": "inet", + "local": "127.0.0.1", + "prefixlen": 8, + "scope": "host", + "label": "lo", + "valid_life_time": 4294967295, + "preferred_life_time": 4294967295 + }, + { + "family": "inet6", + "local": "::1", + "prefixlen": 128, + "scope": "host", + "valid_life_time": 4294967295, + "preferred_life_time": 4294967295 + } + ] + }, + { + "ifindex": 2, + "ifname": "enp3s0", + "flags": [ + "BROADCAST", + "MULTICAST", + "UP", + "LOWER_UP" + ], + "mtu": 1500, + "qdisc": "fq_codel", + "operstate": "UP", + "group": "default", + "txqlen": 1000, + "link_type": "ether", + "address": "60:a4:4c:5e:97:68", + "broadcast": "ff:ff:ff:ff:ff:ff", + "addr_info": [ + { + "family": "inet", + "local": "192.168.2.130", + "prefixlen": 24, + "scope": "global", + "label": "enp3s0", + "valid_life_time": 62314, + "preferred_life_time": 62314 + }, + { + "family": "inet6", + "local": "fe80::a1b:9c1b:5864:f12b", + "prefixlen": 64, + "scope": "link", + "valid_life_time": 4294967295, + "preferred_life_time": 4294967295 + } + ] + } + ], + "ghw_blockinfo": { + "total_size_bytes": 3760783810560, + "disks": [ + { + "name": "nvme0n1", + "size_bytes": 512110190592, + "physical_block_size_bytes": 512, + "drive_type": "ssd", + "removable": false, + "storage_controller": "nvme", + "bus_path": "pci-0000:01:00.0-nvme-1", + "vendor": "unknown", + "model": "SPCC M.2 PCIe SSD", + "serial_number": "2A1407950FDE00144440", + "wwn": "nvme.1987-3241313430373935304644453030313434343430-53504343204d2e32205043496520535344-00000001", + "partitions": [ + { + "name": "nvme0n1p1", + "label": "unknown", + "mount_point": "/mnt/nvme0n1p1", + "size_bytes": 512104884224, + "type": "ext4", + "read_only": false, + "uuid": "06f46744-01" + } + ] + }, + { + "name": "sda", + "size_bytes": 128035676160, + "physical_block_size_bytes": 512, + "drive_type": "ssd", + "removable": false, + "storage_controller": "scsi", + "bus_path": "pci-0000:00:1f.2-ata-1.0", + "vendor": "ATA", + "model": "JAJS600M128C", + "serial_number": "30040655310", + "wwn": "0x5000000000002e39", + "partitions": [ + { + "name": "sda1", + "label": "unknown", + "mount_point": "/", + "size_bytes": 128033659904, + "type": "ext4", + "read_only": false, + "uuid": "72295fef-01" + } + ] + }, + { + "name": "sdb", + "size_bytes": 1000204886016, + "physical_block_size_bytes": 4096, + "drive_type": "hdd", + "removable": false, + "storage_controller": "scsi", + "bus_path": "pci-0000:00:1f.2-ata-2.0", + "vendor": "ATA", + "model": "WDC_WD10EURX-61UY4Y0", + "serial_number": "WD-WCC4J1FTPZKE", + "wwn": "0x50014ee262644326", + "partitions": [] + }, + { + "name": "sdc", + "size_bytes": 120034123776, + "physical_block_size_bytes": 512, + "drive_type": "ssd", + "removable": false, + "storage_controller": "scsi", + "bus_path": "pci-0000:00:1f.2-ata-3.0", + "vendor": "ATA", + "model": "SanDisk_SDSSDA120G", + "serial_number": "174470463509", + "wwn": "0x5001b444a9bb77cd", + "partitions": [ + { + "name": "sdc1", + "label": "unknown", + "mount_point": "/boot1", + "size_bytes": 536870912, + "type": "ext4", + "read_only": false, + "uuid": "570655b4-01" + }, + { + "name": "sdc2", + "label": "files", + "mount_point": "/home1", + "size_bytes": 119495720960, + "type": "ext4", + "read_only": false, + "uuid": "570655b4-02" + } + ] + }, + { + "name": "sdd", + "size_bytes": 2000398934016, + "physical_block_size_bytes": 512, + "drive_type": "hdd", + "removable": false, + "storage_controller": "scsi", + "bus_path": "pci-0000:00:1f.2-ata-5.0", + "vendor": "ATA", + "model": "WDC_WD20EVDS-63T3B0", + "serial_number": "WD-WCAVY3707401", + "wwn": "0x50014ee20473d45a", + "partitions": [] + }, + { + "name": "sde", + "size_bytes": 0, + "physical_block_size_bytes": 512, + "drive_type": "hdd", + "removable": true, + "storage_controller": "scsi", + "bus_path": "pci-0000:00:14.0-usb-0:4:1.0-scsi-0:0:0:0", + "vendor": "Generic", + "model": "STORAGE_DEVICE", + "serial_number": "000000001532", + "wwn": "unknown", + "partitions": [] + } + ] + }, + "ghw_productinfo": { + "family": "To be filled by O.E.M.", + "name": "System Product Name", + "vendor": "System manufacturer", + "serial_number": "System Serial Number", + "uuid": "306d1ca0-d7da-11dd-b04f-60a44c5e9768", + "sku": "SKU", + "version": "System Version" + }, + "ghw_memoryinfo": { + "total_physical_bytes": 34091302912, + "total_usable_bytes": 33333571584, + "supported_page_sizes": [ + 2097152 + ], + "modules": null + }, + "uuid": "978ddf7d-950a-4046-bf40-fcab8ad3d3b1", + "skywire_version": "v1.2.0" +} ``` -##### Example +### rtfind ``` -$ skywire-cli rtfind -h - Query the Route Finder -Usage: - skywire-cli rtfind [flags] - -Flags: - -a, --addr string route finder service address (default "http://rf.skywire.skycoin.com") - -x, --max-hops uint16 maximum hops (default 1000) +Usage: + skywire-cli rtfind [flags] + +Flags: -n, --min-hops uint16 minimum hops (default 1) + -x, --max-hops uint16 maximum hops (default 1000) -t, --timeout duration request timeout (default 10s) + -a, --addr string route finder service address + (default "http://rf.skywire.skycoin.com") + + ``` -### mdisc usage +### mdisc ``` Query remote DMSG Discovery -Usage: - skywire-cli mdisc [command] - -Available Commands: - entry fetch an entry - servers fetch available servers +Usage: + skywire-cli mdisc + +Available Commands: + entry Fetch an entry + servers Fetch available servers + -Flags: - --addr string address of DMSG discovery server - (default "http://dmsgd.skywire.skycoin.com") ``` -#### servers +#### mdisc entry ``` -$ skywire-cli mdisc servers -``` +Fetch an entry -``` -Flags: +Usage: + skywire-cli mdisc entry [flags] + +Flags: --addr string address of DMSG discovery server - (default "http://dmsgd.skywire.skycoin.com") + (default "http://dmsgd.skywire.skycoin.com") + + ``` -##### Example +#### mdisc servers ``` -$ skywire-cli mdisc server -[2022-03-13T21:10:44-05:00] DEBUG disc.NewHTTP [mdisc:disc]: Created HTTP client. addr="http://dmsgd.skywire.skycoin.com" -version registered public-key address available-sessions -0.0.1 1647224020460616235 02347729662a901d03f1a1ab6c189a173349fa11e79fe82117cca0f8d0e4d64a31 192.53.115.181:8082 2582 -0.0.1 1647224015059832662 02e4660279c83bc6ca0122d3a78c0cb3f3564e03e04876ae7fa30b4e0a63217425 192.53.115.181:8081 1299 -0.0.1 1647224018690620887 02a2d4c346dabd165fd555dfdba4a7f4d18786fe7e055e562397cd5102bdd7f8dd dmsg.server02a2d4c3.skywire.skycoin.com:30081 1109 -0.0.1 1647224019967944735 0371ab4bcff7b121f4b91f6856d6740c6f9dc1fe716977850aeb5d84378b300a13 192.53.114.142:30086 582 -0.0.1 1647224016544544252 0228af3fd99c8d86a882495c8e0202bdd4da78c69e013065d8634286dd4a0ac098 45.118.133.242:30084 48 -0.0.1 1647224021047139719 03717576ada5b1744e395c66c2bb11cea73b0e23d0dcd54422139b1a7f12e962c4 dmsg.server03717576.skywire.skycoin.com:30082 31 -0.0.1 1647224018229901714 0281a102c82820e811368c8d028cf11b1a985043b726b1bcdb8fce89b27384b2cb 192.53.114.142:30085 19 -0.0.1 1647224017051283856 02a49bc0aa1b5b78f638e9189be4ed095bac5d6839c828465a8350f80ac07629c0 dmsg.server02a4.skywire.skycoin.com:30089 1 +Fetch available servers + +Usage: + skywire-cli mdisc servers [flags] + +Flags: + --addr string address of DMSG discovery server + (default "http://dmsgd.skywire.skycoin.com") + ``` -#### entry +### completion ``` -$ skywire-cli mdisc entry -``` +Generate completion script + +Usage: + skywire-cli completion [bash|zsh|fish|powershell] + ``` -Flags: - --addr string address of DMSG discovery server + +### tree + ``` +subcommand tree -##### Example +Usage: + skywire-cli tree + ``` -$ skywire-cli mdisc entry 034b68c4d8ec6d934d3ecb28595fea7e89a8de2048f0f857759c5018cb8e2f9525 -[2022-03-13T21:17:11-05:00] DEBUG disc.NewHTTP [mdisc:disc]: Created HTTP client. addr="http://dmsgd.skywire.skycoin.com" - version: 0.0.1 - sequence: 4 - registered at: 1647205336195743639 - static public key: 034b68c4d8ec6d934d3ecb28595fea7e89a8de2048f0f857759c5018cb8e2f9525 - signature: 7a7cee456a17b13207a8eba6dd60102505e0d5b3b98f047225da8bfc8e963a557c75fbbba5c7654835230c9372d6faae2f7570bb71b1af9d36cbdc4da195b74701 - entry is registered as client. Related info: - delegated servers: - 0371ab4bcff7b121f4b91f6856d6740c6f9dc1fe716977850aeb5d84378b300a13 + +### doc + ``` +generate markdown docs + UNHIDEFLAGS=1 skywire-cli doc -### completion usage +Usage: + skywire-cli doc + -``` -#skywire-cli completion ``` -``` -To load completions +### -Usage: - skywire-cli completion [bash|zsh|fish|powershell] +``` ``` diff --git a/cmd/skywire-cli/commands/config/gen.go b/cmd/skywire-cli/commands/config/gen.go index cfa8fd8246..03ad06c7e4 100644 --- a/cmd/skywire-cli/commands/config/gen.go +++ b/cmd/skywire-cli/commands/config/gen.go @@ -87,8 +87,11 @@ func init() { genConfigCmd.Flags().BoolVar(&isAll, "all", false, "show all flags") genConfigCmd.Flags().StringVar(&binPath, "binpath", "", "set bin_path") gHiddenFlags = append(gHiddenFlags, "binpath") - for _, j := range gHiddenFlags { - genConfigCmd.Flags().MarkHidden(j) //nolint + //show all flags on help + if os.Getenv("UNHIDEFLAGS") != "1" { + for _, j := range gHiddenFlags { + genConfigCmd.Flags().MarkHidden(j) //nolint + } } } diff --git a/cmd/skywire-cli/commands/config/root.go b/cmd/skywire-cli/commands/config/root.go index 4e78c31c9f..8dc2aa6978 100644 --- a/cmd/skywire-cli/commands/config/root.go +++ b/cmd/skywire-cli/commands/config/root.go @@ -82,4 +82,5 @@ var ( var RootCmd = &cobra.Command{ Use: "config", Short: "Generate or update a skywire config", + Long: "A primary function of skywire-cli is generating and updating the config file used by skywire-visor.", } diff --git a/cmd/skywire-cli/commands/root.go b/cmd/skywire-cli/commands/root.go index 56a685f02b..73b5f5c582 100644 --- a/cmd/skywire-cli/commands/root.go +++ b/cmd/skywire-cli/commands/root.go @@ -2,9 +2,11 @@ package commands import ( + "fmt" "log" "strings" + "github.com/bitfield/script" cc "github.com/ivanpirog/coloredcobra" "github.com/pterm/pterm" "github.com/pterm/pterm/putils" @@ -84,6 +86,83 @@ var treeCmd = &cobra.Command{ }, } +var docCmd = &cobra.Command{ + Use: "doc", + Short: "gnerate markdown docs", + Long: `generate markdown docs + + UNHIDEFLAGS=1 skywire-cli doc`, + SilenceErrors: true, + SilenceUsage: true, + DisableSuggestions: true, + DisableFlagsInUseLine: true, + Run: func(cmd *cobra.Command, args []string) { + fmt.Printf("\n# %s\n", "skywire-cli documentation") + fmt.Printf("\n%s\n", "skywire command line interface") + + fmt.Printf("\n## %s\n", rootCmd.Use) + fmt.Printf("\n```\n") + rootCmd.Help() //nolint + fmt.Printf("\n```\n") + fmt.Printf("\n## %s\n", "global flags") + fmt.Printf("\n%s\n", "The skywire-cli interacts with the running visor via rpc calls. By default the rpc server is available on localhost:3435. The rpc address and port the visor is using may be changed in the config file, once generated.") + + fmt.Printf("\n%s\n", "It is not recommended to expose the rpc server on the local network. Exposing the rpc allows unsecured access to the machine over the local network") + fmt.Printf("\n```\n") + fmt.Printf("\n%s\n", "Global Flags:") + fmt.Printf("\n%s\n", " --rpc string RPC server address (default \"localhost:3435\")") + fmt.Printf("\n%s\n", " --json bool print output as json") + fmt.Printf("\n```\n") + + fmt.Printf("\n## %s\n", "subcommand tree") + fmt.Printf("\n%s\n", "A tree representation of the skywire-cli subcommands") + fmt.Printf("\n```\n") + //_, _ = script.Exec(`go run cmd/skywire-cli/skywire-cli.go tree`).Stdout() //nolint + fmt.Printf("\n```\n") + + var use string + for _, j := range rootCmd.Commands() { + use = strings.Split(j.Use, " ")[0] + fmt.Printf("\n### %s\n", use) + fmt.Printf("\n```\n") + j.Help() //nolint + fmt.Printf("\n```\n") + if j.Name() == "survey" { + fmt.Printf("\n```\n") + _, _ = script.Exec(`sudo go run cmd/skywire-cli/skywire-cli.go survey`).Stdout() //nolint + fmt.Printf("\n```\n") + } + for _, k := range j.Commands() { + use = strings.Split(j.Use, " ")[0] + " " + strings.Split(k.Use, " ")[0] + fmt.Printf("\n#### %s\n", use) + fmt.Printf("\n```\n") + k.Help() //nolint + fmt.Printf("\n```\n") + if k.Name() == "gen" { + fmt.Printf("\n```\n") + fmt.Printf("$ skywire-cli config gen -bpirxn\n") + _, _ = script.Exec(`go run cmd/skywire-cli/skywire-cli.go config gen -n`).Stdout() //nolint + fmt.Printf("\n```\n") + } + for _, l := range k.Commands() { + use = strings.Split(j.Use, " ")[0] + " " + strings.Split(k.Use, " ")[0] + " " + strings.Split(l.Use, " ")[0] + fmt.Printf("\n##### %s\n", use) + fmt.Printf("\n```\n") + l.Help() //nolint + fmt.Printf("\n```\n") + for _, m := range l.Commands() { + use = strings.Split(j.Use, " ")[0] + " " + strings.Split(k.Use, " ")[0] + " " + strings.Split(l.Use, " ")[0] + " " + strings.Split(m.Use, " ")[0] + fmt.Printf("\n###### %s\n", use) + fmt.Printf("\n```\n") + m.Help() //nolint + fmt.Printf("\n```\n") + } + } + } + } + }, +} + func init() { rootCmd.AddCommand( cliconfig.RootCmd, @@ -96,6 +175,7 @@ func init() { climdisc.RootCmd, clicompletion.RootCmd, treeCmd, + docCmd, ) var jsonOutput bool rootCmd.PersistentFlags().BoolVar(&jsonOutput, internal.JSONString, false, "print output in json") diff --git a/cmd/skywire-visor/README.md b/cmd/skywire-visor/README.md index 56c732c44c..1affa3e8ec 100644 --- a/cmd/skywire-visor/README.md +++ b/cmd/skywire-visor/README.md @@ -29,6 +29,7 @@ _Note: flags for autopeering are only available with the environmental variable ``` $ skywire-visor --help + ┌─┐┬┌─┬ ┬┬ ┬┬┬─┐┌─┐ └─┐├┴┐└┬┘││││├┬┘├┤ └─┘┴ ┴ ┴ └┴┘┴┴└─└─┘ @@ -39,13 +40,16 @@ Usage: Flags: -c, --config string config file to use (default): skywire-config.json -b, --browser open hypervisor ui in default web browser - -i, --hvui run as hypervisor + --systray run as systray + -i, --hvui run as hypervisor * --all show all flags -h, --help help for skywire-visor -v, --version version for skywire-visor + $ skywire-visor --all + ┌─┐┬┌─┬ ┬┬ ┬┬┬─┐┌─┐ └─┐├┴┐└┬┘││││├┬┘├┤ └─┘┴ ┴ ┴ └┴┘┴┴└─└─┘ @@ -56,19 +60,20 @@ Flags: Flags: -c, --config string config file to use (default): skywire-config.json -b, --browser open hypervisor ui in default web browser - -i, --hvui run as hypervisor - -j, --hv string add remote hypervisor PKs at runtime - -k, --xhv disable remote hypervisors set in config file - -l, --hvip string set hypervisor by ip (default "192.168.2.2:7998") - -m, --autopeer enable autopeering -n, --stdin read config from stdin - -q, --pprofmode string pprof mode: cpu, mem, mutex, block, trace, http + --systray run as systray + -i, --hvui run as hypervisor * + -x, --nohvui disable hypervisor * + -j, --hv string add remote hypervisor * + -k, --xhv disable remote hypervisors * + -s, --loglvl string [ debug | warn | error | fatal | panic | trace ] * + -q, --pprofmode string [ cpu | mem | mutex | block | trace | http ] -r, --pprofaddr string pprof http port (default "localhost:6060") -t, --tag string logging tag (default "skywire") -y, --syslog string syslog server address. E.g. localhost:514 -z, --completion string [ bash | zsh | fish | powershell ] - -h, --help help for skywire-visor -v, --version version for skywire-visor + * overrides config file ``` ### Skywire visor flags