Skip to content

Commit

Permalink
Merge branch 'mainnet' into feature/reorganize-transport-concurrency
Browse files Browse the repository at this point in the history
  • Loading branch information
ayuryshev committed May 30, 2019
2 parents 529d486 + 3037df7 commit 0b6ebd5
Show file tree
Hide file tree
Showing 22 changed files with 111 additions and 111 deletions.
44 changes: 22 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ config: ## Generate skywire.json

clean: ## Clean project: remove created binaries and apps
-rm -rf ./apps
-rm -f ./skywire-node ./skywire-cli ./setup-node ./manager-node ./thereallssh-cli
-rm -f ./skywire-node ./skywire-cli ./setup-node ./manager-node ./SSH-cli

install: ## Install `skywire-node`, `skywire-cli`, `manager-node`, `therealssh-cli`
${OPTS} go install ./cmd/skywire-node ./cmd/skywire-cli ./cmd/setup-node ./cmd/manager-node ./cmd/therealssh-cli
install: ## Install `skywire-node`, `skywire-cli`, `manager-node`, `SSH-cli`
${OPTS} go install ./cmd/skywire-node ./cmd/skywire-cli ./cmd/setup-node ./cmd/manager-node ./cmd/therealssh-cli

rerun: stop
${OPTS} go build -race -o ./skywire-node ./cmd/skywire-node
Expand Down Expand Up @@ -93,33 +93,33 @@ dep: ## Sorts dependencies

# Apps
host-apps: ## Build app
${OPTS} go build -race -o ./apps/chat.v1.0 ./cmd/apps/chat
${OPTS} go build -race -o ./apps/skychat.v1.0 ./cmd/apps/skychat
${OPTS} go build -race -o ./apps/helloworld.v1.0 ./cmd/apps/helloworld
${OPTS} go build -race -o ./apps/therealproxy.v1.0 ./cmd/apps/therealproxy
${OPTS} go build -race -o ./apps/therealproxy-client.v1.0 ./cmd/apps/therealproxy-client
${OPTS} go build -race -o ./apps/therealssh.v1.0 ./cmd/apps/therealssh
${OPTS} go build -race -o ./apps/therealssh-client.v1.0 ./cmd/apps/therealssh-client
${OPTS} go build -race -o ./apps/socksproxy.v1.0 ./cmd/apps/therealproxy
${OPTS} go build -race -o ./apps/socksproxy-client.v1.0 ./cmd/apps/therealproxy-client
${OPTS} go build -race -o ./apps/SSH.v1.0 ./cmd/apps/therealssh
${OPTS} go build -race -o ./apps/SSH-client.v1.0 ./cmd/apps/therealssh-client

# Bin
bin: ## Build `skywire-node`, `skywire-cli`, `manager-node`, `therealssh-cli`
bin: ## Build `skywire-node`, `skywire-cli`, `manager-node`, `SSH-cli`
${OPTS} go build -race -o ./skywire-node ./cmd/skywire-node
${OPTS} go build -race -o ./skywire-cli ./cmd/skywire-cli
${OPTS} go build -race -o ./setup-node ./cmd/setup-node
${OPTS} go build -race -o ./manager-node ./cmd/manager-node
${OPTS} go build -race -o ./therealssh-cli ./cmd/therealssh-cli
${OPTS} go build -race -o ./SSH-cli ./cmd/therealssh-cli

release: ## Build skywire-node`, skywire-cli, manager-node, therealssh-cli and apps without -race flag
release: ## Build skywire-node`, skywire-cli, manager-node, SSH-cli and apps without -race flag
${OPTS} go build -o ./skywire-node ./cmd/skywire-node
${OPTS} go build -o ./skywire-cli ./cmd/skywire-cli
${OPTS} go build -o ./setup-node ./cmd/setup-node
${OPTS} go build -o ./manager-node ./cmd/manager-node
${OPTS} go build -o ./therealssh-cli ./cmd/therealssh-cli
${OPTS} go build -o ./apps/chat.v1.0 ./cmd/apps/chat
${OPTS} go build -o ./SSH-cli ./cmd/therealssh-cli
${OPTS} go build -o ./apps/skychat.v1.0 ./cmd/apps/skychat
${OPTS} go build -o ./apps/helloworld.v1.0 ./cmd/apps/helloworld
${OPTS} go build -o ./apps/therealproxy.v1.0 ./cmd/apps/therealproxy
${OPTS} go build -o ./apps/therealproxy-client.v1.0 ./cmd/apps/therealproxy-client
${OPTS} go build -o ./apps/therealssh.v1.0 ./cmd/apps/therealssh
${OPTS} go build -o ./apps/therealssh-client.v1.0 ./cmd/apps/therealssh-client
${OPTS} go build -o ./apps/socksproxy.v1.0 ./cmd/apps/therealproxy
${OPTS} go build -o ./apps/socksproxy-client.v1.0 ./cmd/apps/therealproxy-client
${OPTS} go build -o ./apps/SSH.v1.0 ./cmd/apps/therealssh
${OPTS} go build -o ./apps/SSH-client.v1.0 ./cmd/apps/therealssh-client



