Skywire requires a Golang version of 1.16
or higher.
- Skywire
Documentation on skywire-cli interface as well as available flags for skywire-visor
Apps are not executed by the user, but hosted by the visor process
further documentation can be found in the skywire wiki
Pre-compiled resouces
A high-level overview of the process for building skywire from source and the paths and files which comprise the package-based installation is contained in the PKGBUILD
this and other build variants can be built into a package with a single command, using yay
on archlinux
installing 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 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
glibc
orlibc6
unless statically compiled
golang
git
(optional)musl
andkernel-headers-musl
or equivalent - for static compilation
For more information on static compilation, see docs/static-builds.md.
The standard procedure for building software with go
uses the GOPATH
which is conventionally $HOME/go
Software sources are cloned via git
to a path such as $HOME/go/src/github.com/skycoin/skywire
Optionally, the source archive of a versioned release is downloaded from the release section
The binaries which are compiled may optionally be placed in the GOBIN
and then GOBIN
may be added to the PATH
in order that any binaries placed in the GOBIN
will then appear as commands available to execute in the shell or terminal.
basic setup of go
is further described here
Such a setup is optional, but it is documented below, and other examples will refer to this
mkdir -p "${HOME}/go/src/github.com/skycoin/" "${HOME}"/go/bin "${HOME}"/go/apps || true
cd "${HOME}/go/src/src/github.com/skycoin/"
git clone https://github.com/skycoin/skywire
#optionally checkout any branch
git checkout develop
the code below is a rough approximation of make install
which is used in the build function of the skywire packages
export GOPATH="${HOME}/go"
export GOBIN="${GOPATH}/bin"
export _GOAPPS="${GOPATH}/apps"
export GOOS=linux
#use musl-gcc for static compilation
export CC=musl-gcc
cd "${HOME}/go/src/github.com/skycoin/skywire"
#binary versioning
local _version=$(make version)
DMSG_BASE="github.com/skycoin/dmsg"
BUILDINFO_PATH="${DMSG_BASE}/buildinfo"
BUILDINFO_VERSION="${BUILDINFO_PATH}.version=${_version}"
BUILDINFO="${BUILDINFO_VERSION} ${BUILDINFO_DATE} ${BUILDINFO_COMMIT}"
#create the skywire binaries
_pkggopath=github.com/skycoin/skywire
cd "${HOME}"/go/src/${_pkggopath}
_cmddir="${HOME}"/go/src/${_pkggopath}/cmd
cd "${_cmddir}"/apps
_app="$(ls)"
for _i in ${_app}; do
echo "building ${_i} binary"
cd "${_cmddir}/apps/${_i}"
go build -trimpath --ldflags="" --ldflags "${BUILDINFO} -s -w -linkmode external -extldflags '-static' -buildid=" -o $_GOAPPS .
done
echo "building skywire-visor binary"
cd "${_cmddir}"/skywire-visor
go build -trimpath --ldflags="" --ldflags "${BUILDINFO} -s -w -linkmode external -extldflags '-static' -buildid=" -o $GOBIN .
echo "building skywire-cli binary"
cd "${_cmddir}"/skywire-cli
go build -trimpath --ldflags="" --ldflags "${BUILDINFO} -s -w -linkmode external -extldflags '-static' -buildid=" -o $GOBIN .
The installation paths for the skywire as present in the skywire package are detailed below
Note that make install-system-linux
will place the binaries into the system where the package would install them, and is best used for quickly testing changes to ensure they work with the autoconfig script included with the package
#to install directly into the system, use "/"
_pkgdir="/"
#use the appropriate systemd unit installation path for your linux distribution (i.e./etc/systemd/system on .deb distros
_systemddir="usr/lib/systemd/system"
#the base path where skywire is installed
_dir="opt/skywire"
#application binaries ; started by the visor process
_apps="${_dir}/apps"
#main binaries go here
_bin="${_dir}/bin"
#scripts included
_scripts="${_dir}/scripts"
#create the directories
mkdir -p "${_pkgdir}/usr/bin"
mkdir -p "${_pkgdir}/${_dir}/bin"
mkdir -p "${_pkgdir}/${_dir}/apps"
mkdir -p "${_pkgdir}/${_dir}/scripts"
mkdir -p "${_pkgdir}/${_systemddir}"
#the local folder is otherwise produced by the visor on startup
mkdir -p "${_pkgdir}/${_dir}/local"
# instal binaries - assumes nothing else was already in your GOBIN
install -Dm755 "${GOBIN}"/* "${_pkgdir}/${_skybin}/"
#Symlink the binaries into the executable path
for _i in "${_pkgdir}/${_skybin}"/* ; do
ln -rTsf "${_i}" "${_pkgdir}/usr/bin/${_i##*/}"
done
#install the app binaries
install -Dm755 "${_GOAPPS}"/* "${_pkgdir}/${_skyapps}/"
#it is not necessary to symlink these binaries to the executable path but may be useful for debugging
for _i in "${_pkgdir}/${_skyapps}"/* ; do
ln -rTsf "${_i}" "${_pkgdir}/usr/bin/${_i##*/}"
done
#install the dmsghttp-config.json'
install -Dm644 "${HOME}"/go/src/${_pkggopath}/skywire/dmsghttp-config.json" "${_pkgdir}/${_skydir}/dmsghttp-config.json"
Desktop integration, maintenance scripts, and systemd service files are included in the skywire package from the skywire AUR which is managed as a subtree from github.com/skycoin/aur
${srcdir}
in the code below is in reference to the directory containing these other source files
#Install scripts
install -Dm755 "${srcdir}"/skywire-autoconfig "${_pkgdir}/${_skyscripts}/"
ln -rTsf "${_pkgdir}/${_skyscripts}/skywire-autoconfig" "${_pkgdir}"/usr/bin/skywire-autoconfig
#Installing systemd services'
install -Dm644 "${srcdir}"/*.service "${_pkgdir}/${_systemddir}/"
# instal desktop files and icons
mkdir -p "${_pkgdir}"/usr/share/applications/ "${_pkgdir}"/usr/share/icons/hicolor/48x48/apps/
install -Dm644 "${srcdir}"/*.desktop "${_pkgdir}"/usr/share/applications/
install -Dm644 "${srcdir}"/*.png "${_pkgdir}"/usr/share/icons/hicolor/48x48/apps/
skywire-autoconfig is a script is provided with the package which is executed as part of the postinstall process. It serves as a utility for automating:
- config management and updates
- setting remote hypervisors
- restarting the skywire process (via systemd)
- printing helpful text for the user to know what is happening
- generating configuration on boot (for skybian images / chroot installations of skywire)
- detecting environmental variables
for more information regarding this script and the skywire package installation, refer to this wiki article
/
├── opt
│ └── skywire
│ ├── apps
│ │ ├── skychat
│ │ ├── skysocks
│ │ ├── skysocks-client
│ │ ├── vpn-client
│ │ └── vpn-server
│ ├── bin
│ │ ├── skywire-cli
│ │ └── skywire-visor
│ ├── dmsghttp-config.json
│ ├── local
│ └── scripts
│ └── skywire-autoconfig
└── usr
├── bin
│ ├── skychat -> ../../opt/skywire/apps/skychat
│ ├── skysocks -> ../../opt/skywire/apps/skysocks
│ ├── skysocks-client -> ../../opt/skywire/apps/skysocks-client
│ ├── skywire -> ../../opt/skywire/bin/skywire-visor
│ ├── skywire-autoconfig -> ../../opt/skywire/scripts/skywire-autoconfig
│ ├── skywire-cli -> ../../opt/skywire/bin/skywire-cli
│ ├── skywire-visor -> ../../opt/skywire/bin/skywire-visor
│ ├── vpn-client -> ../../opt/skywire/apps/vpn-client
│ └── vpn-server -> ../../opt/skywire/apps/vpn-server
├── lib
│ └── systemd
│ └── system
│ ├── skywire-autoconfig.service
│ ├── skywire.service
└── share
├── applications
│ ├── skywire.desktop
│ └── skywirevpn.desktop
└── icons
└── hicolor
└── 48x48
└── apps
├── skywire.png
└── skywirevpn.png
17 directories, 24 files
build the binaries and apps with go build
make build
output tree
├──skywire-cli
└─┬skywire-visor
└─┬apps
├──skychat
├──skysocks
├──skysocks-client
├──vpn-client
├──vpn-server
└──skychat
install these executables to the GOPATH
make install
$ ./ci_scripts/docker-push.sh -t $(git rev-parse --abbrev-ref HEAD) -b
Running from source as outlined here does not write the config to disk or explicitly compile any binaries. The config is piped from skywire-cli stdout to the visor stdin, and all are executed via go run
.
mkdir -p $HOME/go/src/github.com/skycoin && cd $HOME/go/src/github.com/skycoin
git clone https://github.com/skycoin/skywire.git
cd skywire
make run-source
├──skywire-config.json
└─┬local
├──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
The skywire visor requires a config to run. This config is produced by skywire-cli config gen
The skywire-autoconfig script included with the skywire package handles config generation and updates for the user
Examples of config generation and command / flag documentation can be found in the cmd/skywire-cli/README.md and cmd/skywire-visor/README.md
The most important flags are noted below
In order to expose the hypervisor UI, generate a config file with --is-hypervisor
or -i
flag:
skywire-cli config gen -i
Docker container will create config automatically for you, should you want to run it manually, you can do:
docker run --rm -v <YOUR_CONFIG_DIR>:/opt/skywire \
skycoin/skywire:test skywire-cli config gen -i
Docker container will create config automatically for you, should you want to run it manually, you can do:
$ docker run --rm -v <YOUR_CONFIG_DIR>:/opt/skywire \
skycoin/skywire:latest skywire-cli visor gen-config --is-hypervisor
After starting up the visor, the UI will be exposed by default on localhost:8000
.
Every visor can be controlled by one or more hypervisors. To allow a hypervisor to access a visor, the PubKey of the hypervisor needs to be specified in the configuration file. You can add a remote hypervisor to the config with:
skywire-cli config update --hypervisor-pks <public-key>
or
skywire-cli config gen --hvpk <public-key>
alternatively, this can be done with the skywire-autoconfg script
skywire-autoconfig <public-key>
Or from docker image:
docker run --rm -v <YOUR_CONFIG_DIR>:/opt/skywire \
skycoin/skywire:test skywire-cli config update hypervisor-pks <public-key>
Or from docker image:/* #nosec */
docker run --rm -v <YOUR_CONFIG_DIR>:/opt/skywire \
skycoin/skywire:latest skywire-cli update-config hypervisor-pks <public-key>
skywire-visor
hosts apps and is an applications gateway to the Skywire network.
skywire-visor
requires a valid configuration to be provided. If you want to run a VPN client locally, run the visor
as sudo
.
sudo skywire-visor -c skywire-config.json
if the default skywire-config.json
exists in the current dir, this can be shortened to
sudo skywire-visor
Or from docker image:
# with custom config mounted on docker volume
docker run --rm -p 8000:8000 -v <YOUR_CONFIG_DIR>:/opt/skywire --name=skywire skycoin/skywire:test skywire-visor -c /opt/skywire/<YOUR_CONFIG_NAME>.json
# without custom config (config is automatically generated)
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.
The skywire-cli subcommand skywire-cli fwd
is used to register and connect to http servers over the skynet
If you are interested in running the Skywire VPN as either a client or a server, please refer to the following guides:
To maintain actual skywire-visor
state on users' Skywire nodes we have a mechanism for updating skywire-visor
binaries. Binaries for each version are uploaded to GitHub releases. We
use goreleaser for creating them.
- Make sure that
git
and goreleaser are installed. - Checkout to a commit you would like to create a release against.
- Run
go mod vendor
andgo mod tidy
. - Make sure that
git status
is in clean state. Commit all vendor changes and source code changes. - Uncomment
draft: true
in.goreleaser.yml
if this is a test release. - Create a
git
tag with desired release version and release name:git tag -a 0.1.0 -m "First release"
, where0.1.0
is release version andFirst release
is release name. - Push the created tag to the repository:
git push origin 0.1.0
, where0.1.0
is release version. - ̶I̶s̶s̶u̶e̶ ̶a̶ ̶p̶e̶r̶s̶o̶n̶a̶l̶ ̶G̶i̶t̶H̶u̶b̶ ̶a̶c̶c̶e̶s̶s̶ ̶t̶o̶k̶e̶n̶.̶
- ̶R̶u̶n̶ ̶
̶G̶I̶T̶H̶U̶B̶_̶T̶O̶K̶E̶N̶=̶y̶o̶u̶r̶_̶t̶o̶k̶e̶n̶ ̶m̶a̶k̶e̶ ̶g̶i̶t̶h̶u̶b̶-̶r̶e̶l̶e̶a̶s̶e̶
̶ - Check the created GitHub release.