Skip to content

Commit

Permalink
Fix forgotten renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
nkryuchkov committed Jul 9, 2019
1 parent 1782391 commit 6226ffb
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Added

- First release of the mainnet Skywire node and apps for testing.
- First release of the mainnet Skywire networking node and apps for testing.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ docker-bin: ## Build `skywire-networking-node`, `skywire-cli`, `hypervisor`, `th
docker-volume: dep docker-apps docker-bin bin ## Prepare docker volume for dockerized skywire-networking-node
-${DOCKER_OPTS} go build -o ./docker/skywire-services/setup-node ./cmd/setup-node
-./skywire-cli node gen-config -o ./skywire-networking-node/skywire.json -r
perl -pi -e 's/localhost//g' ./node/skywire.json # To make skywire-networking-node accessible from outside with skywire-cli
perl -pi -e 's/localhost//g' ./node/skywire.json # To make node accessible from outside with skywire-cli

docker-run: docker-clean docker-image docker-network docker-volume ## Run dockerized skywire-networking-node ${DOCKER_NODE} in image ${DOCKER_IMAGE} with network ${DOCKER_NETWORK}
docker run -it -v $(shell pwd)/node:/sky --network=${DOCKER_NETWORK} \
Expand All @@ -155,7 +155,7 @@ docker-stop: ## Stop running dockerized skywire-networking-node ${DOCKER_NODE}

docker-rerun: docker-stop
-./skywire-cli gen-config -o ./node/skywire.json -r
perl -pi -e 's/localhost//g' ./node/skywire.json # To make skywire-networking-node accessible from outside with skywire-cli
perl -pi -e 's/localhost//g' ./node/skywire.json # To make node accessible from outside with skywire-cli
${DOCKER_OPTS} go build -race -o ./node/skywire-networking-node ./cmd/skywire-networking-node
docker container start -i ${DOCKER_NODE}

Expand All @@ -166,7 +166,7 @@ run-syslog: ## Run syslog-ng in docker. Logs are mounted under /tmp/syslog
docker run -d -p 514:514/udp -v /tmp/syslog:/var/log --name syslog-ng balabit/syslog-ng:latest


integration-startup: ## Starts up the required transports between 'skywire-networking-node's of interactive testing environment
integration-startup: ## Starts up the required transports between `skywire-networking-node`s of interactive testing environment
./integration/startup.sh

integration-teardown: ## Tears down all saved configs and states of integration executables
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ The software is still under heavy development and the current version is intende

Skywire is a decentralized and private network. Skywire separates the data and control plane of the network and assigns the tasks of network coordination and administration to dedicated services, while the nodes follow the rules that were created by the control plane and execute them.

The core of Skywire is the Skywire node which hosts applications and is the gateway to use the network. It establishes connections, called transports, to other nodes, requests the setup of routes and forwards packets for other nodes on a route. The Skywire node exposes an API to applications for using the networking protocol of Skywire.
The core of Skywire is the Skywire networking node which hosts applications and is the gateway to use the network. It establishes connections, called transports, to other nodes, requests the setup of routes and forwards packets for other nodes on a route. The Skywire networking node exposes an API to applications for using the networking protocol of Skywire.

In order to detach control plane tasks from the network nodes, there are 3 other services that maintain a picture of the network topology, calculate routes (currently based on the number of hops, but will be extended to other metrics) and set the routing rules on the nodes.

The transport discovery maintains a picture of the network topology, by allowing Skywire nodes to advertise transports that they established with other nodes. It also allows to upload a status to indicate whether a given transport is currently working or not.
The transport discovery maintains a picture of the network topology, by allowing Skywire networking nodes to advertise transports that they established with other nodes. It also allows to upload a status to indicate whether a given transport is currently working or not.

On the basis of this information the route finder calculates the most efficient route in the network. Nodes request a route to a given public key and the route finder will calculate the best route and return the transports that the packet will be sent over to reach the intended node.