Expand All @@ -135,12 +135,12 @@ docker-network: ## Create docker network ${DOCKER_NETWORK}
-docker network create ${DOCKER_NETWORK}

docker-apps: ## Build apps binaries for dockerized skywire-node. `go build` with ${DOCKER_OPTS}
-${DOCKER_OPTS} go build -race -o ./node/apps/chat.v1.0 ./cmd/apps/chat
-${DOCKER_OPTS} go build -race -o ./node/apps/skychat.v1.0 ./cmd/apps/skychat
-${DOCKER_OPTS} go build -race -o ./node/apps/helloworld.v1.0 ./cmd/apps/helloworld
-${DOCKER_OPTS} go build -race -o ./node/apps/therealproxy.v1.0 ./cmd/apps/therealproxy
-${DOCKER_OPTS} go build -race -o ./node/apps/therealproxy-client.v1.0 ./cmd/apps/therealproxy-client
-${DOCKER_OPTS} go build -race -o ./node/apps/therealssh.v1.0 ./cmd/apps/therealssh
-${DOCKER_OPTS} go build -race -o ./node/apps/therealssh-client.v1.0 ./cmd/apps/therealssh-client
-${DOCKER_OPTS} go build -race -o ./node/apps/socksproxy.v1.0 ./cmd/apps/therealproxy
-${DOCKER_OPTS} go build -race -o ./node/apps/socksproxy-client.v1.0 ./cmd/apps/therealproxy-client
-${DOCKER_OPTS} go build -race -o ./node/apps/SSH.v1.0 ./cmd/apps/therealssh
-${DOCKER_OPTS} go build -race -o ./node/apps/SSH-client.v1.0 ./cmd/apps/therealssh-client

docker-bin: ## Build `skywire-node`, `skywire-cli`, `manager-node`, `therealssh-cli`. `go build` with ${DOCKER_OPTS}
${DOCKER_OPTS} go build -race -o ./node/skywire-node ./cmd/skywire-node
Expand Down
62 changes: 31 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ $ make
$ OPTS="GSO111MODULE=on GOOS=linux GOARCH=arm" make
```

**Install skywire-node, skywire-cli, manager-node and therealssh-cli**
**Install skywire-node, skywire-cli, manager-node and SSH-cli**

```bash
$ make install # compiles and installs all binaries
Expand Down Expand Up @@ -111,10 +111,10 @@ $ skywire-cli -h

After `skywire-node` is up and running with default environment, default apps are run with the configuration specified in `skywire-config.json`. Refer to the following for usage of the default apps:

- [Chat](/cmd/apps/chat)
- [Chat](/cmd/apps/skychat)
- [Hello World](/cmd/apps/helloworld)
- [The Real Proxy](/cmd/apps/therealproxy) ([Client](/cmd/apps/therealproxy-client))
- [The Real SSH](/cmd/apps/therealssh) ([Client](/cmd/apps/therealssh-client))
- [The Real SSH](/cmd/apps/SSH) ([Client](/cmd/apps/SSH-client))

### Transports

