Skip to content

Commit

Permalink
Merge branch 'develop' into fix/setup-node-hangs
Browse files Browse the repository at this point in the history
Former-commit-id: d3739b1
  • Loading branch information
evanlinjin authored Jun 2, 2020
2 parents c5ba789 + f65ad40 commit b7e0c75
Show file tree
Hide file tree
Showing 40 changed files with 4,499 additions and 73 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ pkg/visor/foo/
/*.json
/*.sh
/*.log
dmsgpty

# Ignore backup go.mod after running '/ci_scripts/go_mod_replace.sh'.
go.mod-e
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ script:
- make install-deps-ui
- make lint-ui
- make build-ui

18 changes: 10 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.DEFAULT_GOAL := help
.PHONY : check lint install-linters dep test
.PHONY : build clean install format bin
.PHONY : host-apps bin
.PHONY : check lint install-linters dep test
.PHONY : build clean install format bin
.PHONY : host-apps bin
.PHONY : run stop config
.PHONY : docker-image docker-clean docker-network
.PHONY : docker-apps docker-bin docker-volume
.PHONY : docker-run docker-stop
.PHONY : docker-image docker-clean docker-network
.PHONY : docker-apps docker-bin docker-volume
.PHONY : docker-run docker-stop

VERSION := $(shell git describe)

Expand All @@ -22,7 +22,7 @@ DOCKER_NETWORK?=SKYNET
DOCKER_NODE?=SKY01
DOCKER_OPTS?=GO111MODULE=on GOOS=linux # go options for compiling for docker container

TEST_OPTS_BASE:=-cover -timeout=5m
TEST_OPTS_BASE:=-cover -timeout=5m -mod=vendor

RACE_FLAG:=-race
GOARCH:=$(shell go env GOARCH)
Expand Down Expand Up @@ -113,15 +113,17 @@ install-linters: ## Install linters
# However, they suggest `curl ... | bash` which we should not do
# ${OPTS} go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
${OPTS} go get -u golang.org/x/tools/cmd/goimports
${OPTS} go get -u github.com/incu6us/goimports-reviser

tidy: ## Tidies and vendors dependencies.
${OPTS} go mod tidy -v
${OPTS} go mod vendor -v

format: tidy ## Formats the code. Must have goimports installed (use make install-linters).
format: tidy ## Formats the code. Must have goimports and goimports-reviser installed (use make install-linters).
${OPTS} goimports -w -local ${PROJECT_BASE} ./pkg
${OPTS} goimports -w -local ${PROJECT_BASE} ./cmd
${OPTS} goimports -w -local ${PROJECT_BASE} ./internal
find . -type f -name '*.go' -not -path "./vendor/*" -exec goimports-reviser -project-name ${PROJECT_BASE} -file-path {} \;

dep: ## Sorts dependencies
${OPTS} go mod vendor -v
Expand Down
3 changes: 1 addition & 2 deletions cmd/skywire-cli/commands/mdisc/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ import (
"text/tabwriter"
"time"

"github.com/SkycoinProject/skywire-mainnet/pkg/skyenv"

"github.com/SkycoinProject/dmsg/disc"
"github.com/spf13/cobra"

"github.com/SkycoinProject/skywire-mainnet/cmd/skywire-cli/internal"
"github.com/SkycoinProject/skywire-mainnet/pkg/skyenv"
)

var mdAddr string
Expand Down
7 changes: 3 additions & 4 deletions cmd/skywire-cli/commands/rtfind/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ import (
"fmt"
"time"

"github.com/SkycoinProject/skywire-mainnet/pkg/routefinder/rfclient"
"github.com/SkycoinProject/skywire-mainnet/pkg/routing"
"github.com/SkycoinProject/skywire-mainnet/pkg/skyenv"

"github.com/SkycoinProject/dmsg/cipher"
"github.com/spf13/cobra"
"golang.org/x/net/context"

"github.com/SkycoinProject/skywire-mainnet/cmd/skywire-cli/internal"
"github.com/SkycoinProject/skywire-mainnet/pkg/routefinder/rfclient"
"github.com/SkycoinProject/skywire-mainnet/pkg/routing"
"github.com/SkycoinProject/skywire-mainnet/pkg/skyenv"
)

var frAddr string
Expand Down
5 changes: 2 additions & 3 deletions cmd/skywire-cli/commands/visor/gen-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ import (
"os"
"path/filepath"

"github.com/SkycoinProject/dmsg/cipher"
"github.com/SkycoinProject/skycoin/src/util/logging"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"

"github.com/SkycoinProject/skywire-mainnet/pkg/visor/visorconfig"

"github.com/SkycoinProject/dmsg/cipher"
"github.com/spf13/cobra"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/skywire-visor/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io"
"io/ioutil"
"net/http"
_ "net/http/pprof" //nolint:gosec // https://golang.org/doc/diagnostics.html#profiling
_ "net/http/pprof" // nolint:gosec // https://golang.org/doc/diagnostics.html#profiling
"os"

"github.com/SkycoinProject/dmsg/buildinfo"
Expand Down
4 changes: 2 additions & 2 deletions pkg/app/appevent/mock_rpc_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/app/appserver/mock_proc_manager.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions pkg/app/appserver/mock_rpc_ingress_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions pkg/app/appserver/rpc_ingress_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,16 @@ import (
"testing"
"time"

"github.com/SkycoinProject/skywire-mainnet/internal/testhelpers"

"github.com/SkycoinProject/dmsg"
"github.com/SkycoinProject/dmsg/cipher"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
"golang.org/x/net/nettest"

"github.com/SkycoinProject/skywire-mainnet/internal/testhelpers"
"github.com/SkycoinProject/skywire-mainnet/pkg/app/appcommon"
"github.com/SkycoinProject/skywire-mainnet/pkg/app/appnet"
"github.com/SkycoinProject/skywire-mainnet/pkg/routing"

"github.com/SkycoinProject/skywire-mainnet/pkg/app/appcommon"
)

func TestRPCClient_Dial(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions pkg/hypervisor/user_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ import (
"sync"
"time"

"github.com/SkycoinProject/dmsg/httputil"
"github.com/google/uuid"
"github.com/gorilla/securecookie"

"github.com/SkycoinProject/dmsg/httputil"
)

const (
Expand Down
1 change: 0 additions & 1 deletion pkg/router/mock_router.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pkg/router/router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ import (
"testing"
"time"

"github.com/sirupsen/logrus"

"github.com/SkycoinProject/dmsg"
"github.com/SkycoinProject/dmsg/cipher"
"github.com/SkycoinProject/skycoin/src/util/logging"
"github.com/google/uuid"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand Down
4 changes: 2 additions & 2 deletions pkg/setup/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package setup
import (
"time"

"github.com/SkycoinProject/skywire-mainnet/pkg/snet"

"github.com/SkycoinProject/dmsg/cipher"

"github.com/SkycoinProject/skywire-mainnet/pkg/snet"
)

//go:generate readmegen -n Config -o ./README.md ./config.go
Expand Down
10 changes: 5 additions & 5 deletions pkg/snet/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ import (
"sync"
"time"

"github.com/SkycoinProject/dmsg"
"github.com/SkycoinProject/dmsg/cipher"
"github.com/SkycoinProject/dmsg/disc"
"github.com/SkycoinProject/skycoin/src/util/logging"

"github.com/SkycoinProject/skywire-mainnet/pkg/app/appevent"
"github.com/SkycoinProject/skywire-mainnet/pkg/snet/arclient"
"github.com/SkycoinProject/skywire-mainnet/pkg/snet/stcp"
"github.com/SkycoinProject/skywire-mainnet/pkg/snet/stcph"
"github.com/SkycoinProject/skywire-mainnet/pkg/snet/stcpr"

"github.com/SkycoinProject/dmsg"
"github.com/SkycoinProject/dmsg/cipher"
"github.com/SkycoinProject/dmsg/disc"
"github.com/SkycoinProject/skycoin/src/util/logging"
)

var log = logging.MustGetLogger("snet")
Expand Down
3 changes: 1 addition & 2 deletions pkg/snet/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ package snet
import (
"testing"

"github.com/stretchr/testify/require"

"github.com/SkycoinProject/dmsg"
"github.com/SkycoinProject/dmsg/cipher"
"github.com/stretchr/testify/require"
)

func TestDisassembleAddr(t *testing.T) {
Expand Down
5 changes: 2 additions & 3 deletions pkg/snet/stcp/handshake.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ import (
"net"
"time"

cipher2 "github.com/SkycoinProject/skycoin/src/cipher"
"github.com/SkycoinProject/skycoin/src/util/logging"

"github.com/SkycoinProject/dmsg"
"github.com/SkycoinProject/dmsg/cipher"
cipher2 "github.com/SkycoinProject/skycoin/src/cipher"
"github.com/SkycoinProject/skycoin/src/util/logging"
)

var log = logging.MustGetLogger("stcp")
Expand Down
5 changes: 2 additions & 3 deletions pkg/snet/stcph/handshake.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ import (
"net"
"time"

cipher2 "github.com/SkycoinProject/skycoin/src/cipher"
"github.com/SkycoinProject/skycoin/src/util/logging"

"github.com/SkycoinProject/dmsg"
"github.com/SkycoinProject/dmsg/cipher"
cipher2 "github.com/SkycoinProject/skycoin/src/cipher"
"github.com/SkycoinProject/skycoin/src/util/logging"
)

var log = logging.MustGetLogger("stcph")
Expand Down
5 changes: 2 additions & 3 deletions pkg/snet/stcpr/handshake.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ import (
"net"
"time"

cipher2 "github.com/SkycoinProject/skycoin/src/cipher"
"github.com/SkycoinProject/skycoin/src/util/logging"

"github.com/SkycoinProject/dmsg"
"github.com/SkycoinProject/dmsg/cipher"
cipher2 "github.com/SkycoinProject/skycoin/src/cipher"
"github.com/SkycoinProject/skycoin/src/util/logging"
)

var log = logging.MustGetLogger("stcpr")
Expand Down
3 changes: 1 addition & 2 deletions pkg/transport/discovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import (
"context"
"testing"

"github.com/stretchr/testify/require"

"github.com/SkycoinProject/dmsg/cipher"
"github.com/stretchr/testify/require"

"github.com/SkycoinProject/skywire-mainnet/pkg/transport"
)
Expand Down
3 changes: 1 addition & 2 deletions pkg/transport/entry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import (
"fmt"
"testing"

"github.com/stretchr/testify/assert"

"github.com/SkycoinProject/dmsg/cipher"
"github.com/stretchr/testify/assert"

"github.com/SkycoinProject/skywire-mainnet/pkg/transport"
)
Expand Down
8 changes: 4 additions & 4 deletions pkg/transport/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import (
"sync"
"time"

"github.com/SkycoinProject/dmsg/cipher"
"github.com/SkycoinProject/skycoin/src/util/logging"
"github.com/google/uuid"

"github.com/SkycoinProject/skywire-mainnet/pkg/routing"
"github.com/SkycoinProject/skywire-mainnet/pkg/skyenv"
"github.com/SkycoinProject/skywire-mainnet/pkg/snet"
"github.com/SkycoinProject/skywire-mainnet/pkg/snet/snettest"

"github.com/SkycoinProject/dmsg/cipher"
"github.com/SkycoinProject/skycoin/src/util/logging"
"github.com/google/uuid"
)

// ManagerConfig configures a Manager.
Expand Down
9 changes: 4 additions & 5 deletions pkg/transport/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@ import (
"testing"
"time"

"github.com/SkycoinProject/dmsg"
"github.com/SkycoinProject/dmsg/cipher"
"github.com/SkycoinProject/skycoin/src/util/logging"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/SkycoinProject/skywire-mainnet/pkg/routing"
"github.com/SkycoinProject/skywire-mainnet/pkg/snet/snettest"
"github.com/SkycoinProject/skywire-mainnet/pkg/transport"

"github.com/SkycoinProject/dmsg"
"github.com/SkycoinProject/dmsg/cipher"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

var masterLogger *logging.MasterLogger
Expand Down
7 changes: 3 additions & 4 deletions pkg/visor/rpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ import (
"testing"
"time"

"github.com/SkycoinProject/skywire-mainnet/pkg/visor/visorconfig"

"github.com/SkycoinProject/skywire-mainnet/pkg/transport"

"github.com/SkycoinProject/dmsg/cipher"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/SkycoinProject/skywire-mainnet/pkg/transport"
"github.com/SkycoinProject/skywire-mainnet/pkg/visor/visorconfig"
)

func baseConfig(t *testing.T) *visorconfig.V1 {
Expand Down
Loading

0 comments on commit b7e0c75

Please sign in to comment.