Skip to content

Commit

Permalink
Tested with skywire-services
Browse files Browse the repository at this point in the history
  • Loading branch information
ayuryshev committed May 30, 2019
1 parent bc24216 commit 8ef7aee
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
6 changes: 3 additions & 3 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`, `SSH-cli`
${OPTS} go install ./cmd/skywire-node ./cmd/skywire-cli ./cmd/setup-node ./cmd/manager-node ./cmd/therealssh-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 @@ -108,7 +108,7 @@ bin: ## Build `skywire-node`, `skywire-cli`, `manager-node`, `SSH-cli`
${OPTS} go build -race -o ./manager-node ./cmd/manager-node
${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
Expand Down
24 changes: 12 additions & 12 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 @@ -114,7 +114,7 @@ After `skywire-node` is up and running with default environment, default apps ar
- [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 @@ -186,12 +186,12 @@ This will:
│   ├── helloworld.v1.0 #
│   ├── socksproxy-client.v1.0 #
│   ├── socksproxy.v1.0 #
│   ├── therealssh-client.v1.0 #
│   └── therealssh.v1.0 #
│   ├── SSH-client.v1.0 #
│   └── SSH.v1.0 #
├── local # **Created inside docker**
│   ├── skychat # according to "local_path" in skywire-config.json
│   ├── socksproxy #
│   └── therealssh #
│   └── SSH #
├── PK # contains public key of node
├── skywire # db & logs. **Created inside docker**
│   ├── routing.db #
Expand Down Expand Up @@ -292,8 +292,8 @@ $ GO111MODULE=on GOOS=linux go build -o /tmp/SKYNODE/skywire-node ./cmd/skywire-
$ 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/socksproxy.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/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!
Expand All @@ -303,8 +303,8 @@ $ tree /tmp/SKYNODE
# │   ├── skychat.v1.0
# │   ├── helloworld.v1.0
# │   ├── socksproxy.v1.0
# │   ├── therealssh-client.v1.0
# │   └── therealssh.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:
Expand All @@ -315,15 +315,15 @@ $ docker run -it -v /tmp/SKYNODE:/sky --network=SKYNET --name=SKYNODE skywire-ru
# [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 socksproxy.v1.0
# [2019-03-15T13:55:10Z] INFO [skywire]: Starting therealssh.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":"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":"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":"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
```
Expand Down
22 changes: 11 additions & 11 deletions cmd/apps/therealssh/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Skywire SSH app

`therealssh` app implements SSH functionality over skywirenet.
`SSH` app implements SSH functionality over skywirenet.

`therealssh-cli` is used to initiate communication via client RPC
exposed by `therealssh` app.
`SSH-cli` is used to initiate communication via client RPC
exposed by `SSH` app.

`therealssh` app implements common SSH operations:
`SSH` app implements common SSH operations:

- starting remote shell
- and executing commands remotely
Expand All @@ -22,7 +22,7 @@ Create 2 node config files:
```json
"apps": [
{
"app": "therealssh",
"app": "SSH",
"version": "1.0",
"auto_start": true,
"port": 2
Expand All @@ -35,7 +35,7 @@ Create 2 node config files:
```json
"apps": [
{
"app": "therealssh-client",
"app": "SSH-client",
"version": "1.0",
"auto_start": true,
"port": 22
Expand All @@ -46,9 +46,9 @@ Create 2 node config files:
Compile binaries and start 2 nodes:

```bash
$ go build -o apps/therealssh.v1.0 ./cmd/apps/therealssh
$ go build -o apps/therealssh-client.v1.0 ./cmd/apps/therealssh-client
$ go build ./cmd/therealssh-cli
$ go build -o apps/SSH.v1.0 ./cmd/apps/therealssh
$ go build -o apps/SSH-client.v1.0 ./cmd/apps/therealssh-client
$ go build ./cmd/SSH-cli
$ ./skywire-node skywire1.json
$ ./skywire-node skywire2.json
```
Expand All @@ -57,13 +57,13 @@ Add public key of the second node to the auth file:

```bash
$ mkdir `/.therealssh
$ echo "0348c941c5015a05c455ff238af2e57fb8f914c399aab604e9abb5b32b91a4c1fe" > `/.therealssh/authorized_keys
$ echo "0348c941c5015a05c455ff238af2e57fb8f914c399aab604e9abb5b32b91a4c1fe" > `/.SSH/authorized_keys
```

Connect to the first node using CLI:

```bash
$ ./therealssh-cli 024ec47420176680816e0406250e7156465e4531f5b26057c9f6297bb0303558c7
$ ./SSH-cli 024ec47420176680816e0406250e7156465e4531f5b26057c9f6297bb0303558c7
```

This should get you to the $HOME folder of the user(you in this case), which
Expand Down
2 changes: 1 addition & 1 deletion pkg/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Version = "0.0.1"

const supportedProtocolVersion = "0.0.1"

var reservedPorts = map[uint16]string{0: "router", 1: "skychat", 2: "therealssh", 3: "socksproxy"}
var reservedPorts = map[uint16]string{0: "router", 1: "skychat", 2: "SSH", 3: "socksproxy"}

// AppState defines state parameters for a registered App.
type AppState struct {
Expand Down

0 comments on commit 8ef7aee

Please sign in to comment.