Expand Down Expand Up @@ -182,16 +182,16 @@ This will:
```
./node
├── apps # node `apps` compiled with DOCKER_OPTS
│   ├── chat.v1.0 #
│   ├── skychat.v1.0 #
│   ├── helloworld.v1.0 #
│   ├── therealproxy-client.v1.0 #
│   ├── therealproxy.v1.0 #
│   ├── therealssh-client.v1.0 #
│   └── therealssh.v1.0 #
│   ├── socksproxy-client.v1.0 #
│   ├── socksproxy.v1.0 #
│   ├── SSH-client.v1.0 #
│   └── SSH.v1.0 #
├── local # **Created inside docker**
│   ├── chat # according to "local_path" in skywire-config.json
│   ├── therealproxy #
│   └── therealssh #
│   ├── skychat # according to "local_path" in skywire-config.json
│   ├── socksproxy #
│   └── SSH #
├── PK # contains public key of node
├── skywire # db & logs. **Created inside docker**
│   ├── routing.db #
Expand Down Expand Up @@ -272,7 +272,7 @@ $ docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' S
# 192.168.112
```

#### 3. Open in browser containerized `chat` application
#### 3. Open in browser containerized `skychat` application

```bash
$ firefox http://$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' SKY01):8000
Expand All @@ -289,43 +289,43 @@ $ mkdir /tmp/SKYNODE
# 2. compile `skywire-node`
$ GO111MODULE=on GOOS=linux go build -o /tmp/SKYNODE/skywire-node ./cmd/skywire-node
# 3. compile apps
$ GO111MODULE=on GOOS=linux go build -o /tmp/SKYNODE/apps/chat.v1.0 ./cmd/apps/chat
$ GO111MODULE=on GOOS=linux go build -o /tmp/SKYNODE/apps/skychat.v1.0 ./cmd/apps/skychat
$ GO111MODULE=on GOOS=linux go build -o /tmp/SKYNODE/apps/helloworld.v1.0 ./cmd/apps/helloworld
$ GO111MODULE=on GOOS=linux go build -o /tmp/SKYNODE/apps/therealproxy.v1.0 ./cmd/apps/therealproxy
$ GO111MODULE=on GOOS=linux go build -o /tmp/SKYNODE/apps/therealssh.v1.0 ./cmd/apps/therealssh
$ GO111MODULE=on GOOS=linux go build -o /tmp/SKYNODE/apps/therealssh-client.v1.0 ./cmd/apps/therealssh-client
$ GO111MODULE=on GOOS=linux go build -o /tmp/SKYNODE/apps/socksproxy.v1.0 ./cmd/apps/therealproxy
$ GO111MODULE=on GOOS=linux go build -o /tmp/SKYNODE/apps/SSH.v1.0 ./cmd/apps/SSH
$ GO111MODULE=on GOOS=linux go build -o /tmp/SKYNODE/apps/SSH-client.v1.0 ./cmd/apps/SSH-client
# 4. Create skywire-config.json for node
$ skywire-cli node gen-config -o /tmp/SKYNODE/skywire-config.json
# 2019/03/15 16:43:49 Done!
$ tree /tmp/SKYNODE
# /tmp/SKYNODE
# ├── apps
# │   ├── chat.v1.0
# │   ├── skychat.v1.0
# │   ├── helloworld.v1.0
# │   ├── therealproxy.v1.0
# │   ├── therealssh-client.v1.0
# │   └── therealssh.v1.0
# │   ├── socksproxy.v1.0
# │   ├── SSH-client.v1.0
# │   └── SSH.v1.0
# ├── skywire-config.json
# └── skywire-node
# So far so good. We prepared docker volume. Now we can:
$ docker run -it -v /tmp/SKYNODE:/sky --network=SKYNET --name=SKYNODE skywire-runner bash -c "cd /sky && ./skywire-node"
# [2019-03-15T13:55:08Z] INFO [messenger]: Opened new link with the server # 02a49bc0aa1b5b78f638e9189be4ed095bac5d6839c828465a8350f80ac07629c0
# [2019-03-15T13:55:08Z] INFO [messenger]: Updating discovery entry
# [2019-03-15T13:55:10Z] INFO [skywire]: Connected to messaging servers
# [2019-03-15T13:55:10Z] INFO [skywire]: Starting chat.v1.0
# [2019-03-15T13:55:10Z] INFO [skywire]: Starting skychat.v1.0
# [2019-03-15T13:55:10Z] INFO [skywire]: Starting RPC interface on 127.0.0.1:3435
# [2019-03-15T13:55:10Z] INFO [skywire]: Starting therealproxy.v1.0
# [2019-03-15T13:55:10Z] INFO [skywire]: Starting therealssh.v1.0
# [2019-03-15T13:55:10Z] INFO [skywire]: Starting socksproxy.v1.0
# [2019-03-15T13:55:10Z] INFO [skywire]: Starting SSH.v1.0
# [2019-03-15T13:55:10Z] INFO [skywire]: Starting packet router
# [2019-03-15T13:55:10Z] INFO [router]: Starting router
# [2019-03-15T13:55:10Z] INFO [trmanager]: Starting transport manager
# [2019-03-15T13:55:10Z] INFO [router]: Got new App request with type Init: {"app-name":"chat",# "app-version":"1.0","protocol-version":"0.0.1"}
# [2019-03-15T13:55:10Z] INFO [router]: Handshaked new connection with the app chat.v1.0
# [2019-03-15T13:55:10Z] INFO [chat.v1.0]: 2019/03/15 13:55:10 Serving HTTP on :8000
# [2019-03-15T13:55:10Z] INFO [router]: Got new App request with type Init: {"app-name":"therealssh",# "app-version":"1.0","protocol-version":"0.0.1"}
# [2019-03-15T13:55:10Z] INFO [router]: Handshaked new connection with the app therealssh.v1.0
# [2019-03-15T13:55:10Z] INFO [router]: Got new App request with type Init: {"app-name":"therealproxy",# "app-version":"1.0","protocol-version":"0.0.1"}
# [2019-03-15T13:55:10Z] INFO [router]: Handshaked new connection with the app therealproxy.v1.0
# [2019-03-15T13:55:10Z] INFO [router]: Got new App request with type Init: {"app-name":"skychat",# "app-version":"1.0","protocol-version":"0.0.1"}
# [2019-03-15T13:55:10Z] INFO [router]: Handshaked new connection with the app skychat.v1.0
# [2019-03-15T13:55:10Z] INFO [skychat.v1.0]: 2019/03/15 13:55:10 Serving HTTP on :8000
# [2019-03-15T13:55:10Z] INFO [router]: Got new App request with type Init: {"app-name":"SSH",# "app-version":"1.0","protocol-version":"0.0.1"}
# [2019-03-15T13:55:10Z] INFO [router]: Handshaked new connection with the app SSH.v1.0
# [2019-03-15T13:55:10Z] INFO [router]: Got new App request with type Init: {"app-name":"socksproxy",# "app-version":"1.0","protocol-version":"0.0.1"}
# [2019-03-15T13:55:10Z] INFO [router]: Handshaked new connection with the app socksproxy.v1.0
```