This information is sent from a node to the Setup Node, which sets the routing rules in all nodes along a route. Skywire nodes determine, which nodes they accept routing rules from, so only a whitelisted node can send routing rules to a node in the network. The only information the Skywire node gets for routing is a Routing ID and an associated rule that defines which transport to send a packet to (or to consume the packet). Therefore nodes along a route only know the last and next hop along the route, but not where the packet originates from and where it is sent to. Skywire supports source routing, so nodes can specify a path that a packet is supposed to take in the network.
This information is sent from a node to the Setup Node, which sets the routing rules in all nodes along a route. Skywire networking nodes determine, which nodes they accept routing rules from, so only a whitelisted node can send routing rules to a node in the network. The only information the Skywire networking node gets for routing is a Routing ID and an associated rule that defines which transport to send a packet to (or to consume the packet). Therefore nodes along a route only know the last and next hop along the route, but not where the packet originates from and where it is sent to. Skywire supports source routing, so nodes can specify a path that a packet is supposed to take in the network.

There are currently two types of transports that nodes can use. The messaging transport is a transport between two nodes that uses an intermediary messaging server to relay packets between them. The connection to a specific node and the connection to a messaging server is facilitated by a discovery service, that allows nodes to advertise the messaging servers over which they can be contacted. This transport is used by the setup node to send routing rules and can be used for other applications as well. It allows nodes behind NATs to communicate. The second transport type is TCP, which sets up a connection between two servers with a public IP. More transport types will be supported in the future and custom transport implementations can be written for specific use cases.

Expand Down Expand Up @@ -154,7 +154,7 @@ After `skywire-networking-node` is up and running with default environment, defa

### Transports

In order for a local Skywire App to communicate with an App running on a remote Skywire node, a transport to that remote Skywire node needs to be established.
In order for a local Skywire App to communicate with an App running on a remote Skywire networking node, a transport to that remote Skywire networking node needs to be established.

Transports can be established via the `skywire-cli`.

