Skip to content

Commit

Permalink
Merge branch 'mainnet' into feature/apps-retry-on-network-error
Browse files Browse the repository at this point in the history
  • Loading branch information
ivcosla committed Jun 26, 2019
2 parents 32e1be6 + c3e882c commit 8d5765e
Show file tree
Hide file tree
Showing 45 changed files with 1,326 additions and 180 deletions.
60 changes: 33 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ DOCKER_IMAGE?=skywire-runner # docker image to use for running skywire-node.`gol
DOCKER_NETWORK?=SKYNET
DOCKER_NODE?=SKY01
DOCKER_OPTS?=GO111MODULE=on GOOS=linux # go options for compiling for docker container
TEST_OPTS?=-race -tags no_ci -cover -timeout=5m
BUILD_OPTS?=-race

check: lint test ## Run linters and tests

Expand Down Expand Up @@ -59,20 +61,20 @@ vendorcheck: ## Run vendorcheck

test: ## Run tests
-go clean -testcache &>/dev/null
${OPTS} go test -race -tags no_ci -cover -timeout=5m ./internal/...
${OPTS} go test ${TEST_OPTS} ./internal/...
#${OPTS} go test -race -tags no_ci -cover -timeout=5m ./pkg/...
${OPTS} go test -race -tags no_ci -cover -timeout=5m ./pkg/app/...
${OPTS} go test -race -tags no_ci -cover -timeout=5m ./pkg/cipher/...
${OPTS} go test -race -tags no_ci -cover -timeout=5m ./pkg/dmsg/...
${OPTS} go test -race -tags no_ci -cover -timeout=5m ./pkg/manager/...
${OPTS} go test -race -tags no_ci -cover -timeout=5m ./pkg/messaging-discovery/...
${OPTS} go test -race -tags no_ci -cover -timeout=5m ./pkg/node/...
${OPTS} go test -race -tags no_ci -cover -timeout=5m ./pkg/route-finder/...
${OPTS} go test -race -tags no_ci -cover -timeout=5m ./pkg/router/...
${OPTS} go test -race -tags no_ci -cover -timeout=5m ./pkg/routing/...
${OPTS} go test -race -tags no_ci -cover -timeout=5m ./pkg/setup/...
${OPTS} go test -race -tags no_ci -cover -timeout=5m ./pkg/transport/...
${OPTS} go test -race -tags no_ci -cover -timeout=5m ./pkg/transport-discovery/...
${OPTS} go test ${TEST_OPTS} ./pkg/app/...
${OPTS} go test ${TEST_OPTS} ./pkg/cipher/...
${OPTS} go test ${TEST_OPTS} ./pkg/dmsg/...
${OPTS} go test ${TEST_OPTS} ./pkg/manager/...
${OPTS} go test ${TEST_OPTS} ./pkg/messaging-discovery/...
${OPTS} go test ${TEST_OPTS} ./pkg/node/...
${OPTS} go test ${TEST_OPTS} ./pkg/route-finder/...
${OPTS} go test ${TEST_OPTS} ./pkg/router/...
${OPTS} go test ${TEST_OPTS} ./pkg/routing/...
${OPTS} go test ${TEST_OPTS} ./pkg/setup/...
${OPTS} go test ${TEST_OPTS} ./pkg/transport/...
${OPTS} go test ${TEST_OPTS} ./pkg/transport-discovery/...
${OPTS} go test -tags no_ci -cover -timeout=5m ./pkg/messaging/...


Expand All @@ -94,21 +96,21 @@ dep: ## Sorts dependencies