Note that in this example docker is running in non-detached mode - it could be useful in some scenarios.
Expand All @@ -352,7 +352,7 @@ Idea of test from Erlang classics: https://youtu.be/uKfKtXYLG78?t=120
# Setup: run skywire-nodes on host and in docker
$ make run
$ make docker-run
# Open in browser chat application
# Open in browser skychat application
$ firefox http://$SW_NODE_B:8000 &
# add transport
$ ./skywire-cli add-transport $SW_NODE_B_PK
Expand Down
6 changes: 3 additions & 3 deletions cmd/apps/chat/README.md → cmd/apps/skychat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Create 2 node config files:
```json
"apps": [
{
"app": "chat",
"app": "skychat",
"version": "1.0",
"auto_start": true,
"port": 1
Expand All @@ -28,7 +28,7 @@ Create 2 node config files:
```json
"apps": [
{
"app": "chat",
"app": "skychat",
"version": "1.0",
"auto_start": true,
"port": 1,
Expand All @@ -40,7 +40,7 @@ Create 2 node config files:
Compile binaries and start 2 nodes:

```bash
$ go build -o apps/chat.v1.0 ./cmd/apps/chat
$ go build -o apps/skychat.v1.0 ./cmd/apps/skychat
$ ./skywire-node skywire1.json
$ ./skywire-node skywire2.json
```
Expand Down
4 changes: 2 additions & 2 deletions cmd/apps/chat/chat.go → cmd/apps/skychat/chat.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//go:generate esc -o static.go -prefix static static

/*
chat app for skywire node
skychat app for skywire node
*/
package main

Expand Down Expand Up @@ -30,7 +30,7 @@ var (
func main() {
flag.Parse()

a, err := app.Setup(&app.Config{AppName: "chat", AppVersion: "1.0", ProtocolVersion: "0.0.1"})
a, err := app.Setup(&app.Config{AppName: "skychat", AppVersion: "1.0", ProtocolVersion: "0.0.1"})
if err != nil {
log.Fatal("Setup failure: ", err)
}
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions cmd/apps/therealproxy-client/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Skywire SOCKS5 proxy client app

`therealproxy-client` app implements client for the SOCKS5 app.
`socksproxy-client` app implements client for the SOCKS5 app.

It opens persistent `skywire` connection to the configured remote node
and local TCP port, all incoming TCP traffics is forwarded to the
~skywire~ connection.

Any conventional SOCKS5 client should be able to connect to the proxy client.

Please check docs for `therealproxy` app for further instructions.
Please check docs for `socksproxy` app for further instructions.
2 changes: 1 addition & 1 deletion cmd/apps/therealproxy-client/therealproxy-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func main() {
var serverPK = flag.String("srv", "", "PubKey of the server to connect to")
flag.Parse()

config := &app.Config{AppName: "therealproxy-client", AppVersion: "1.0", ProtocolVersion: "0.0.1"}
config := &app.Config{AppName: "socksproxy-client", AppVersion: "1.0", ProtocolVersion: "0.0.1"}
socksApp, err := app.Setup(config)
if err != nil {
log.Fatal("Setup failure: ", err)
Expand Down
10 changes: 5 additions & 5 deletions cmd/apps/therealproxy/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Skywire SOCKS5 proxy app

`therealproxy` app implements SOCKS5 functionality over skywire
`socksproxy` app implements SOCKS5 functionality over skywire
net.
Any conventional SOCKS5 client should be able to connect to the
proxy client.
Expand All @@ -17,7 +17,7 @@ Create 2 node config files:
```json
"apps": [
{
"app": "therealproxy",
"app": "socksproxy",
"version": "1.0",
"auto_start": true,
"port": 3,
Expand All @@ -31,7 +31,7 @@ Create 2 node config files:
```json
"apps": [
{
"app": "therealproxy-client",
"app": "socksproxy-client",
"version": "1.0",
"auto_start": true,
"port": 33,
Expand All @@ -43,8 +43,8 @@ Create 2 node config files:
Compile binaries and start 2 nodes:

```sh
$ go build -o apps/therealproxy.v1.0 ./cmd/apps/therealproxy
$ go build -o apps/therealproxy-client.v1.0 ./cmd/apps/therealproxy-client
$ go build -o apps/socksproxy.v1.0 ./cmd/apps/therealproxy
$ go build -o apps/socksproxy-client.v1.0 ./cmd/apps/therealproxy-client
$ ./skywire-node skywire1.json
$ ./skywire-node skywire2.json
```
Expand Down
2 changes: 1 addition & 1 deletion cmd/apps/therealproxy/therealproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func main() {
var passcode = flag.String("passcode", "", "Authorise user against this passcode")
flag.Parse()

config := &app.Config{AppName: "therealproxy", AppVersion: "1.0", ProtocolVersion: "0.0.1"}
config := &app.Config{AppName: "socksproxy", AppVersion: "1.0", ProtocolVersion: "0.0.1"}
socksApp, err := app.Setup(config)
if err != nil {
log.Fatal("Setup failure: ", err)
Expand Down
6 changes: 3 additions & 3 deletions cmd/apps/therealssh-client/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Skywire SSH client app

`therealssh-client` app implements client for the SSH app.
`SSH-client` app implements client for the SSH app.

It starts RCP interface for `therealssh-cli` and handles incoming requests to
It starts RCP interface for `SSH-cli` and handles incoming requests to
the remote node via `skywire` connection.

Please check docs for `therealssh` app for further instructions.
Please check docs for `SSH` app for further instructions.
2 changes: 1 addition & 1 deletion cmd/apps/therealssh-client/therealssh-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func main() {
var debug = flag.Bool("debug", false, "enable debug messages")
flag.Parse()

config := &app.Config{AppName: "therealssh-client", AppVersion: "1.0", ProtocolVersion: "0.0.1"}
config := &app.Config{AppName: "SSH-client", AppVersion: "1.0", ProtocolVersion: "0.0.1"}
sshApp, err := app.Setup(config)
if err != nil {
log.Fatal("Setup failure: ", err)
Expand Down
Loading

0 comments on commit 0b6ebd5

Please sign in to comment.