Expand Down Expand Up @@ -375,7 +375,7 @@ let's look how to create new node.
```bash
# 1. We need a folder for docker volume
$ mkdir /tmp/SKYNODE
# 2. compile `skywire-node`
# 2. compile `skywire-networking-node`
$ GO111MODULE=on GOOS=linux go build -o /tmp/SKYNODE/skywire-networking-node ./cmd/skywire-networking-node
# 3. compile apps
$ GO111MODULE=on GOOS=linux go build -o /tmp/SKYNODE/apps/skychat.v1.0 ./cmd/apps/skychat
Expand Down
2 changes: 1 addition & 1 deletion cmd/hypervisor/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ var rootCmd = &cobra.Command{

log.Infof("serving HTTP on '%s'", httpAddr)
if err := http.ListenAndServe(httpAddr, m); err != nil {
log.Fatalln("Node exited with error:", err)
log.Fatalln("Hypervisor exited with error:", err)
}

log.Println("Good bye!")
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions docker/images/node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ COPY . skywire
WORKDIR skywire

RUN go build -mod=vendor -tags netgo -ldflags="-w -s" \
-o skywire-node cmd/skywire-node/skywire-node.go &&\
-o skywire-networking-node cmd/skywire-networking-node/skywire-networking-node.go &&\
go build -mod=vendor -ldflags="-w -s" -o ./apps/skychat.v1.0 ./cmd/apps/skychat &&\
go build -mod=vendor -ldflags="-w -s" -o ./apps/helloworld.v1.0 ./cmd/apps/helloworld &&\
go build -mod=vendor -ldflags="-w -s" -o ./apps/socksproxy.v1.0 ./cmd/apps/therealproxy &&\
Expand All @@ -26,13 +26,13 @@ RUN go build -mod=vendor -tags netgo -ldflags="-w -s" \
## Resulting image
FROM ${base} as node-runner

COPY --from=builder /go/skywire/skywire-node skywire-node
COPY --from=builder /go/skywire/skywire-networking-node skywire-networking-node
COPY --from=builder /go/skywire/apps bin/apps
COPY --from=builder /go/skywire/docker/images/node/update.sh update.sh

RUN ./update.sh

ENTRYPOINT [ "./skywire-node" ]
ENTRYPOINT [ "./skywire-networking-node" ]

# default target
FROM node-runner
8 changes: 4 additions & 4 deletions integration/InteractiveEnvironments.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ The following steps will be performed:
3. TRD: transport-discovery
4. RF: route-finder
5. SN: setup-node
6. NodeA: first node running with generic/nodeA.json
7. NodeB: first node running with intermediary-nodeB.json
8. NodeC: first node running with generic/nodeC.json
6. NodeA: first skywire-networking-node with generic/nodeA.json
7. NodeB: first skywire-networking-node with intermediary-nodeB.json
8. NodeC: first skywire-networking-node with generic/nodeC.json
9. shell: new shell for interactive exploration
3. ENV-vars in shell-window:
1. $MSG_PK, $SN_PK - public keys of messaging-server and setup-node
Expand Down Expand Up @@ -227,7 +227,7 @@ Recipe for clean start:
2. Start `./integration/run-proxy-env.sh`
3. Run `make integration-startup`
4. Stop NodeA, NodeB, NodeC
5. Restart all `skywire-networking-node`s
5. Restart all nodes
6. Wait for message in NodeC logs about successful start of
socksproxy-client
7. Check `lsof -i :9999` that it's really started
Expand Down
2 changes: 1 addition & 1 deletion pkg/hypervisor/hypervisor.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package hypervisor implements node manager
// Package hypervisor implements management node
package hypervisor

import (
Expand Down
4 changes: 2 additions & 2 deletions pkg/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ func (r *Router) ServeApp(conn net.Conn, port uint16, appConf *app.Config) error
CloseLoop: r.closeLoop,
Forward: r.forwardAppPacket,
}
am := &visor{r.Logger, appProto, appConf, callbacks}
err := am.Serve()
visor := &visor{r.Logger, appProto, appConf, callbacks}
err := visor.Serve()

for _, port := range r.pm.AppPorts(appProto) {
for _, addr := range r.pm.Close(port) {
Expand Down
16 changes: 8 additions & 8 deletions pkg/router/visor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ import (

func TestVisorInit(t *testing.T) {
in, out := net.Pipe()
am := &visor{
visor := &visor{
logging.MustGetLogger("routesetup"),
app.NewProtocol(out),
&app.Config{AppName: "foo", AppVersion: "0.0.1"},
nil,
}

srvCh := make(chan error)
go func() { srvCh <- am.Serve() }()
go func() { srvCh <- visor.Serve() }()

proto := app.NewProtocol(in)
go proto.Serve(nil) // nolint: errcheck
Expand Down Expand Up @@ -53,7 +53,7 @@ func TestVisorInit(t *testing.T) {

func TestVisorSetupLoop(t *testing.T) {
in, out := net.Pipe()
am := &visor{
visor := &visor{
logging.MustGetLogger("routesetup"),
app.NewProtocol(out),
&app.Config{AppName: "foo", AppVersion: "0.0.1"},
Expand All @@ -65,7 +65,7 @@ func TestVisorSetupLoop(t *testing.T) {
}

srvCh := make(chan error)
go func() { srvCh <- am.Serve() }()
go func() { srvCh <- visor.Serve() }()

proto := app.NewProtocol(in)
go proto.Serve(nil) // nolint: errcheck
Expand All @@ -84,7 +84,7 @@ func TestVisorSetupLoop(t *testing.T) {
func TestVisorCloseLoop(t *testing.T) {
in, out := net.Pipe()
var inAddr *app.LoopAddr
am := &visor{
visor := &visor{
logging.MustGetLogger("routesetup"),
app.NewProtocol(out),
&app.Config{AppName: "foo", AppVersion: "0.0.1"},
Expand All @@ -97,7 +97,7 @@ func TestVisorCloseLoop(t *testing.T) {
}

srvCh := make(chan error)
go func() { srvCh <- am.Serve() }()
go func() { srvCh <- visor.Serve() }()

proto := app.NewProtocol(in)
go proto.Serve(nil) // nolint: errcheck
Expand All @@ -115,7 +115,7 @@ func TestVisorCloseLoop(t *testing.T) {
func TestVisorForward(t *testing.T) {
in, out := net.Pipe()
var inPacket *app.Packet
am := &visor{
visor := &visor{
logging.MustGetLogger("routesetup"),
app.NewProtocol(out),
&app.Config{AppName: "foo", AppVersion: "0.0.1"},
Expand All @@ -128,7 +128,7 @@ func TestVisorForward(t *testing.T) {
}

srvCh := make(chan error)
go func() { srvCh <- am.Serve() }()
go func() { srvCh <- visor.Serve() }()

proto := app.NewProtocol(in)
go proto.Serve(nil) // nolint: errcheck
Expand Down

0 comments on commit 6226ffb

Please sign in to comment.