# Apps
host-apps: ## Build app
${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/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
${OPTS} go build ${BUILD_OPTS} -o ./apps/skychat.v1.0 ./cmd/apps/skychat
${OPTS} go build ${BUILD_OPTS} -o ./apps/helloworld.v1.0 ./cmd/apps/helloworld
${OPTS} go build ${BUILD_OPTS} -o ./apps/socksproxy.v1.0 ./cmd/apps/therealproxy
${OPTS} go build ${BUILD_OPTS} -o ./apps/socksproxy-client.v1.0 ./cmd/apps/therealproxy-client
${OPTS} go build ${BUILD_OPTS} -o ./apps/SSH.v1.0 ./cmd/apps/therealssh
${OPTS} go build ${BUILD_OPTS} -o ./apps/SSH-client.v1.0 ./cmd/apps/therealssh-client

# Bin
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 ./messaging-server ./cmd/messaging-server
${OPTS} go build -race -o ./manager-node ./cmd/manager-node
${OPTS} go build -race -o ./SSH-cli ./cmd/therealssh-cli
${OPTS} go build ${BUILD_OPTS} -o ./skywire-node ./cmd/skywire-node
${OPTS} go build ${BUILD_OPTS} -o ./skywire-cli ./cmd/skywire-cli
${OPTS} go build ${BUILD_OPTS} -o ./setup-node ./cmd/setup-node
${OPTS} go build ${BUILD_OPTS} -o ./messaging-server ./cmd/messaging-server
${OPTS} go build ${BUILD_OPTS} -o ./manager-node ./cmd/manager-node
${OPTS} go build ${BUILD_OPTS} -o ./SSH-cli ./cmd/therealssh-cli


release: ## Build skywire-node`, skywire-cli, manager-node, SSH-cli and apps without -race flag
Expand All @@ -124,8 +126,6 @@ release: ## Build skywire-node`, skywire-cli, manager-node, SSH-cli and apps wit
${OPTS} go build -o ./apps/SSH.v1.0 ./cmd/apps/therealssh
${OPTS} go build -o ./apps/SSH-client.v1.0 ./cmd/apps/therealssh-client



# Dockerized skywire-node
docker-image: ## Build docker image `skywire-runner`
docker image build --tag=skywire-runner --rm - < skywire-runner.Dockerfile
Expand Down Expand Up @@ -173,6 +173,12 @@ docker-rerun: docker-stop
${DOCKER_OPTS} go build -race -o ./node/skywire-node ./cmd/skywire-node
docker container start -i ${DOCKER_NODE}

run-syslog: ## Run syslog-ng in docker. Logs are mounted under /tmp/syslog
-rm -rf /tmp/syslog
-mkdir -p /tmp/syslog
-docker container rm syslog-ng -f
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-node's of interactive testing environment
./integration/startup.sh
Expand Down
89 changes: 89 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,42 @@

# Skywire Mainnet - Public Test Phase

- [Skywire Mainnet - Public Test Phase](#Skywire-Mainnet---Public-Test-Phase)
- [Notes on this release](#Notes-on-this-release)
- [Architecture](#Architecture)
- [Build and run](#Build-and-run)
- [Requirements](#Requirements)
- [Build](#Build)
- [Run `skywire-node`](#Run-skywire-node)
- [Run `skywire-node` in docker container](#Run-skywire-node-in-docker-container)
- [Run `skywire-cli`](#Run-skywire-cli)
- [Apps](#Apps)
- [Transports](#Transports)
- [App programming API](#App-programming-API)
- [Testing](#Testing)
- [Testing with default settings](#Testing-with-default-settings)
- [Customization with environment variables](#Customization-with-environment-variables)
- [$TEST_OPTS](#TESTOPTS)
- [$TEST_LOGGING_LEVEL](#TESTLOGGINGLEVEL)
- [$SYSLOG_OPTS](#SYSLOGOPTS)
- [Updater](#Updater)
- [Running skywire in docker containers](#Running-skywire-in-docker-containers)
- [Run dockerized `skywire-node`](#Run-dockerized-skywire-node)
- [Structure of `./node`](#Structure-of-node)
- [Refresh and restart `SKY01`](#Refresh-and-restart-SKY01)
- [Customization of dockers](#Customization-of-dockers)
- [1. DOCKER_IMAGE](#1-DOCKERIMAGE)
- [2.DOCKER_NETWORK](#2DOCKERNETWORK)
- [3. DOCKER_NODE](#3-DOCKERNODE)
- [4. DOCKER_OPTS](#4-DOCKEROPTS)
- [Dockerized `skywire-node` recipes](#Dockerized-skywire-node-recipes)
- [1. Get Public Key of docker-node](#1-Get-Public-Key-of-docker-node)
- [2. Get an IP of node](#2-Get-an-IP-of-node)
- [3. Open in browser containerized `skychat` application](#3-Open-in-browser-containerized-skychat-application)
- [4. Create new dockerized `skywire-nodes`](#4-Create-new-dockerized-skywire-nodes)
- [5. Env-vars for develoment-/testing- purposes](#5-Env-vars-for-develoment-testing--purposes)
- [6. "Hello-Mike-Hello-Joe" test](#6-%22Hello-Mike-Hello-Joe%22-test)

## Notes on this release

This is a public testing version of the Skywire mainnet and is intended for developers use to find bugs only. It is not yet intended to replace the testnet and miners should not install this software on their miners or they may lose their reward eligibility.
Expand Down Expand Up @@ -156,6 +192,59 @@ func (app *App) Dial(raddr *Addr) (net.Conn, error) {}
func (app *App) Close() error {}
```

## Testing

### Testing with default settings

```bash
$ make test
```

### Customization with environment variables

#### $TEST_OPTS

Options for `go test` could be customized with $TEST_OPTS variable

E.g.
```bash
$ export TEST_OPTS="-race -tags no_ci -timeout 90s -v"
$ make test
```

#### $TEST_LOGGING_LEVEL

By default all log messages during tests are disabled.
In case of need to turn on log messages it could be achieved by setting $TEST_LOGGING_LEVEL variable

Possible values:
- "debug"
- "info", "notice"
- "warn", "warning"
- "error"
- "fatal", "critical"
- "panic"

E.g.
```bash
$ export TEST_LOGGING_LEVEL="info"
$ go clean -testcache || go test ./pkg/transport -v -run ExampleManager_CreateTransport
$ unset TEST_LOGGING_LEVEL
$ go clean -testcache || go test ./pkg/transport -v
```

#### $SYSLOG_OPTS

In case of need to collect logs in syslog during integration tests $SYSLOG_OPTS variable can be used.

E.g.
```bash
$ make run_syslog ## run syslog-ng in docker container with logs mounted to /tmp/syslog
$ export SYSLOG_OPTS='--syslog localhost:514'
$ make integration-run-messaging ## or other integration-run-* goal
$ sudo cat /tmp/syslog/messages ## collected logs from NodeA, NodeB, NodeC instances
```

## Updater

This software comes with an updater, which is located in this repo: https://github.com/skycoin/skywire-updater. Follow the instructions in the README.md for further information. It can be used with a CLI for now and will be usable with the manager interface.
Expand Down
Loading

0 comments on commit 8d5765e

Please sign in to comment.