Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation #1448

Merged
merged 6 commits into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 22 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,13 +307,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`
Expand Down Expand Up @@ -344,14 +344,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)
Expand Down Expand Up @@ -415,7 +415,7 @@ docker run --rm -v <YOUR_CONFIG_DIR>:/opt/skywire \
skycoin/skywire:test skywire-cli config update hypervisor-pks <public-key>
```

Or from docker image:
Or from docker image:/* #nosec */

```
docker run --rm -v <YOUR_CONFIG_DIR>:/opt/skywire \
Expand Down Expand Up @@ -449,9 +449,11 @@ 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
### Using Skywire forwarding for publishing http server over skynet

The skywire-cli subcommand `skywire-cli fwd` is used to register and connect to http servers over the skynet

to be documented
- [skywire forwarding](docs/skywire_forwarding.md)

### Using the Skywire VPN

Expand All @@ -461,11 +463,6 @@ If you are interested in running the Skywire VPN as either a client or a server,
- [Setup the Skywire VPN server](https://github.com/skycoin/skywire/wiki/Skywire-VPN-Server)
- [Package Installation Guide](https://github.com/skycoin/skywire/wiki/Skywire-Package-Installation)

### Using Skywire forwarding for publishing http server over skynet

The skywire-cli subcommand `skywire-cli skyfwd` is used to register and connect to http servers over the skynet

- [skywire forwarding](docs/skywire_forwarding.md)

## Creating a GitHub release

Expand All @@ -483,6 +480,6 @@ use [goreleaser](https://goreleaser.com) for creating them.
6. Create a `git` tag with desired release version and release name: `git tag -a 0.1.0 -m "First release"`,
where `0.1.0` is release version and `First release` is release name.
5. Push the created tag to the repository: `git push origin 0.1.0`, where `0.1.0` is release version.
6. [Issue a personal GitHub access token.](https://github.com/settings/tokens)
7. Run `GITHUB_TOKEN=your_token make github-release`
6. [ ̶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̶.̶](https://github.com/settings/tokens)
7. ̶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̶`̶
8. [Check the created GitHub release.](https://github.com/skycoin/skywire/releases/)
139 changes: 0 additions & 139 deletions docs/deb_install.md

This file was deleted.

10 changes: 5 additions & 5 deletions docs/skywire_app_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Type of apps
Skywire apps can be used in two ways.
1. As a Skywire Visor App
2. As a External App
2. As an External App

### Skywire Visor App
A skywire visor app is started, stopped, monitored and controlled via the skywire visor. The app is controlled via the interface `Proc` which requires a `PROC_CONFIG` env variable that the app reads to
Expand Down Expand Up @@ -104,9 +104,9 @@ The params are
ProcKey: pKey,
}
```
and pass it
and pass it
- `procAddr`
This is required and can be read form a flag in the app. This address is set in the visor config under `launcher/server_addr`.
This is required and can be read form a flag in the app. This address is set in the visor config under `launcher/server_addr`.
The app needs this to create a connection to the visor.
- `procKey *appcommon.ProcKey`
This is required and can be read form a flag in the app. The app needs to be registered to the visor first so that a RPC gateway will await for a connection from the app.
Expand Down Expand Up @@ -136,7 +136,7 @@ The app client has the following methods.
```
the type of network to use (dmsg or skynet),
the public key of the remote visor and
the dmsg or skynet port to connect to on the remote visor.
the dmsg or skynet port to connect to on the remote visor.
It returns a `conn net.Conn` that can be used to read and write to the connected dmsg/skynet app on the remote visor.
- `Listen`
Listen listens on the specified `port` for the incoming connections.
Expand All @@ -148,4 +148,4 @@ The app client has the following methods.
- `Skywire visor app`
For a skywire visor app all info logs should be logged with `fmt.Printf()` which writes to `os.Stdout` and errors with `print()` which writes to `os.Stderr`. This keeps the app logs clean as they are read byt the visor and displayed alongside visor logs.
- `External app`
Any type of logging can be used.
Any type of logging can be used.
38 changes: 24 additions & 14 deletions docs/skywire_forwarding.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
# Skywire forwarding
# Proxy Ports Over Skywire

## Register http server for forwarding
In order to for other visors to connect to the http server we need to register it via either the CLI or directly via the RPC.
## `skywire-cli fwd`

To forward ports over skywire, register the port via the CLI

### CLI
CLI can be used if you do not want to make any changes to the code of the http server or if it is written in another language.

- Register
`skywire-cli skyfwd register -l <local-port>`
`skywire-cli fwd -p <local-port>`
Register a local port to be accessed by remote visors

- deregister
`skywire-cli skyfwd deregister -l <local-port>`
`skywire-cli fwd -d <local-port>`
Deregister a local port to be accessed by remote visors

- ls-ports
`skywire-cli skyfwd ls-ports`
`skywire-cli fwd -l`
List all registered ports

### RPC
RPC can be used to register and deregister within the http server code so that the process is automatic.
First create a RPC client conn to the local visor

RPC can be used for integration with applications to register and deregister within the http server code so that the process is automatic. First create a RPC client conn to the local visor

```
func client() (visor.API, error) {
const rpcDialTimeout = time.Second * 5
Expand All @@ -38,15 +43,20 @@ err = rpcClient.DeregisterHTTPPort(port)


## Connect to the forwarded server
In order to connect to a server forwarded by a remote visor use the CLI.

Connect to a server forwarded by a remote visor.

### CLI

- connect
`skywire-cli skyfwd connect <remote-pk> -l <local-port> -r <remote-port>`
Connect to a server running on a remote visor machine. The http server will then be forwarded to the specified local port.
`skywire-cli rev <remote-pk> -p <local-port> -r <remote-port>`
Connect to a server running on a remote visor machine.
The http server is proxied to the specified local port.

- disconnect
`skywire-cli skyfwd disconnect <id>`
`skywire-cli rev -d <id>`
Disconnect from the server running on a remote visor machine

- ls
`skywire-cli skyfwd ls`
List all ongoing skyforwarding connections
`skywire-cli rev -l`
List all configured connections
6 changes: 4 additions & 2 deletions docs/static-builds.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

You can statically compile all Skywire binaries. Install musl-tools with a package manager of your choice.

musl ports for Mac are not supported.
Note: the binary releases are compiled with musl. The skywire AUR package is also compiled with musl by default.

musl ports for Mac are not supported.

To compile and install the binaries run:

Expand All @@ -12,4 +14,4 @@ $ make build-static # installs all dependencies, build binaries and skywire apps

# Install statically compiled skywire-visor, skywire-cli and app CLI execs.
$ make install-static
```
```
Loading