diff --git a/Makefile b/Makefile index c8326b12e..3f50f3f0c 100644 --- a/Makefile +++ b/Makefile @@ -78,9 +78,9 @@ install-linters: ## Install linters ${OPTS} go get -u golang.org/x/tools/cmd/goimports format: ## Formats the code. Must have goimports installed (use make install-linters). - ${OPTS} goimports -w -local github.com/skycoin/skywire ./pkg - ${OPTS} goimports -w -local github.com/skycoin/skywire ./cmd - ${OPTS} goimports -w -local github.com/skycoin/skywire ./internal + ${OPTS} goimports -w -local github.com/SkycoinProject/skywire ./pkg + ${OPTS} goimports -w -local github.com/SkycoinProject/skywire ./cmd + ${OPTS} goimports -w -local github.com/SkycoinProject/skywire ./internal dep: ## Sorts dependencies ${OPTS} go mod vendor -v diff --git a/README.md b/README.md index 6323a37f8..4dfbd1ac2 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Skywire requires a version of [golang](https://golang.org/) with [go modules](ht ```bash # Clone. -$ git clone https://github.com/skycoin/skywire +$ git clone https://github.com/SkycoinProject/skywire $ cd skywire $ git checkout mainnet # Build @@ -247,7 +247,7 @@ $ sudo cat /tmp/syslog/messages ## collected logs from NodeA, NodeB, NodeC insta ## Updater -This software comes with an updater, which is located in this repo: . 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. +This software comes with an updater, which is located in this repo: . 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. ## Running skywire in docker containers diff --git a/ci_scripts/go_mod_replace.sh b/ci_scripts/go_mod_replace.sh index b7890cc86..19557c50f 100755 --- a/ci_scripts/go_mod_replace.sh +++ b/ci_scripts/go_mod_replace.sh @@ -9,7 +9,7 @@ action=$1 filename=$2 # Line to comment/uncomment in go.mod -line="replace github.com\/skycoin\/dmsg => ..\/dmsg" +line="replace github.com\/SkycoinProject\/dmsg => ..\/dmsg" function print_usage() { echo $"Usage: $0 (comment|uncomment) " diff --git a/ci_scripts/run-internal-tests.sh b/ci_scripts/run-internal-tests.sh index b15a3d365..57be9caf4 100644 --- a/ci_scripts/run-internal-tests.sh +++ b/ci_scripts/run-internal-tests.sh @@ -1,34 +1,34 @@ # commit a70894c8c4223424151cdff7441b1fb2e6bad309 -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/httpauth -run TestClient >> ./logs/internal/TestClient.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/httpauth -run TestClient >> ./logs/internal/TestClient.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/ioutil -run TestAckReadWriter >> ./logs/internal/TestAckReadWriter.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/ioutil -run TestAckReadWriterCRCFailure >> ./logs/internal/TestAckReadWriterCRCFailure.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/ioutil -run TestAckReadWriterFlushOnClose >> ./logs/internal/TestAckReadWriterFlushOnClose.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/ioutil -run TestAckReadWriterPartialRead >> ./logs/internal/TestAckReadWriterPartialRead.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/ioutil -run TestAckReadWriterReadError >> ./logs/internal/TestAckReadWriterReadError.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/ioutil -run TestLenReadWriter >> ./logs/internal/TestLenReadWriter.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/ioutil -run TestAckReadWriter >> ./logs/internal/TestAckReadWriter.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/ioutil -run TestAckReadWriterCRCFailure >> ./logs/internal/TestAckReadWriterCRCFailure.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/ioutil -run TestAckReadWriterFlushOnClose >> ./logs/internal/TestAckReadWriterFlushOnClose.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/ioutil -run TestAckReadWriterPartialRead >> ./logs/internal/TestAckReadWriterPartialRead.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/ioutil -run TestAckReadWriterReadError >> ./logs/internal/TestAckReadWriterReadError.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/ioutil -run TestLenReadWriter >> ./logs/internal/TestLenReadWriter.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/noise -run TestRPCClientDialer >> ./logs/internal/TestRPCClientDialer.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/noise -run TestConn >> ./logs/internal/TestConn.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/noise -run TestListener >> ./logs/internal/TestListener.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/noise -run TestKKAndSecp256k1 >> ./logs/internal/TestKKAndSecp256k1.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/noise -run TestXKAndSecp256k1 >> ./logs/internal/TestXKAndSecp256k1.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/noise -run TestReadWriterKKPattern >> ./logs/internal/TestReadWriterKKPattern.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/noise -run TestReadWriterXKPattern >> ./logs/internal/TestReadWriterXKPattern.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/noise -run TestReadWriterConcurrentTCP >> ./logs/internal/TestReadWriterConcurrentTCP.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/noise -run TestRPCClientDialer >> ./logs/internal/TestRPCClientDialer.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/noise -run TestConn >> ./logs/internal/TestConn.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/noise -run TestListener >> ./logs/internal/TestListener.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/noise -run TestKKAndSecp256k1 >> ./logs/internal/TestKKAndSecp256k1.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/noise -run TestXKAndSecp256k1 >> ./logs/internal/TestXKAndSecp256k1.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/noise -run TestReadWriterKKPattern >> ./logs/internal/TestReadWriterKKPattern.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/noise -run TestReadWriterXKPattern >> ./logs/internal/TestReadWriterXKPattern.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/noise -run TestReadWriterConcurrentTCP >> ./logs/internal/TestReadWriterConcurrentTCP.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/therealproxy -run TestProxy >> ./logs/internal/TestProxy.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/therealproxy -run TestProxy >> ./logs/internal/TestProxy.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/therealssh -run TestListAuthorizer >> ./logs/internal/TestListAuthorizer.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/therealssh -run TestFileAuthorizer >> ./logs/internal/TestFileAuthorizer.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/therealssh -run TestChannelServe >> ./logs/internal/TestChannelServe.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/therealssh -run TestChannelSendWrite >> ./logs/internal/TestChannelSendWrite.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/therealssh -run TestChannelRead >> ./logs/internal/TestChannelRead.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/therealssh -run TestChannelRequest >> ./logs/internal/TestChannelRequest.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/therealssh -run TestChannelServeSocket >> ./logs/internal/TestChannelServeSocket.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/therealssh -run TestClientOpenChannel >> ./logs/internal/TestClientOpenChannel.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/therealssh -run TestClientHandleResponse >> ./logs/internal/TestClientHandleResponse.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/therealssh -run TestClientHandleData >> ./logs/internal/TestClientHandleData.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/therealssh -run TestServerOpenChannel >> ./logs/internal/TestServerOpenChannel.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/therealssh -run TestServerHandleRequest >> ./logs/internal/TestServerHandleRequest.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/therealssh -run TestServerHandleData >> ./logs/internal/TestServerHandleData.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/therealssh -run TestListAuthorizer >> ./logs/internal/TestListAuthorizer.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/therealssh -run TestFileAuthorizer >> ./logs/internal/TestFileAuthorizer.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/therealssh -run TestChannelServe >> ./logs/internal/TestChannelServe.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/therealssh -run TestChannelSendWrite >> ./logs/internal/TestChannelSendWrite.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/therealssh -run TestChannelRead >> ./logs/internal/TestChannelRead.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/therealssh -run TestChannelRequest >> ./logs/internal/TestChannelRequest.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/therealssh -run TestChannelServeSocket >> ./logs/internal/TestChannelServeSocket.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/therealssh -run TestClientOpenChannel >> ./logs/internal/TestClientOpenChannel.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/therealssh -run TestClientHandleResponse >> ./logs/internal/TestClientHandleResponse.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/therealssh -run TestClientHandleData >> ./logs/internal/TestClientHandleData.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/therealssh -run TestServerOpenChannel >> ./logs/internal/TestServerOpenChannel.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/therealssh -run TestServerHandleRequest >> ./logs/internal/TestServerHandleRequest.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/therealssh -run TestServerHandleData >> ./logs/internal/TestServerHandleData.log diff --git a/ci_scripts/run-pkg-tests.sh b/ci_scripts/run-pkg-tests.sh index 96d4c8800..f365da7be 100644 --- a/ci_scripts/run-pkg-tests.sh +++ b/ci_scripts/run-pkg-tests.sh @@ -1,80 +1,80 @@ # commit a70894c8c4223424151cdff7441b1fb2e6bad309 -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/app -run TestAppDial >> ./logs/pkg/TestAppDial.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/app -run TestAppAccept >> ./logs/pkg/TestAppAccept.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/app -run TestAppWrite >> ./logs/pkg/TestAppWrite.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/app -run TestAppRead >> ./logs/pkg/TestAppRead.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/app -run TestAppSetup >> ./logs/pkg/TestAppSetup.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/app -run TestAppCloseConn >> ./logs/pkg/TestAppCloseConn.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/app -run TestAppClose >> ./logs/pkg/TestAppClose.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/app -run TestAppCommand >> ./logs/pkg/TestAppCommand.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/app -run TestPipeConn >> ./logs/pkg/TestPipeConn.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/app -run TestProtocol >> ./logs/pkg/TestProtocol.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/app -run TestProtocolParallel >> ./logs/pkg/TestProtocolParallel.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/app -run TestAppDial >> ./logs/pkg/TestAppDial.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/app -run TestAppAccept >> ./logs/pkg/TestAppAccept.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/app -run TestAppWrite >> ./logs/pkg/TestAppWrite.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/app -run TestAppRead >> ./logs/pkg/TestAppRead.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/app -run TestAppSetup >> ./logs/pkg/TestAppSetup.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/app -run TestAppCloseConn >> ./logs/pkg/TestAppCloseConn.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/app -run TestAppClose >> ./logs/pkg/TestAppClose.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/app -run TestAppCommand >> ./logs/pkg/TestAppCommand.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/app -run TestPipeConn >> ./logs/pkg/TestPipeConn.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/app -run TestProtocol >> ./logs/pkg/TestProtocol.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/app -run TestProtocolParallel >> ./logs/pkg/TestProtocolParallel.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/hypervisor -run TestNewNode >> ./logs/pkg/TestNewNode.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/hypervisor -run TestNewNode >> ./logs/pkg/TestNewNode.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/node -run TestMessagingDiscovery >> ./logs/pkg/TestMessagingDiscovery.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/node -run TestTransportDiscovery >> ./logs/pkg/TestTransportDiscovery.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/node -run TestTransportLogStore >> ./logs/pkg/TestTransportLogStore.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/node -run TestRoutingTable >> ./logs/pkg/TestRoutingTable.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/node -run TestAppsConfig >> ./logs/pkg/TestAppsConfig.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/node -run TestAppsDir >> ./logs/pkg/TestAppsDir.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/node -run TestLocalDir >> ./logs/pkg/TestLocalDir.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/node -run TestNewNode >> ./logs/pkg/TestNewNode.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/node -run TestNodeStartClose >> ./logs/pkg/TestNodeStartClose.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/node -run TestNodeSpawnApp >> ./logs/pkg/TestNodeSpawnApp.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/node -run TestNodeSpawnAppValidations >> ./logs/pkg/TestNodeSpawnAppValidations.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/node -run TestListApps >> ./logs/pkg/TestListApps.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/node -run TestStartStopApp >> ./logs/pkg/TestStartStopApp.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/node -run TestRPC >> ./logs/pkg/TestRPC.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/node -run TestMessagingDiscovery >> ./logs/pkg/TestMessagingDiscovery.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/node -run TestTransportDiscovery >> ./logs/pkg/TestTransportDiscovery.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/node -run TestTransportLogStore >> ./logs/pkg/TestTransportLogStore.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/node -run TestRoutingTable >> ./logs/pkg/TestRoutingTable.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/node -run TestAppsConfig >> ./logs/pkg/TestAppsConfig.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/node -run TestAppsDir >> ./logs/pkg/TestAppsDir.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/node -run TestLocalDir >> ./logs/pkg/TestLocalDir.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/node -run TestNewNode >> ./logs/pkg/TestNewNode.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/node -run TestNodeStartClose >> ./logs/pkg/TestNodeStartClose.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/node -run TestNodeSpawnApp >> ./logs/pkg/TestNodeSpawnApp.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/node -run TestNodeSpawnAppValidations >> ./logs/pkg/TestNodeSpawnAppValidations.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/node -run TestListApps >> ./logs/pkg/TestListApps.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/node -run TestStartStopApp >> ./logs/pkg/TestStartStopApp.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/node -run TestRPC >> ./logs/pkg/TestRPC.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/router -run TestAppManagerInit >> ./logs/pkg/TestAppManagerInit.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/router -run TestAppManagerSetupLoop >> ./logs/pkg/TestAppManagerSetupLoop.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/router -run TestAppManagerCloseLoop >> ./logs/pkg/TestAppManagerCloseLoop.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/router -run TestAppManagerForward >> ./logs/pkg/TestAppManagerForward.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/router -run TestManagedRoutingTableCleanup >> ./logs/pkg/TestManagedRoutingTableCleanup.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/router -run TestPortManager >> ./logs/pkg/TestPortManager.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/router -run TestRouteManagerGetRule >> ./logs/pkg/TestRouteManagerGetRule.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/router -run TestRouteManagerRemoveLoopRule >> ./logs/pkg/TestRouteManagerRemoveLoopRule.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/router -run TestRouteManagerAddRemoveRule >> ./logs/pkg/TestRouteManagerAddRemoveRule.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/router -run TestRouteManagerDeleteRules >> ./logs/pkg/TestRouteManagerDeleteRules.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/router -run TestRouteManagerConfirmLoop >> ./logs/pkg/TestRouteManagerConfirmLoop.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/router -run TestRouteManagerLoopClosed >> ./logs/pkg/TestRouteManagerLoopClosed.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/router -run TestRouterForwarding >> ./logs/pkg/TestRouterForwarding.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/router -run TestRouterAppInit >> ./logs/pkg/TestRouterAppInit.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/router -run TestRouterApp >> ./logs/pkg/TestRouterApp.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/router -run TestRouterLocalApp >> ./logs/pkg/TestRouterLocalApp.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/router -run TestRouterSetup >> ./logs/pkg/TestRouterSetup.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/router -run TestRouterSetupLoop >> ./logs/pkg/TestRouterSetupLoop.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/router -run TestRouterSetupLoopLocal >> ./logs/pkg/TestRouterSetupLoopLocal.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/router -run TestRouterCloseLoop >> ./logs/pkg/TestRouterCloseLoop.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/router -run TestRouterCloseLoopOnAppClose >> ./logs/pkg/TestRouterCloseLoopOnAppClose.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/router -run TestRouterCloseLoopOnRouterClose >> ./logs/pkg/TestRouterCloseLoopOnRouterClose.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/router -run TestRouterRouteExpiration >> ./logs/pkg/TestRouterRouteExpiration.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/router -run TestAppManagerInit >> ./logs/pkg/TestAppManagerInit.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/router -run TestAppManagerSetupLoop >> ./logs/pkg/TestAppManagerSetupLoop.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/router -run TestAppManagerCloseLoop >> ./logs/pkg/TestAppManagerCloseLoop.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/router -run TestAppManagerForward >> ./logs/pkg/TestAppManagerForward.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/router -run TestManagedRoutingTableCleanup >> ./logs/pkg/TestManagedRoutingTableCleanup.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/router -run TestPortManager >> ./logs/pkg/TestPortManager.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/router -run TestRouteManagerGetRule >> ./logs/pkg/TestRouteManagerGetRule.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/router -run TestRouteManagerRemoveLoopRule >> ./logs/pkg/TestRouteManagerRemoveLoopRule.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/router -run TestRouteManagerAddRemoveRule >> ./logs/pkg/TestRouteManagerAddRemoveRule.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/router -run TestRouteManagerDeleteRules >> ./logs/pkg/TestRouteManagerDeleteRules.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/router -run TestRouteManagerConfirmLoop >> ./logs/pkg/TestRouteManagerConfirmLoop.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/router -run TestRouteManagerLoopClosed >> ./logs/pkg/TestRouteManagerLoopClosed.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/router -run TestRouterForwarding >> ./logs/pkg/TestRouterForwarding.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/router -run TestRouterAppInit >> ./logs/pkg/TestRouterAppInit.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/router -run TestRouterApp >> ./logs/pkg/TestRouterApp.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/router -run TestRouterLocalApp >> ./logs/pkg/TestRouterLocalApp.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/router -run TestRouterSetup >> ./logs/pkg/TestRouterSetup.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/router -run TestRouterSetupLoop >> ./logs/pkg/TestRouterSetupLoop.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/router -run TestRouterSetupLoopLocal >> ./logs/pkg/TestRouterSetupLoopLocal.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/router -run TestRouterCloseLoop >> ./logs/pkg/TestRouterCloseLoop.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/router -run TestRouterCloseLoopOnAppClose >> ./logs/pkg/TestRouterCloseLoopOnAppClose.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/router -run TestRouterCloseLoopOnRouterClose >> ./logs/pkg/TestRouterCloseLoopOnRouterClose.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/router -run TestRouterRouteExpiration >> ./logs/pkg/TestRouterRouteExpiration.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/routing -run TestBoltDBRoutingTable >> ./logs/pkg/TestBoltDBRoutingTable.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/routing -run TestMakePacket >> ./logs/pkg/TestMakePacket.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/routing -run TestRoutingTable >> ./logs/pkg/TestRoutingTable.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/routing -run TestAppRule >> ./logs/pkg/TestAppRule.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/routing -run TestForwardRule >> ./logs/pkg/TestForwardRule.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/routing -run TestBoltDBRoutingTable >> ./logs/pkg/TestBoltDBRoutingTable.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/routing -run TestMakePacket >> ./logs/pkg/TestMakePacket.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/routing -run TestRoutingTable >> ./logs/pkg/TestRoutingTable.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/routing -run TestAppRule >> ./logs/pkg/TestAppRule.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/routing -run TestForwardRule >> ./logs/pkg/TestForwardRule.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/setup -run TestNewProtocol >> ./logs/pkg/TestNewProtocol.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/setup -run TestNewProtocol >> ./logs/pkg/TestNewProtocol.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/transport -run TestSettlementHandshake >> ./logs/pkg/TestSettlementHandshake.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/transport -run TestSettlementHandshakeInvalidSig >> ./logs/pkg/TestSettlementHandshakeInvalidSig.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/transport -run TestSettlementHandshakePrivate >> ./logs/pkg/TestSettlementHandshakePrivate.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/transport -run TestSettlementHandshakeExistingTransport >> ./logs/pkg/TestSettlementHandshakeExistingTransport.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/transport -run TestValidateEntry >> ./logs/pkg/TestValidateEntry.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/transport -run TestInMemoryTransportLogStore >> ./logs/pkg/TestInMemoryTransportLogStore.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/transport -run TestFileTransportLogStore >> ./logs/pkg/TestFileTransportLogStore.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/transport -run TestTransportManager >> ./logs/pkg/TestTransportManager.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/transport -run TestTransportManagerReEstablishTransports >> ./logs/pkg/TestTransportManagerReEstablishTransports.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/transport -run TestTransportManagerLogs >> ./logs/pkg/TestTransportManagerLogs.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/transport -run TestTCPFactory >> ./logs/pkg/TestTCPFactory.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/transport -run TestFilePKTable >> ./logs/pkg/TestFilePKTable.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/transport-discovery/client -run TestClientAuth >> ./logs/pkg/TestClientAuth.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/transport-discovery/client -run TestRegisterTransportResponses >> ./logs/pkg/TestRegisterTransportResponses.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/transport-discovery/client -run TestRegisterTransports >> ./logs/pkg/TestRegisterTransports.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/transport-discovery/client -run TestGetTransportByID >> ./logs/pkg/TestGetTransportByID.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/transport-discovery/client -run TestGetTransportsByEdge >> ./logs/pkg/TestGetTransportsByEdge.log -go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/pkg/transport-discovery/client -run TestUpdateStatuses >> ./logs/pkg/TestUpdateStatuses.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/transport -run TestSettlementHandshake >> ./logs/pkg/TestSettlementHandshake.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/transport -run TestSettlementHandshakeInvalidSig >> ./logs/pkg/TestSettlementHandshakeInvalidSig.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/transport -run TestSettlementHandshakePrivate >> ./logs/pkg/TestSettlementHandshakePrivate.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/transport -run TestSettlementHandshakeExistingTransport >> ./logs/pkg/TestSettlementHandshakeExistingTransport.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/transport -run TestValidateEntry >> ./logs/pkg/TestValidateEntry.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/transport -run TestInMemoryTransportLogStore >> ./logs/pkg/TestInMemoryTransportLogStore.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/transport -run TestFileTransportLogStore >> ./logs/pkg/TestFileTransportLogStore.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/transport -run TestTransportManager >> ./logs/pkg/TestTransportManager.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/transport -run TestTransportManagerReEstablishTransports >> ./logs/pkg/TestTransportManagerReEstablishTransports.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/transport -run TestTransportManagerLogs >> ./logs/pkg/TestTransportManagerLogs.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/transport -run TestTCPFactory >> ./logs/pkg/TestTCPFactory.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/transport -run TestFilePKTable >> ./logs/pkg/TestFilePKTable.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/transport-discovery/client -run TestClientAuth >> ./logs/pkg/TestClientAuth.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/transport-discovery/client -run TestRegisterTransportResponses >> ./logs/pkg/TestRegisterTransportResponses.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/transport-discovery/client -run TestRegisterTransports >> ./logs/pkg/TestRegisterTransports.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/transport-discovery/client -run TestGetTransportByID >> ./logs/pkg/TestGetTransportByID.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/transport-discovery/client -run TestGetTransportsByEdge >> ./logs/pkg/TestGetTransportsByEdge.log +go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/transport-discovery/client -run TestUpdateStatuses >> ./logs/pkg/TestUpdateStatuses.log diff --git a/cmd/apps/helloworld/helloworld.go b/cmd/apps/helloworld/helloworld.go index 6bd4e94ab..226186995 100644 --- a/cmd/apps/helloworld/helloworld.go +++ b/cmd/apps/helloworld/helloworld.go @@ -7,10 +7,10 @@ import ( "log" "os" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" - "github.com/skycoin/skywire/pkg/app" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/app" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) func main() { diff --git a/cmd/apps/skychat/chat.go b/cmd/apps/skychat/chat.go index 70bb19373..a5eaaa8e8 100644 --- a/cmd/apps/skychat/chat.go +++ b/cmd/apps/skychat/chat.go @@ -14,12 +14,12 @@ import ( "sync" "time" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/skycoin/src/util/logging" - "github.com/skycoin/skywire/internal/netutil" - "github.com/skycoin/skywire/pkg/app" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/internal/netutil" + "github.com/SkycoinProject/skywire-mainnet/pkg/app" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) var addr = flag.String("addr", ":8000", "address to bind") diff --git a/cmd/apps/therealproxy-client/therealproxy-client.go b/cmd/apps/therealproxy-client/therealproxy-client.go index 044e001a4..8613599ed 100644 --- a/cmd/apps/therealproxy-client/therealproxy-client.go +++ b/cmd/apps/therealproxy-client/therealproxy-client.go @@ -8,12 +8,12 @@ import ( "net" "time" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" - "github.com/skycoin/skywire/internal/netutil" - "github.com/skycoin/skywire/internal/therealproxy" - "github.com/skycoin/skywire/pkg/app" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/internal/netutil" + "github.com/SkycoinProject/skywire-mainnet/internal/therealproxy" + "github.com/SkycoinProject/skywire-mainnet/pkg/app" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) const socksPort = 3 diff --git a/cmd/apps/therealproxy/therealproxy.go b/cmd/apps/therealproxy/therealproxy.go index 9f7477785..0fef10e14 100644 --- a/cmd/apps/therealproxy/therealproxy.go +++ b/cmd/apps/therealproxy/therealproxy.go @@ -6,8 +6,8 @@ package main import ( "flag" - "github.com/skycoin/skywire/internal/therealproxy" - "github.com/skycoin/skywire/pkg/app" + "github.com/SkycoinProject/skywire-mainnet/internal/therealproxy" + "github.com/SkycoinProject/skywire-mainnet/pkg/app" ) func main() { diff --git a/cmd/apps/therealssh-client/therealssh-client.go b/cmd/apps/therealssh-client/therealssh-client.go index aac564273..900310b59 100644 --- a/cmd/apps/therealssh-client/therealssh-client.go +++ b/cmd/apps/therealssh-client/therealssh-client.go @@ -8,10 +8,10 @@ import ( "net/http" "github.com/sirupsen/logrus" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/skycoin/src/util/logging" - "github.com/skycoin/skywire/pkg/app" - ssh "github.com/skycoin/skywire/pkg/therealssh" + "github.com/SkycoinProject/skywire-mainnet/pkg/app" + ssh "github.com/SkycoinProject/skywire-mainnet/pkg/therealssh" ) var log *logging.MasterLogger diff --git a/cmd/apps/therealssh/therealssh.go b/cmd/apps/therealssh/therealssh.go index fb273a15a..29935c0c9 100644 --- a/cmd/apps/therealssh/therealssh.go +++ b/cmd/apps/therealssh/therealssh.go @@ -8,10 +8,10 @@ import ( "github.com/mitchellh/go-homedir" "github.com/sirupsen/logrus" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/skycoin/src/util/logging" - "github.com/skycoin/skywire/pkg/app" - ssh "github.com/skycoin/skywire/pkg/therealssh" + "github.com/SkycoinProject/skywire-mainnet/pkg/app" + ssh "github.com/SkycoinProject/skywire-mainnet/pkg/therealssh" ) var log *logging.MasterLogger diff --git a/cmd/hypervisor/commands/gen-config.go b/cmd/hypervisor/commands/gen-config.go index 7ece3102f..4956e04e1 100644 --- a/cmd/hypervisor/commands/gen-config.go +++ b/cmd/hypervisor/commands/gen-config.go @@ -6,8 +6,8 @@ import ( "github.com/spf13/cobra" - "github.com/skycoin/skywire/pkg/hypervisor" - "github.com/skycoin/skywire/pkg/util/pathutil" + "github.com/SkycoinProject/skywire-mainnet/pkg/hypervisor" + "github.com/SkycoinProject/skywire-mainnet/pkg/util/pathutil" ) var ( diff --git a/cmd/hypervisor/commands/root.go b/cmd/hypervisor/commands/root.go index c15fd83e1..0b3046531 100644 --- a/cmd/hypervisor/commands/root.go +++ b/cmd/hypervisor/commands/root.go @@ -6,11 +6,11 @@ import ( "net/http" "os" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/spf13/cobra" - "github.com/skycoin/skywire/pkg/hypervisor" - "github.com/skycoin/skywire/pkg/util/pathutil" + "github.com/SkycoinProject/skywire-mainnet/pkg/hypervisor" + "github.com/SkycoinProject/skywire-mainnet/pkg/util/pathutil" ) const configEnv = "SW_HYPERVISOR_CONFIG" diff --git a/cmd/hypervisor/hypervisor.go b/cmd/hypervisor/hypervisor.go index b3f5d88d2..cde4e7977 100644 --- a/cmd/hypervisor/hypervisor.go +++ b/cmd/hypervisor/hypervisor.go @@ -3,7 +3,7 @@ skywire hypervisor */ package main -import "github.com/skycoin/skywire/cmd/hypervisor/commands" +import "github.com/SkycoinProject/skywire-mainnet/cmd/hypervisor/commands" func main() { commands.Execute() diff --git a/cmd/messaging-server/commands/root.go b/cmd/messaging-server/commands/root.go index d4d6674c7..9a4017c59 100644 --- a/cmd/messaging-server/commands/root.go +++ b/cmd/messaging-server/commands/root.go @@ -13,10 +13,10 @@ import ( "github.com/prometheus/client_golang/prometheus/promhttp" logrussyslog "github.com/sirupsen/logrus/hooks/syslog" - "github.com/skycoin/dmsg" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/dmsg/disc" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/dmsg" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/dmsg/disc" + "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/spf13/cobra" ) diff --git a/cmd/messaging-server/messaging-server.go b/cmd/messaging-server/messaging-server.go index 9b40d7141..4db968bea 100644 --- a/cmd/messaging-server/messaging-server.go +++ b/cmd/messaging-server/messaging-server.go @@ -1,6 +1,6 @@ package main -import "github.com/skycoin/skywire/cmd/messaging-server/commands" +import "github.com/SkycoinProject/skywire-mainnet/cmd/messaging-server/commands" func main() { commands.Execute() diff --git a/cmd/setup-node/commands/root.go b/cmd/setup-node/commands/root.go index 7de9a7384..98013074c 100644 --- a/cmd/setup-node/commands/root.go +++ b/cmd/setup-node/commands/root.go @@ -12,11 +12,11 @@ import ( "github.com/prometheus/client_golang/prometheus/promhttp" logrussyslog "github.com/sirupsen/logrus/hooks/syslog" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/spf13/cobra" - "github.com/skycoin/skywire/pkg/metrics" - "github.com/skycoin/skywire/pkg/setup" + "github.com/SkycoinProject/skywire-mainnet/pkg/metrics" + "github.com/SkycoinProject/skywire-mainnet/pkg/setup" ) var ( diff --git a/cmd/setup-node/setup-node.go b/cmd/setup-node/setup-node.go index bd5a86d97..e882d663e 100644 --- a/cmd/setup-node/setup-node.go +++ b/cmd/setup-node/setup-node.go @@ -1,6 +1,6 @@ package main -import "github.com/skycoin/skywire/cmd/setup-node/commands" +import "github.com/SkycoinProject/skywire-mainnet/cmd/setup-node/commands" func main() { commands.Execute() diff --git a/cmd/skywire-cli/commands/mdisc/root.go b/cmd/skywire-cli/commands/mdisc/root.go index 1ad525398..b500045f0 100644 --- a/cmd/skywire-cli/commands/mdisc/root.go +++ b/cmd/skywire-cli/commands/mdisc/root.go @@ -7,10 +7,10 @@ import ( "text/tabwriter" "time" - "github.com/skycoin/dmsg/disc" + "github.com/SkycoinProject/dmsg/disc" "github.com/spf13/cobra" - "github.com/skycoin/skywire/cmd/skywire-cli/internal" + "github.com/SkycoinProject/skywire-mainnet/cmd/skywire-cli/internal" ) var mdAddr string diff --git a/cmd/skywire-cli/commands/node/app.go b/cmd/skywire-cli/commands/node/app.go index c9ec4d7fa..7fdb55613 100644 --- a/cmd/skywire-cli/commands/node/app.go +++ b/cmd/skywire-cli/commands/node/app.go @@ -10,8 +10,8 @@ import ( "github.com/spf13/cobra" - "github.com/skycoin/skywire/cmd/skywire-cli/internal" - "github.com/skycoin/skywire/pkg/visor" + "github.com/SkycoinProject/skywire-mainnet/cmd/skywire-cli/internal" + "github.com/SkycoinProject/skywire-mainnet/pkg/visor" ) func init() { diff --git a/cmd/skywire-cli/commands/node/gen-config.go b/cmd/skywire-cli/commands/node/gen-config.go index 1058b00f9..d3a773001 100644 --- a/cmd/skywire-cli/commands/node/gen-config.go +++ b/cmd/skywire-cli/commands/node/gen-config.go @@ -6,11 +6,11 @@ import ( "path/filepath" "time" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" "github.com/spf13/cobra" - "github.com/skycoin/skywire/pkg/util/pathutil" - "github.com/skycoin/skywire/pkg/visor" + "github.com/SkycoinProject/skywire-mainnet/pkg/util/pathutil" + "github.com/SkycoinProject/skywire-mainnet/pkg/visor" ) func init() { @@ -68,9 +68,9 @@ func homeConfig() *visor.Config { func localConfig() *visor.Config { c := defaultConfig() - c.AppsPath = "/usr/local/skycoin/skywire/apps" - c.Transport.LogStore.Location = "/usr/local/skycoin/skywire/transport_logs" - c.Routing.Table.Location = "/usr/local/skycoin/skywire/routing.db" + c.AppsPath = "/usr/local/SkycoinProject/skywire-mainnet/apps" + c.Transport.LogStore.Location = "/usr/local/SkycoinProject/skywire-mainnet/transport_logs" + c.Routing.Table.Location = "/usr/local/SkycoinProject/skywire-mainnet/routing.db" return c } diff --git a/cmd/skywire-cli/commands/node/root.go b/cmd/skywire-cli/commands/node/root.go index 75d29467a..f75085c7a 100644 --- a/cmd/skywire-cli/commands/node/root.go +++ b/cmd/skywire-cli/commands/node/root.go @@ -3,10 +3,10 @@ package node import ( "net/rpc" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/spf13/cobra" - "github.com/skycoin/skywire/pkg/visor" + "github.com/SkycoinProject/skywire-mainnet/pkg/visor" ) var log = logging.MustGetLogger("skywire-cli") diff --git a/cmd/skywire-cli/commands/node/routes.go b/cmd/skywire-cli/commands/node/routes.go index 0598cb35a..270af469e 100644 --- a/cmd/skywire-cli/commands/node/routes.go +++ b/cmd/skywire-cli/commands/node/routes.go @@ -11,10 +11,10 @@ import ( "github.com/spf13/cobra" - "github.com/skycoin/skywire/cmd/skywire-cli/internal" - "github.com/skycoin/skywire/pkg/router" - "github.com/skycoin/skywire/pkg/routing" - "github.com/skycoin/skywire/pkg/visor" + "github.com/SkycoinProject/skywire-mainnet/cmd/skywire-cli/internal" + "github.com/SkycoinProject/skywire-mainnet/pkg/router" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/visor" ) func init() { diff --git a/cmd/skywire-cli/commands/node/transports.go b/cmd/skywire-cli/commands/node/transports.go index 43b198ba8..d6c4fc375 100644 --- a/cmd/skywire-cli/commands/node/transports.go +++ b/cmd/skywire-cli/commands/node/transports.go @@ -7,12 +7,12 @@ import ( "text/tabwriter" "time" - "github.com/skycoin/dmsg" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg" + "github.com/SkycoinProject/dmsg/cipher" "github.com/spf13/cobra" - "github.com/skycoin/skywire/cmd/skywire-cli/internal" - "github.com/skycoin/skywire/pkg/visor" + "github.com/SkycoinProject/skywire-mainnet/cmd/skywire-cli/internal" + "github.com/SkycoinProject/skywire-mainnet/pkg/visor" ) func init() { diff --git a/cmd/skywire-cli/commands/root.go b/cmd/skywire-cli/commands/root.go index 2c03ffb3d..ba2a9774c 100644 --- a/cmd/skywire-cli/commands/root.go +++ b/cmd/skywire-cli/commands/root.go @@ -5,10 +5,10 @@ import ( "github.com/spf13/cobra" - "github.com/skycoin/skywire/cmd/skywire-cli/commands/mdisc" - "github.com/skycoin/skywire/cmd/skywire-cli/commands/node" - "github.com/skycoin/skywire/cmd/skywire-cli/commands/rtfind" - "github.com/skycoin/skywire/cmd/skywire-cli/commands/tpdisc" + "github.com/SkycoinProject/skywire-mainnet/cmd/skywire-cli/commands/mdisc" + "github.com/SkycoinProject/skywire-mainnet/cmd/skywire-cli/commands/node" + "github.com/SkycoinProject/skywire-mainnet/cmd/skywire-cli/commands/rtfind" + "github.com/SkycoinProject/skywire-mainnet/cmd/skywire-cli/commands/tpdisc" ) var rootCmd = &cobra.Command{ diff --git a/cmd/skywire-cli/commands/rtfind/root.go b/cmd/skywire-cli/commands/rtfind/root.go index 719b76ef9..a05f9502d 100644 --- a/cmd/skywire-cli/commands/rtfind/root.go +++ b/cmd/skywire-cli/commands/rtfind/root.go @@ -4,11 +4,11 @@ import ( "fmt" "time" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" "github.com/spf13/cobra" - "github.com/skycoin/skywire/cmd/skywire-cli/internal" - "github.com/skycoin/skywire/pkg/route-finder/client" + "github.com/SkycoinProject/skywire-mainnet/cmd/skywire-cli/internal" + "github.com/SkycoinProject/skywire-mainnet/pkg/route-finder/client" ) var frAddr string diff --git a/cmd/skywire-cli/commands/tpdisc/root.go b/cmd/skywire-cli/commands/tpdisc/root.go index 295b400f4..129220e09 100644 --- a/cmd/skywire-cli/commands/tpdisc/root.go +++ b/cmd/skywire-cli/commands/tpdisc/root.go @@ -9,12 +9,12 @@ import ( "time" "github.com/google/uuid" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" "github.com/spf13/cobra" - "github.com/skycoin/skywire/cmd/skywire-cli/internal" - "github.com/skycoin/skywire/pkg/transport" - "github.com/skycoin/skywire/pkg/transport-discovery/client" + "github.com/SkycoinProject/skywire-mainnet/cmd/skywire-cli/internal" + "github.com/SkycoinProject/skywire-mainnet/pkg/transport" + "github.com/SkycoinProject/skywire-mainnet/pkg/transport-discovery/client" ) var ( diff --git a/cmd/skywire-cli/internal/internal.go b/cmd/skywire-cli/internal/internal.go index 839bd3129..783c35bd4 100644 --- a/cmd/skywire-cli/internal/internal.go +++ b/cmd/skywire-cli/internal/internal.go @@ -4,8 +4,8 @@ import ( "fmt" "github.com/google/uuid" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/skycoin/src/util/logging" ) var log = logging.MustGetLogger("skywire-cli") diff --git a/cmd/skywire-cli/skywire-cli.go b/cmd/skywire-cli/skywire-cli.go index 0d2da60de..66d50e0a3 100644 --- a/cmd/skywire-cli/skywire-cli.go +++ b/cmd/skywire-cli/skywire-cli.go @@ -4,7 +4,7 @@ CLI for skywire visor package main import ( - "github.com/skycoin/skywire/cmd/skywire-cli/commands" + "github.com/SkycoinProject/skywire-mainnet/cmd/skywire-cli/commands" ) func main() { diff --git a/cmd/skywire-visor/commands/root.go b/cmd/skywire-visor/commands/root.go index 1c2ef76b7..79e164fae 100644 --- a/cmd/skywire-visor/commands/root.go +++ b/cmd/skywire-visor/commands/root.go @@ -20,12 +20,11 @@ import ( "github.com/pkg/profile" logrussyslog "github.com/sirupsen/logrus/hooks/syslog" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/spf13/cobra" - - "github.com/skycoin/skywire/internal/utclient" - "github.com/skycoin/skywire/pkg/util/pathutil" - "github.com/skycoin/skywire/pkg/visor" + "github.com/SkycoinProject/skywire-mainnet/internal/utclient" + "github.com/SkycoinProject/skywire-mainnet/pkg/util/pathutil" + "github.com/SkycoinProject/skywire-mainnet/pkg/visor" ) const configEnv = "SW_CONFIG" diff --git a/cmd/skywire-visor/skywire-visor.go b/cmd/skywire-visor/skywire-visor.go index d4aa990b7..282da4c41 100644 --- a/cmd/skywire-visor/skywire-visor.go +++ b/cmd/skywire-visor/skywire-visor.go @@ -4,7 +4,7 @@ skywire visor package main import ( - "github.com/skycoin/skywire/cmd/skywire-visor/commands" + "github.com/SkycoinProject/skywire-mainnet/cmd/skywire-visor/commands" ) func main() { diff --git a/cmd/therealssh-cli/commands/root.go b/cmd/therealssh-cli/commands/root.go index 84d6a91d2..d4c8b54f0 100644 --- a/cmd/therealssh-cli/commands/root.go +++ b/cmd/therealssh-cli/commands/root.go @@ -14,11 +14,11 @@ import ( "time" "github.com/creack/pty" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" "github.com/spf13/cobra" "golang.org/x/crypto/ssh/terminal" - ssh "github.com/skycoin/skywire/pkg/therealssh" + ssh "github.com/SkycoinProject/skywire-mainnet/pkg/therealssh" ) var ( diff --git a/cmd/therealssh-cli/therealssh-cli.go b/cmd/therealssh-cli/therealssh-cli.go index 56dd20d10..410fcf4ec 100644 --- a/cmd/therealssh-cli/therealssh-cli.go +++ b/cmd/therealssh-cli/therealssh-cli.go @@ -4,7 +4,7 @@ CLI for SSH app package main import ( - "github.com/skycoin/skywire/cmd/therealssh-cli/commands" + "github.com/SkycoinProject/skywire-mainnet/cmd/therealssh-cli/commands" ) func main() { diff --git a/docs/Tests.Detection-of-unstable-tests.md b/docs/Tests.Detection-of-unstable-tests.md index 1d3a9c0e2..ba93b2e11 100644 --- a/docs/Tests.Detection-of-unstable-tests.md +++ b/docs/Tests.Detection-of-unstable-tests.md @@ -21,15 +21,15 @@ You will get output similar to: ```text TestClient -ok github.com/skycoin/skywire/internal/httpauth 0.043s -? github.com/skycoin/skywire/internal/httputil [no test files] +ok github.com/SkycoinProject/skywire-mainnet/internal/httpauth 0.043s +? github.com/SkycoinProject/skywire-mainnet/internal/httputil [no test files] TestAckReadWriter TestAckReadWriterCRCFailure TestAckReadWriterFlushOnClose TestAckReadWriterPartialRead TestAckReadWriterReadError TestLenReadWriter -ok github.com/skycoin/skywire/internal/ioutil 0.049s +ok github.com/SkycoinProject/skywire-mainnet/internal/ioutil 0.049s ``` Filter lines with `[no test files]`. @@ -37,14 +37,14 @@ Filter lines with `[no test files]`. Transform this output to: ```bash -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/httpauth -run TestClient >> ./logs/internal/TestClient.log - -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/ioutil -run TestAckReadWriter >>./logs/internal/TestAckReadWriter.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/ioutil -run TestAckReadWriterCRCFailure >>./logs/internal/TestAckReadWriterCRCFailure.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/ioutil -run TestAckReadWriterFlushOnClose >>./logs/internal/TestAckReadWriterFlushOnClose.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/ioutil -run TestAckReadWriterPartialRead >>./logs/internal/TestAckReadWriterPartialRead.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/ioutil -run TestAckReadWriterReadError >>./logs/internal/TestAckReadWriterReadError.log -go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/skycoin/skywire/internal/ioutil -run TestLenReadWriter >>./logs/internal/TestLenReadWriter.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/httpauth -run TestClient >> ./logs/internal/TestClient.log + +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/ioutil -run TestAckReadWriter >>./logs/internal/TestAckReadWriter.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/ioutil -run TestAckReadWriterCRCFailure >>./logs/internal/TestAckReadWriterCRCFailure.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/ioutil -run TestAckReadWriterFlushOnClose >>./logs/internal/TestAckReadWriterFlushOnClose.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/ioutil -run TestAckReadWriterPartialRead >>./logs/internal/TestAckReadWriterPartialRead.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/ioutil -run TestAckReadWriterReadError >>./logs/internal/TestAckReadWriterReadError.log +go clean -testcache &>/dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/internal/ioutil -run TestLenReadWriter >>./logs/internal/TestLenReadWriter.log ``` Notes: @@ -79,10 +79,10 @@ If you see something like: ```sh $ grep "FAIL" ./logs/pkg/*.log -# ./logs/pkg/TestClientConnectInitialServers.log:FAIL github.com/skycoin/skywire/pkg/messaging 300.838s -# ./logs/pkg/TestClientConnectInitialServers.log:FAIL github.com/skycoin/skywire/pkg/messaging 300.849s -# ./logs/pkg/TestClientConnectInitialServers.log:FAIL github.com/skycoin/skywire/pkg/messaging 300.844s -# ./logs/pkg/TestClientConnectInitialServers.log:FAIL github.com/skycoin/skywire/pkg/messaging 300.849s +# ./logs/pkg/TestClientConnectInitialServers.log:FAIL github.com/SkycoinProject/skywire-mainnet/pkg/messaging 300.838s +# ./logs/pkg/TestClientConnectInitialServers.log:FAIL github.com/SkycoinProject/skywire-mainnet/pkg/messaging 300.849s +# ./logs/pkg/TestClientConnectInitialServers.log:FAIL github.com/SkycoinProject/skywire-mainnet/pkg/messaging 300.844s +# ./logs/pkg/TestClientConnectInitialServers.log:FAIL github.com/SkycoinProject/skywire-mainnet/pkg/messaging 300.849s ``` (note 300s for FAILs) @@ -91,12 +91,12 @@ And: ```sh $ grep "coverage" ./logs/pkg/TestClientConnectInitialServers.log -# ok github.com/skycoin/skywire/pkg/messaging 3.049s coverage: 39.5% of statements +# ok github.com/SkycoinProject/skywire-mainnet/pkg/messaging 3.049s coverage: 39.5% of statements # coverage: 38.0% of statements -# ok github.com/skycoin/skywire/pkg/messaging 3.072s coverage: 39.5% of statements -# ok github.com/skycoin/skywire/pkg/messaging 3.073s coverage: 39.5% of statements -# ok github.com/skycoin/skywire/pkg/messaging 3.071s coverage: 39.5% of statements -# ok github.com/skycoin/skywire/pkg/messaging 3.050s coverage: 39.5% of statements +# ok github.com/SkycoinProject/skywire-mainnet/pkg/messaging 3.072s coverage: 39.5% of statements +# ok github.com/SkycoinProject/skywire-mainnet/pkg/messaging 3.073s coverage: 39.5% of statements +# ok github.com/SkycoinProject/skywire-mainnet/pkg/messaging 3.071s coverage: 39.5% of statements +# ok github.com/SkycoinProject/skywire-mainnet/pkg/messaging 3.050s coverage: 39.5% of statements # coverage: 38.0% of statements ``` @@ -129,11 +129,11 @@ Temporary solution: test was moved to `./pkg/messaging/client_test.go` and tagge ```sh $ grep coverage ./logs/internal/*.log # ./logs/internal/TestReadWriterConcurrentTCP.log -# 1:ok github.com/skycoin/skywire/internal/noise 1.545s coverage: 0.0% of statements -# 2:ok github.com/skycoin/skywire/internal/noise 1.427s coverage: 0.0% of statements -# 3:ok github.com/skycoin/skywire/internal/noise 1.429s coverage: 0.0% of statements -# 4:ok github.com/skycoin/skywire/internal/noise 1.429s coverage: 0.0% of statements -# 5:ok github.com/skycoin/skywire/internal/noise 1.436s coverage: 0.0% of statements +# 1:ok github.com/SkycoinProject/skywire-mainnet/internal/noise 1.545s coverage: 0.0% of statements +# 2:ok github.com/SkycoinProject/skywire-mainnet/internal/noise 1.427s coverage: 0.0% of statements +# 3:ok github.com/SkycoinProject/skywire-mainnet/internal/noise 1.429s coverage: 0.0% of statements +# 4:ok github.com/SkycoinProject/skywire-mainnet/internal/noise 1.429s coverage: 0.0% of statements +# 5:ok github.com/SkycoinProject/skywire-mainnet/internal/noise 1.436s coverage: 0.0% of statements ``` Note 0.0% coverage diff --git a/go.mod b/go.mod index e292f1728..963fe3b6c 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,12 @@ -module github.com/skycoin/skywire +module github.com/SkycoinProject/skywire-mainnet go 1.12 require ( + github.com/SkycoinProject/dmsg v0.0.0-20190917230949-27f4fd2f25fb + github.com/SkycoinProject/skycoin v0.26.0 github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect - github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4 // indirect + github.com/alecthomas/units v0.0.0-20190910110746-680d30ca3117 // indirect github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 github.com/creack/pty v1.1.7 github.com/go-chi/chi v4.0.2+incompatible @@ -19,8 +21,6 @@ require ( github.com/prometheus/client_golang v1.1.0 github.com/prometheus/common v0.6.0 github.com/sirupsen/logrus v1.4.2 - github.com/skycoin/dmsg v0.0.0-20190904181013-b781e3cbebc6 - github.com/skycoin/skycoin v0.26.0 github.com/spf13/cobra v0.0.5 github.com/stretchr/testify v1.4.0 go.etcd.io/bbolt v1.3.3 @@ -29,4 +29,4 @@ require ( ) // Uncomment for tests with alternate branches of 'dmsg' -//replace github.com/skycoin/dmsg => ../dmsg +//replace github.com/SkycoinProject/dmsg => ../dmsg diff --git a/go.sum b/go.sum index 60f365b04..912d194ae 100644 --- a/go.sum +++ b/go.sum @@ -1,10 +1,14 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/SkycoinProject/dmsg v0.0.0-20190917230949-27f4fd2f25fb h1:bAKk+ypvaiD5YuIkOmWhh2FJVX2XQpJPR4TgQKsYD8Y= +github.com/SkycoinProject/dmsg v0.0.0-20190917230949-27f4fd2f25fb/go.mod h1:FwzixIUE0zAT9J1cfWU5WsN9JiI49oQ6dHlNZcpq23s= +github.com/SkycoinProject/skycoin v0.26.0 h1:8/ZRZb2VM2DM4YTIitRJMZ3Yo/3H1FFmbCMx5o6ekmA= +github.com/SkycoinProject/skycoin v0.26.0/go.mod h1:xqPLOKh5B6GBZlGA7B5IJfQmCy7mwimD9NlqxR3gMXo= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4 h1:Hs82Z41s6SdL1CELW+XaDYmOH4hkBN4/N9og/AsOv7E= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190910110746-680d30ca3117 h1:aUo+WrWZtRRfc6WITdEKzEczFRlEpfW15NhNeLRc17U= +github.com/alecthomas/units v0.0.0-20190910110746-680d30ca3117/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= @@ -99,8 +103,6 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/skycoin/dmsg v0.0.0-20190904181013-b781e3cbebc6 h1:YwSyQXUyG/EFp3xCGMkOldgQNpw8XLfmocQND4/Y3aw= -github.com/skycoin/dmsg v0.0.0-20190904181013-b781e3cbebc6/go.mod h1:obZYZp8eKR7Xqz+KNhJdUE6Gvp6rEXbDO8YTlW2YXgU= github.com/skycoin/skycoin v0.26.0 h1:xDxe2r8AclMntZ550Y/vUQgwgLtwrf9Wu5UYiYcN5/o= github.com/skycoin/skycoin v0.26.0/go.mod h1:78nHjQzd8KG0jJJVL/j0xMmrihXi70ti63fh8vXScJw= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= @@ -128,7 +130,6 @@ golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472 h1:Gv7RPwsi3eZ2Fgewe3CBsuOebPwO27PoXzRpJPsvSSM= golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -136,7 +137,6 @@ golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -148,9 +148,6 @@ golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3 h1:4y9KwBHBgBNwDbtu44R5o1fdOCQUEXhbk/P4A9WmJq0= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190627182818-9947fec5c3ab/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/internal/httpauth/auth.go b/internal/httpauth/auth.go index a3417faca..c742e387f 100644 --- a/internal/httpauth/auth.go +++ b/internal/httpauth/auth.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" ) // Nonce is used to sign requests in order to avoid replay attack diff --git a/internal/httpauth/client.go b/internal/httpauth/client.go index 3a6625585..88739a1d3 100644 --- a/internal/httpauth/client.go +++ b/internal/httpauth/client.go @@ -14,8 +14,8 @@ import ( "strings" "sync/atomic" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/skycoin/src/util/logging" ) const ( diff --git a/internal/httpauth/client_test.go b/internal/httpauth/client_test.go index cd74a577b..2b0ed48df 100644 --- a/internal/httpauth/client_test.go +++ b/internal/httpauth/client_test.go @@ -12,8 +12,8 @@ import ( "strconv" "testing" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/internal/therealproxy/client.go b/internal/therealproxy/client.go index a0747f9f9..167b70a5b 100644 --- a/internal/therealproxy/client.go +++ b/internal/therealproxy/client.go @@ -6,7 +6,7 @@ import ( "net" "github.com/hashicorp/yamux" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/skycoin/src/util/logging" ) // Log is therealproxy package level logger, it can be replaced with a different one from outside the package diff --git a/internal/therealproxy/server.go b/internal/therealproxy/server.go index eeecc2019..d1e94286b 100644 --- a/internal/therealproxy/server.go +++ b/internal/therealproxy/server.go @@ -6,7 +6,7 @@ import ( "github.com/armon/go-socks5" "github.com/hashicorp/yamux" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/skycoin/src/util/logging" ) // Server implements multiplexing proxy server using yamux. diff --git a/internal/therealproxy/server_test.go b/internal/therealproxy/server_test.go index 76c5ee1f5..9ba3dc114 100644 --- a/internal/therealproxy/server_test.go +++ b/internal/therealproxy/server_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "golang.org/x/net/nettest" diff --git a/internal/utclient/client.go b/internal/utclient/client.go index 5c6c1ef88..a42efedfe 100644 --- a/internal/utclient/client.go +++ b/internal/utclient/client.go @@ -11,10 +11,10 @@ import ( "io/ioutil" "net/http" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/skycoin/src/util/logging" - "github.com/skycoin/skywire/internal/httpauth" + "github.com/SkycoinProject/skywire-mainnet/internal/httpauth" ) var log = logging.MustGetLogger("utclient") diff --git a/internal/utclient/client_test.go b/internal/utclient/client_test.go index e72afa6b4..2ffe44485 100644 --- a/internal/utclient/client_test.go +++ b/internal/utclient/client_test.go @@ -9,11 +9,11 @@ import ( "sync" "testing" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/skycoin/skywire/internal/httpauth" + "github.com/SkycoinProject/skywire-mainnet/internal/httpauth" ) var testPubKey, testSecKey = cipher.GenerateKeyPair() diff --git a/pkg/app/app.go b/pkg/app/app.go index 16ec17f11..a6672065f 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -14,9 +14,9 @@ import ( "path/filepath" "sync" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/skycoin/src/util/logging" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) const ( diff --git a/pkg/app/app_test.go b/pkg/app/app_test.go index 91ac3b489..e93869c1b 100644 --- a/pkg/app/app_test.go +++ b/pkg/app/app_test.go @@ -9,13 +9,13 @@ import ( "testing" "time" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/skycoin/skywire/internal/testhelpers" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/internal/testhelpers" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) func TestMain(m *testing.M) { diff --git a/pkg/app/log.go b/pkg/app/log.go index 81997eee8..058ad3663 100644 --- a/pkg/app/log.go +++ b/pkg/app/log.go @@ -5,7 +5,7 @@ import ( "os" "time" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/skycoin/src/util/logging" ) // NewLogger returns a logger which persists app logs. This logger should be passed down diff --git a/pkg/app/packet.go b/pkg/app/packet.go index f77ada615..539d26438 100644 --- a/pkg/app/packet.go +++ b/pkg/app/packet.go @@ -1,6 +1,6 @@ package app -import "github.com/skycoin/skywire/pkg/routing" +import "github.com/SkycoinProject/skywire-mainnet/pkg/routing" // Packet represents message exchanged between App and Node. type Packet struct { diff --git a/pkg/app/packet_test.go b/pkg/app/packet_test.go index 7990a166b..b9d5d8f4e 100644 --- a/pkg/app/packet_test.go +++ b/pkg/app/packet_test.go @@ -3,9 +3,9 @@ package app import ( "fmt" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) func ExamplePacket() { diff --git a/pkg/httputil/httputil.go b/pkg/httputil/httputil.go index 30b796a17..8dcb7fcd7 100644 --- a/pkg/httputil/httputil.go +++ b/pkg/httputil/httputil.go @@ -8,7 +8,7 @@ import ( "net/http" "github.com/gorilla/handlers" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/skycoin/src/util/logging" ) var log = logging.MustGetLogger("httputil") diff --git a/pkg/hypervisor/config.go b/pkg/hypervisor/config.go index 0e82b9145..b49dad3b5 100644 --- a/pkg/hypervisor/config.go +++ b/pkg/hypervisor/config.go @@ -8,9 +8,9 @@ import ( "path/filepath" "time" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" - "github.com/skycoin/skywire/pkg/util/pathutil" + "github.com/SkycoinProject/skywire-mainnet/pkg/util/pathutil" ) // Key allows a byte slice to be marshaled or unmarshaled from a hex string. @@ -76,7 +76,7 @@ func GenerateHomeConfig() Config { // GenerateLocalConfig generates a config with default values and uses db from shared folder. func GenerateLocalConfig() Config { c := makeConfig() - c.DBPath = "/usr/local/skycoin/hypervisor/users.db" + c.DBPath = "/usr/local/SkycoinProject/hypervisor/users.db" return c } diff --git a/pkg/hypervisor/hypervisor.go b/pkg/hypervisor/hypervisor.go index cf7c135bd..bd8049586 100644 --- a/pkg/hypervisor/hypervisor.go +++ b/pkg/hypervisor/hypervisor.go @@ -16,14 +16,13 @@ import ( "github.com/go-chi/chi" "github.com/go-chi/chi/middleware" "github.com/google/uuid" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/dmsg/noise" - "github.com/skycoin/skycoin/src/util/logging" - - "github.com/skycoin/skywire/pkg/app" - "github.com/skycoin/skywire/pkg/httputil" - "github.com/skycoin/skywire/pkg/routing" - "github.com/skycoin/skywire/pkg/visor" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/dmsg/noise" + "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/SkycoinProject/skywire-mainnet/pkg/app" + "github.com/SkycoinProject/skywire-mainnet/pkg/httputil" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/visor" ) var ( diff --git a/pkg/hypervisor/hypervisor_test.go b/pkg/hypervisor/hypervisor_test.go index 74becc374..a5f181e53 100644 --- a/pkg/hypervisor/hypervisor_test.go +++ b/pkg/hypervisor/hypervisor_test.go @@ -13,7 +13,7 @@ import ( "strings" "testing" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/hypervisor/user.go b/pkg/hypervisor/user.go index 7237a20ef..898eb48ea 100644 --- a/pkg/hypervisor/user.go +++ b/pkg/hypervisor/user.go @@ -8,7 +8,7 @@ import ( "regexp" "time" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" "go.etcd.io/bbolt" ) diff --git a/pkg/hypervisor/user_manager.go b/pkg/hypervisor/user_manager.go index cee03b559..733657c94 100644 --- a/pkg/hypervisor/user_manager.go +++ b/pkg/hypervisor/user_manager.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/gorilla/securecookie" - "github.com/skycoin/skywire/pkg/httputil" + "github.com/SkycoinProject/skywire-mainnet/pkg/httputil" ) const ( diff --git a/pkg/route-finder/client/client.go b/pkg/route-finder/client/client.go index 6fa5b5335..a096a953a 100644 --- a/pkg/route-finder/client/client.go +++ b/pkg/route-finder/client/client.go @@ -11,10 +11,10 @@ import ( "strings" "time" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/skycoin/src/util/logging" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) const defaultContextTimeout = 10 * time.Second diff --git a/pkg/route-finder/client/mock.go b/pkg/route-finder/client/mock.go index 3184b2b91..0ebdba97e 100644 --- a/pkg/route-finder/client/mock.go +++ b/pkg/route-finder/client/mock.go @@ -1,10 +1,10 @@ package client import ( - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" - "github.com/skycoin/skywire/pkg/routing" - "github.com/skycoin/skywire/pkg/transport" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/transport" ) // MockClient implements mock route finder client. diff --git a/pkg/router/app_manager.go b/pkg/router/app_manager.go index 8b51c576a..41486f1c7 100644 --- a/pkg/router/app_manager.go +++ b/pkg/router/app_manager.go @@ -7,10 +7,10 @@ import ( "fmt" "time" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/skycoin/src/util/logging" - "github.com/skycoin/skywire/pkg/app" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/app" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) const supportedProtocolVersion = "0.0.1" diff --git a/pkg/router/app_manager_test.go b/pkg/router/app_manager_test.go index 8b314e963..3ad6723fd 100644 --- a/pkg/router/app_manager_test.go +++ b/pkg/router/app_manager_test.go @@ -5,14 +5,14 @@ import ( "net" "testing" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/skycoin/skywire/internal/testhelpers" - "github.com/skycoin/skywire/pkg/app" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/internal/testhelpers" + "github.com/SkycoinProject/skywire-mainnet/pkg/app" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) func TestAppManagerInit(t *testing.T) { diff --git a/pkg/router/loop_list.go b/pkg/router/loop_list.go index 4a4ad08ba..a435399ea 100644 --- a/pkg/router/loop_list.go +++ b/pkg/router/loop_list.go @@ -5,7 +5,7 @@ import ( "github.com/google/uuid" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) type loop struct { diff --git a/pkg/router/managed_routing_table.go b/pkg/router/managed_routing_table.go index 6c4a49792..bea27ac62 100644 --- a/pkg/router/managed_routing_table.go +++ b/pkg/router/managed_routing_table.go @@ -5,7 +5,7 @@ import ( "sync" "time" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) var ( diff --git a/pkg/router/managed_routing_table_test.go b/pkg/router/managed_routing_table_test.go index 577627360..45a89812a 100644 --- a/pkg/router/managed_routing_table_test.go +++ b/pkg/router/managed_routing_table_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) func TestManagedRoutingTableCleanup(t *testing.T) { diff --git a/pkg/router/port_list.go b/pkg/router/port_list.go index 5652d8de6..98447ccda 100644 --- a/pkg/router/port_list.go +++ b/pkg/router/port_list.go @@ -4,8 +4,8 @@ import ( "math" "sync" - "github.com/skycoin/skywire/pkg/app" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/app" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) type portBind struct { diff --git a/pkg/router/port_manager.go b/pkg/router/port_manager.go index 87dcab4eb..c2c2a84b0 100644 --- a/pkg/router/port_manager.go +++ b/pkg/router/port_manager.go @@ -4,8 +4,8 @@ import ( "errors" "fmt" - "github.com/skycoin/skywire/pkg/app" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/app" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) type portManager struct { diff --git a/pkg/router/port_manager_test.go b/pkg/router/port_manager_test.go index 9a548ce99..bd9eb184c 100644 --- a/pkg/router/port_manager_test.go +++ b/pkg/router/port_manager_test.go @@ -5,12 +5,12 @@ import ( "sort" "testing" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/skycoin/skywire/pkg/app" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/app" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) func TestPortManager(t *testing.T) { diff --git a/pkg/router/route_manager.go b/pkg/router/route_manager.go index b1717b18a..c23f4e56a 100644 --- a/pkg/router/route_manager.go +++ b/pkg/router/route_manager.go @@ -9,12 +9,12 @@ import ( "time" "github.com/google/uuid" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/skycoin/src/util/logging" +"github.com/SkycoinProject/dmsg/cipher" +"github.com/SkycoinProject/skycoin/src/util/logging" - "github.com/skycoin/skywire/pkg/routing" - "github.com/skycoin/skywire/pkg/setup" - "github.com/skycoin/skywire/pkg/snet" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/setup" +"github.com/SkycoinProject/skywire-mainnet/pkg/snet" ) // RMConfig represents route manager configuration. diff --git a/pkg/router/route_manager_test.go b/pkg/router/route_manager_test.go index 729e2c699..b6c3024ba 100644 --- a/pkg/router/route_manager_test.go +++ b/pkg/router/route_manager_test.go @@ -6,15 +6,15 @@ import ( "testing" "time" - "github.com/skycoin/skywire/pkg/setup" - "github.com/skycoin/skywire/pkg/snet/snettest" + "github.com/SkycoinProject/skywire-mainnet/pkg/setup" + "github.com/SkycoinProject/skywire-mainnet/pkg/snet/snettest" "github.com/google/uuid" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) func TestNewRouteManager(t *testing.T) { diff --git a/pkg/router/router.go b/pkg/router/router.go index 9b49339fe..f1f48a0e6 100644 --- a/pkg/router/router.go +++ b/pkg/router/router.go @@ -10,16 +10,15 @@ import ( "sync" "time" - "github.com/skycoin/skywire/pkg/snet" - - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/skycoin/src/util/logging" - - "github.com/skycoin/skywire/pkg/app" - routeFinder "github.com/skycoin/skywire/pkg/route-finder/client" - "github.com/skycoin/skywire/pkg/routing" - "github.com/skycoin/skywire/pkg/setup" - "github.com/skycoin/skywire/pkg/transport" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/skycoin/src/util/logging" + + "github.com/SkycoinProject/skywire-mainnet/pkg/app" + "github.com/SkycoinProject/skywire-mainnet/pkg/snet" + routeFinder "github.com/SkycoinProject/skywire-mainnet/pkg/route-finder/client" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/setup" + "github.com/SkycoinProject/skywire-mainnet/pkg/transport" ) const ( diff --git a/pkg/router/router_test.go b/pkg/router/router_test.go index 7e7501047..fbdba2609 100644 --- a/pkg/router/router_test.go +++ b/pkg/router/router_test.go @@ -7,18 +7,17 @@ import ( "testing" "time" - "github.com/skycoin/dmsg" + "github.com/sirupsen/logrus" + "github.com/SkycoinProject/dmsg" + "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - routeFinder "github.com/skycoin/skywire/pkg/route-finder/client" - "github.com/skycoin/skywire/pkg/routing" - "github.com/skycoin/skywire/pkg/snet" - "github.com/skycoin/skywire/pkg/snet/snettest" - "github.com/skycoin/skywire/pkg/transport" - - "github.com/sirupsen/logrus" - "github.com/skycoin/skycoin/src/util/logging" + routeFinder "github.com/SkycoinProject/skywire-mainnet/pkg/route-finder/client" + "github.com/SkycoinProject/skywire-mainnet/pkg/snet" + "github.com/SkycoinProject/skywire-mainnet/pkg/snet/snettest" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/transport" ) func TestMain(m *testing.M) { diff --git a/pkg/routing/addr.go b/pkg/routing/addr.go index ff72a137d..c41e230c3 100644 --- a/pkg/routing/addr.go +++ b/pkg/routing/addr.go @@ -3,7 +3,7 @@ package routing import ( "fmt" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" ) // Port is a network port number diff --git a/pkg/routing/boltdb_routing_table.go b/pkg/routing/boltdb_routing_table.go index 033a6da9c..d699ff4f7 100644 --- a/pkg/routing/boltdb_routing_table.go +++ b/pkg/routing/boltdb_routing_table.go @@ -6,7 +6,7 @@ import ( "fmt" "math" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/skycoin/src/util/logging" "go.etcd.io/bbolt" ) diff --git a/pkg/routing/loop.go b/pkg/routing/loop.go index 3206fd8aa..b975e74dd 100644 --- a/pkg/routing/loop.go +++ b/pkg/routing/loop.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" ) // Loop defines a loop over a pair of addresses. diff --git a/pkg/routing/route.go b/pkg/routing/route.go index 86a962748..ec2de3907 100644 --- a/pkg/routing/route.go +++ b/pkg/routing/route.go @@ -6,7 +6,7 @@ import ( "fmt" "github.com/google/uuid" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" ) // Hop defines a route hop between 2 nodes. diff --git a/pkg/routing/routing_table_test.go b/pkg/routing/routing_table_test.go index 7adee00be..625a560df 100644 --- a/pkg/routing/routing_table_test.go +++ b/pkg/routing/routing_table_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/google/uuid" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/routing/rule.go b/pkg/routing/rule.go index a47b9b89f..806185005 100644 --- a/pkg/routing/rule.go +++ b/pkg/routing/rule.go @@ -8,7 +8,7 @@ import ( "time" "github.com/google/uuid" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" ) // RuleHeaderSize represents the base size of a rule. diff --git a/pkg/routing/rule_test.go b/pkg/routing/rule_test.go index 93ec1b6ef..604a75f96 100644 --- a/pkg/routing/rule_test.go +++ b/pkg/routing/rule_test.go @@ -5,7 +5,7 @@ import ( "time" "github.com/google/uuid" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" "github.com/stretchr/testify/assert" ) diff --git a/pkg/setup/config.go b/pkg/setup/config.go index e30becc02..47dc99d85 100644 --- a/pkg/setup/config.go +++ b/pkg/setup/config.go @@ -3,7 +3,7 @@ package setup import ( "time" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" ) // Various timeouts for setup node. diff --git a/pkg/setup/idreservoir.go b/pkg/setup/idreservoir.go index 467192c6c..9f21b99ab 100644 --- a/pkg/setup/idreservoir.go +++ b/pkg/setup/idreservoir.go @@ -8,9 +8,9 @@ import ( "sync" "time" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) type idReservoir struct { diff --git a/pkg/setup/node.go b/pkg/setup/node.go index c522a7329..bcf65763c 100644 --- a/pkg/setup/node.go +++ b/pkg/setup/node.go @@ -7,16 +7,14 @@ import ( "fmt" "time" - "github.com/skycoin/skywire/pkg/snet" - - "github.com/skycoin/dmsg" - - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/dmsg/disc" - "github.com/skycoin/skycoin/src/util/logging" - - "github.com/skycoin/skywire/pkg/metrics" - "github.com/skycoin/skywire/pkg/routing" + "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/snet" + "github.com/SkycoinProject/skywire-mainnet/pkg/metrics" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) // Node performs routes setup operations over messaging channel. diff --git a/pkg/setup/node_test.go b/pkg/setup/node_test.go index 7f765e2e3..d1bb46964 100644 --- a/pkg/setup/node_test.go +++ b/pkg/setup/node_test.go @@ -12,17 +12,17 @@ import ( "testing" "time" - "github.com/skycoin/dmsg" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/dmsg/disc" +"github.com/SkycoinProject/dmsg" +"github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/dmsg/disc" "github.com/stretchr/testify/require" "golang.org/x/net/nettest" - "github.com/skycoin/skywire/pkg/metrics" - "github.com/skycoin/skywire/pkg/routing" - "github.com/skycoin/skywire/pkg/snet" + "github.com/SkycoinProject/skywire-mainnet/pkg/metrics" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/snet" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/skycoin/src/util/logging" ) func TestMain(m *testing.M) { diff --git a/pkg/setup/protocol.go b/pkg/setup/protocol.go index 8421406d9..11450ab0a 100644 --- a/pkg/setup/protocol.go +++ b/pkg/setup/protocol.go @@ -9,7 +9,7 @@ import ( "fmt" "io" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) // PacketType defines type of a setup packet diff --git a/pkg/snet/network.go b/pkg/snet/network.go index 0143feba9..18154eef1 100644 --- a/pkg/snet/network.go +++ b/pkg/snet/network.go @@ -8,13 +8,13 @@ import ( "strings" "sync" - "github.com/skycoin/skywire/pkg/snet/stcp" + "github.com/SkycoinProject/skywire-mainnet/pkg/snet/stcp" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/skycoin/src/util/logging" - "github.com/skycoin/dmsg" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/dmsg/disc" + "github.com/SkycoinProject/dmsg" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/dmsg/disc" ) // Default ports. diff --git a/pkg/snet/network_test.go b/pkg/snet/network_test.go index af9ecbcac..556492ae4 100644 --- a/pkg/snet/network_test.go +++ b/pkg/snet/network_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/skycoin/dmsg" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg" + "github.com/SkycoinProject/dmsg/cipher" ) func TestDisassembleAddr(t *testing.T) { diff --git a/pkg/snet/snettest/env.go b/pkg/snet/snettest/env.go index 02a89996e..dcd1bde03 100644 --- a/pkg/snet/snettest/env.go +++ b/pkg/snet/snettest/env.go @@ -6,13 +6,13 @@ import ( "github.com/stretchr/testify/assert" - "github.com/skycoin/dmsg" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/dmsg/disc" + "github.com/SkycoinProject/dmsg" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/dmsg/disc" "github.com/stretchr/testify/require" "golang.org/x/net/nettest" - "github.com/skycoin/skywire/pkg/snet" + "github.com/SkycoinProject/skywire-mainnet/pkg/snet" ) // KeyPair holds a public/private key pair. diff --git a/pkg/snet/stcp/client.go b/pkg/snet/stcp/client.go index ea725780d..e5933c493 100644 --- a/pkg/snet/stcp/client.go +++ b/pkg/snet/stcp/client.go @@ -9,9 +9,9 @@ import ( "sync" "time" - "github.com/skycoin/dmsg" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/dmsg" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/skycoin/src/util/logging" ) // Conn wraps an underlying net.Conn and modifies various methods to integrate better with the 'network' package. diff --git a/pkg/snet/stcp/handshake.go b/pkg/snet/stcp/handshake.go index 12ae6e179..e97269342 100644 --- a/pkg/snet/stcp/handshake.go +++ b/pkg/snet/stcp/handshake.go @@ -9,10 +9,10 @@ import ( "net" "time" - cipher2 "github.com/skycoin/skycoin/src/cipher" + cipher2 "github.com/SkycoinProject/skycoin/src/cipher" - "github.com/skycoin/dmsg" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg" + "github.com/SkycoinProject/dmsg/cipher" ) const ( diff --git a/pkg/snet/stcp/handshake_test.go b/pkg/snet/stcp/handshake_test.go index d1065efd9..4100f4c13 100644 --- a/pkg/snet/stcp/handshake_test.go +++ b/pkg/snet/stcp/handshake_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "github.com/skycoin/dmsg" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg" + "github.com/SkycoinProject/dmsg/cipher" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/snet/stcp/pktable.go b/pkg/snet/stcp/pktable.go index 39d5aa4e0..4d9d463b2 100644 --- a/pkg/snet/stcp/pktable.go +++ b/pkg/snet/stcp/pktable.go @@ -8,7 +8,7 @@ import ( "path/filepath" "strings" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" ) // PKTable associates public keys to tcp addresses. diff --git a/pkg/therealssh/auth.go b/pkg/therealssh/auth.go index a49852e51..86115b7e2 100644 --- a/pkg/therealssh/auth.go +++ b/pkg/therealssh/auth.go @@ -7,7 +7,7 @@ import ( "os" "path/filepath" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" ) // Authorizer defines interface for authorization providers. diff --git a/pkg/therealssh/auth_test.go b/pkg/therealssh/auth_test.go index 8871d2452..2dd2d3791 100644 --- a/pkg/therealssh/auth_test.go +++ b/pkg/therealssh/auth_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" "github.com/stretchr/testify/require" ) diff --git a/pkg/therealssh/channel.go b/pkg/therealssh/channel.go index 35af51d3a..356c8a0b0 100644 --- a/pkg/therealssh/channel.go +++ b/pkg/therealssh/channel.go @@ -13,9 +13,9 @@ import ( "sync" "github.com/creack/pty" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) // Port reserved for SSH app diff --git a/pkg/therealssh/channel_pty_test.go b/pkg/therealssh/channel_pty_test.go index 5144a0e39..8b2004e7e 100644 --- a/pkg/therealssh/channel_pty_test.go +++ b/pkg/therealssh/channel_pty_test.go @@ -8,11 +8,11 @@ import ( "testing" "time" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) func TestChannelServe(t *testing.T) { diff --git a/pkg/therealssh/channel_test.go b/pkg/therealssh/channel_test.go index b7ced6ed6..b92ab90ba 100644 --- a/pkg/therealssh/channel_test.go +++ b/pkg/therealssh/channel_test.go @@ -9,12 +9,12 @@ import ( "testing" "time" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/skycoin/skywire/internal/testhelpers" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/internal/testhelpers" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) func TestChannelSendWrite(t *testing.T) { diff --git a/pkg/therealssh/client.go b/pkg/therealssh/client.go index 41365f891..3280e7197 100644 --- a/pkg/therealssh/client.go +++ b/pkg/therealssh/client.go @@ -11,10 +11,10 @@ import ( "time" "github.com/creack/pty" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" - "github.com/skycoin/skywire/internal/netutil" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/internal/netutil" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) var r = netutil.NewRetrier(50*time.Millisecond, 5, 2) diff --git a/pkg/therealssh/client_test.go b/pkg/therealssh/client_test.go index 9402246f7..c0a437c8d 100644 --- a/pkg/therealssh/client_test.go +++ b/pkg/therealssh/client_test.go @@ -5,11 +5,11 @@ import ( "net" "testing" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) func TestClientOpenChannel(t *testing.T) { diff --git a/pkg/therealssh/dialer.go b/pkg/therealssh/dialer.go index 7e5da3a9b..d49c78889 100644 --- a/pkg/therealssh/dialer.go +++ b/pkg/therealssh/dialer.go @@ -3,7 +3,7 @@ package therealssh import ( "net" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) // dialer dials to a remote node. diff --git a/pkg/therealssh/pty_test.go b/pkg/therealssh/pty_test.go index d5483e7ba..42338c914 100644 --- a/pkg/therealssh/pty_test.go +++ b/pkg/therealssh/pty_test.go @@ -10,11 +10,11 @@ import ( "testing" "github.com/creack/pty" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/stretchr/testify/require" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) func TestRunRPC(t *testing.T) { diff --git a/pkg/therealssh/server.go b/pkg/therealssh/server.go index 3d28e1edb..9b1c74958 100644 --- a/pkg/therealssh/server.go +++ b/pkg/therealssh/server.go @@ -7,10 +7,10 @@ import ( "io" "net" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/skycoin/src/util/logging" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) // CommandType represents global protocol messages. diff --git a/pkg/therealssh/server_test.go b/pkg/therealssh/server_test.go index 83663eb2d..237ff4455 100644 --- a/pkg/therealssh/server_test.go +++ b/pkg/therealssh/server_test.go @@ -6,12 +6,12 @@ import ( "os" "testing" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) func TestMain(m *testing.M) { diff --git a/pkg/therealssh/session.go b/pkg/therealssh/session.go index 85e71ce35..ba1b0a06f 100644 --- a/pkg/therealssh/session.go +++ b/pkg/therealssh/session.go @@ -12,7 +12,7 @@ import ( "syscall" "github.com/creack/pty" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/skycoin/src/util/logging" ) // Log is the package level logger, which can be replaced from outside diff --git a/pkg/transport-discovery/client/client.go b/pkg/transport-discovery/client/client.go index 02c0f967d..a2e315278 100644 --- a/pkg/transport-discovery/client/client.go +++ b/pkg/transport-discovery/client/client.go @@ -12,11 +12,11 @@ import ( "net/http" "github.com/google/uuid" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/skycoin/src/util/logging" - "github.com/skycoin/skywire/internal/httpauth" - "github.com/skycoin/skywire/pkg/transport" + "github.com/SkycoinProject/skywire-mainnet/internal/httpauth" + "github.com/SkycoinProject/skywire-mainnet/pkg/transport" ) var log = logging.MustGetLogger("transport-discovery") diff --git a/pkg/transport-discovery/client/client_test.go b/pkg/transport-discovery/client/client_test.go index c231a0880..cb2f66da3 100644 --- a/pkg/transport-discovery/client/client_test.go +++ b/pkg/transport-discovery/client/client_test.go @@ -11,13 +11,13 @@ import ( "sync" "testing" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/skycoin/skywire/internal/httpauth" - "github.com/skycoin/skywire/pkg/transport" + "github.com/SkycoinProject/skywire-mainnet/internal/httpauth" + "github.com/SkycoinProject/skywire-mainnet/pkg/transport" ) func TestMain(m *testing.M) { diff --git a/pkg/transport/discovery.go b/pkg/transport/discovery.go index 682503678..4d88c0227 100644 --- a/pkg/transport/discovery.go +++ b/pkg/transport/discovery.go @@ -7,7 +7,7 @@ import ( "time" "github.com/google/uuid" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" ) // DiscoveryClient performs Transport discovery operations. diff --git a/pkg/transport/discovery_test.go b/pkg/transport/discovery_test.go index de633dd8d..0d9a810b6 100644 --- a/pkg/transport/discovery_test.go +++ b/pkg/transport/discovery_test.go @@ -6,9 +6,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" - "github.com/skycoin/skywire/pkg/transport" + "github.com/SkycoinProject/skywire-mainnet/pkg/transport" ) func TestNewDiscoveryMock(t *testing.T) { diff --git a/pkg/transport/entry.go b/pkg/transport/entry.go index 1c4dd0fe6..2ddd3595c 100644 --- a/pkg/transport/entry.go +++ b/pkg/transport/entry.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/google/uuid" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" ) // Entry is the unsigned representation of a Transport. diff --git a/pkg/transport/entry_test.go b/pkg/transport/entry_test.go index bcc91ad68..06e5fb39e 100644 --- a/pkg/transport/entry_test.go +++ b/pkg/transport/entry_test.go @@ -6,9 +6,9 @@ import ( "github.com/stretchr/testify/assert" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" - "github.com/skycoin/skywire/pkg/transport" + "github.com/SkycoinProject/skywire-mainnet/pkg/transport" ) func TestNewEntry(t *testing.T) { diff --git a/pkg/transport/handshake.go b/pkg/transport/handshake.go index 7ec41237d..567411c63 100644 --- a/pkg/transport/handshake.go +++ b/pkg/transport/handshake.go @@ -7,9 +7,7 @@ import ( "fmt" "io" - "github.com/skycoin/skywire/pkg/snet" - - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" ) func makeEntry(pk1, pk2 cipher.PubKey, tpType string) Entry { diff --git a/pkg/transport/handshake_test.go b/pkg/transport/handshake_test.go index cbfc0950c..e7cfd8af5 100644 --- a/pkg/transport/handshake_test.go +++ b/pkg/transport/handshake_test.go @@ -4,12 +4,12 @@ import ( "context" "testing" - "github.com/skycoin/dmsg" + "github.com/SkycoinProject/dmsg" "github.com/stretchr/testify/require" - "github.com/skycoin/skywire/pkg/snet" - "github.com/skycoin/skywire/pkg/snet/snettest" - "github.com/skycoin/skywire/pkg/transport" + "github.com/SkycoinProject/skywire-mainnet/pkg/snet" + "github.com/SkycoinProject/skywire-mainnet/pkg/snet/snettest" + "github.com/SkycoinProject/skywire-mainnet/pkg/transport" ) func TestSettlementHS(t *testing.T) { diff --git a/pkg/transport/log_test.go b/pkg/transport/log_test.go index ad0cdce10..45e166b8f 100644 --- a/pkg/transport/log_test.go +++ b/pkg/transport/log_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/skycoin/skywire/pkg/transport" + "github.com/SkycoinProject/skywire-mainnet/pkg/transport" ) func testTransportLogStore(t *testing.T, logStore transport.LogStore) { diff --git a/pkg/transport/managed_transport.go b/pkg/transport/managed_transport.go index a61869fdf..153200b75 100644 --- a/pkg/transport/managed_transport.go +++ b/pkg/transport/managed_transport.go @@ -8,13 +8,11 @@ import ( "sync" "sync/atomic" "time" + "github.com/SkycoinProject/skywire-mainnet/pkg/snet" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" - "github.com/skycoin/skywire/pkg/snet" - - "github.com/skycoin/skywire/pkg/routing" - - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/skycoin/src/util/logging" ) const logWriteInterval = time.Second * 3 diff --git a/pkg/transport/manager.go b/pkg/transport/manager.go index 3b2b1307e..41b99ab44 100644 --- a/pkg/transport/manager.go +++ b/pkg/transport/manager.go @@ -7,13 +7,12 @@ import ( "strings" "sync" - "github.com/skycoin/skywire/pkg/snet" - - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/snet" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" "github.com/google/uuid" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/skycoin/src/util/logging" ) // ManagerConfig configures a Manager. diff --git a/pkg/transport/manager_test.go b/pkg/transport/manager_test.go index 67cd08a06..0bfc1c441 100644 --- a/pkg/transport/manager_test.go +++ b/pkg/transport/manager_test.go @@ -7,16 +7,14 @@ import ( "os" "testing" "time" + "github.com/SkycoinProject/skycoin/src/util/logging" - "github.com/skycoin/skywire/pkg/snet/snettest" + "github.com/SkycoinProject/skywire-mainnet/pkg/snet/snettest" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/transport" - "github.com/skycoin/skycoin/src/util/logging" - - "github.com/skycoin/skywire/pkg/routing" - "github.com/skycoin/skywire/pkg/transport" - - "github.com/skycoin/dmsg" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg" + "github.com/SkycoinProject/dmsg/cipher" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/transport/transport.go b/pkg/transport/transport.go index d4af4a0e4..6cb51e1fb 100644 --- a/pkg/transport/transport.go +++ b/pkg/transport/transport.go @@ -7,8 +7,8 @@ import ( "math/big" "github.com/google/uuid" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/skycoin/src/util/logging" ) var log = logging.MustGetLogger("transport") diff --git a/pkg/util/pathutil/configpath.go b/pkg/util/pathutil/configpath.go index b55729c1a..fab9a8951 100644 --- a/pkg/util/pathutil/configpath.go +++ b/pkg/util/pathutil/configpath.go @@ -6,7 +6,7 @@ import ( "os" "path/filepath" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/skycoin/src/util/logging" ) var log = logging.MustGetLogger("pathutil") @@ -78,7 +78,7 @@ func NodeDefaults() ConfigPaths { paths[WorkingDirLoc] = filepath.Join(wd, "skywire-config.json") } paths[HomeLoc] = filepath.Join(HomeDir(), ".skycoin/skywire/skywire-config.json") - paths[LocalLoc] = "/usr/local/skycoin/skywire/skywire-config.json" + paths[LocalLoc] = "/usr/local/SkycoinProject/skywire-mainnet/skywire-config.json" return paths } @@ -89,7 +89,7 @@ func HypervisorDefaults() ConfigPaths { paths[WorkingDirLoc] = filepath.Join(wd, "hypervisor-config.json") } paths[HomeLoc] = filepath.Join(HomeDir(), ".skycoin/hypervisor/hypervisor-config.json") - paths[LocalLoc] = "/usr/local/skycoin/hypervisor/hypervisor-config.json" + paths[LocalLoc] = "/usr/local/SkycoinProject/hypervisor/hypervisor-config.json" return paths } diff --git a/pkg/util/pathutil/homedir.go b/pkg/util/pathutil/homedir.go index b814615c0..454afc0da 100644 --- a/pkg/util/pathutil/homedir.go +++ b/pkg/util/pathutil/homedir.go @@ -7,7 +7,7 @@ import ( "path/filepath" "runtime" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" ) // HomeDir obtains the path to the user's home directory via ENVs. diff --git a/pkg/visor/config.go b/pkg/visor/config.go index 36451dd6d..5727b4712 100644 --- a/pkg/visor/config.go +++ b/pkg/visor/config.go @@ -8,12 +8,11 @@ import ( "path/filepath" "time" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/dmsg/disc" - - "github.com/skycoin/skywire/pkg/routing" - "github.com/skycoin/skywire/pkg/transport" - trClient "github.com/skycoin/skywire/pkg/transport-discovery/client" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/dmsg/disc" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/transport" + trClient "github.com/SkycoinProject/skywire-mainnet/pkg/transport-discovery/client" ) // Config defines configuration parameters for Node. diff --git a/pkg/visor/config_test.go b/pkg/visor/config_test.go index 0a278bdf4..1c6345f44 100644 --- a/pkg/visor/config_test.go +++ b/pkg/visor/config_test.go @@ -10,12 +10,12 @@ import ( "testing" "time" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/skycoin/skywire/internal/httpauth" - "github.com/skycoin/skywire/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/internal/httpauth" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" ) func TestMessagingDiscovery(t *testing.T) { diff --git a/pkg/visor/rpc.go b/pkg/visor/rpc.go index 43072f1c3..e9955c745 100644 --- a/pkg/visor/rpc.go +++ b/pkg/visor/rpc.go @@ -8,11 +8,10 @@ import ( "time" "github.com/google/uuid" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" - "github.com/skycoin/skywire/pkg/app" - "github.com/skycoin/skywire/pkg/routing" - "github.com/skycoin/skywire/pkg/transport" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/transport" ) const ( diff --git a/pkg/visor/rpc_client.go b/pkg/visor/rpc_client.go index c9464b55a..edd429bb7 100644 --- a/pkg/visor/rpc_client.go +++ b/pkg/visor/rpc_client.go @@ -10,13 +10,10 @@ import ( "time" "github.com/google/uuid" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/skycoin/src/util/logging" - - "github.com/skycoin/skywire/pkg/app" - "github.com/skycoin/skywire/pkg/router" - "github.com/skycoin/skywire/pkg/routing" - "github.com/skycoin/skywire/pkg/transport" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/transport" ) // RPCClient represents a RPC Client implementation. diff --git a/pkg/visor/rpc_test.go b/pkg/visor/rpc_test.go index b04428e59..dd4d54eea 100644 --- a/pkg/visor/rpc_test.go +++ b/pkg/visor/rpc_test.go @@ -7,13 +7,15 @@ import ( "testing" "time" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/skycoin/skywire/pkg/routing" - "github.com/skycoin/skywire/pkg/util/pathutil" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/util/pathutil" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/util/pathutil" ) func TestHealth(t *testing.T) { diff --git a/pkg/visor/visor.go b/pkg/visor/visor.go index 375d1ee67..ddb7016a0 100644 --- a/pkg/visor/visor.go +++ b/pkg/visor/visor.go @@ -19,19 +19,18 @@ import ( "syscall" "time" - "github.com/skycoin/skywire/pkg/snet" - - "github.com/skycoin/dmsg" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/dmsg/noise" - "github.com/skycoin/skycoin/src/util/logging" - - "github.com/skycoin/skywire/pkg/app" - routeFinder "github.com/skycoin/skywire/pkg/route-finder/client" - "github.com/skycoin/skywire/pkg/router" - "github.com/skycoin/skywire/pkg/routing" - "github.com/skycoin/skywire/pkg/transport" - "github.com/skycoin/skywire/pkg/util/pathutil" + "github.com/SkycoinProject/skywire-mainnet/pkg/snet" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/dmsg" + "github.com/SkycoinProject/dmsg/noise" + "github.com/SkycoinProject/skycoin/src/util/logging" + + "github.com/SkycoinProject/skywire-mainnet/pkg/app" + routeFinder "github.com/SkycoinProject/skywire-mainnet/pkg/route-finder/client" + "github.com/SkycoinProject/skywire-mainnet/pkg/router" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/transport" + "github.com/SkycoinProject/skywire-mainnet/pkg/util/pathutil" ) var log = logging.MustGetLogger("node") diff --git a/pkg/visor/visor_test.go b/pkg/visor/visor_test.go index 5ae56cb7a..078695a7a 100644 --- a/pkg/visor/visor_test.go +++ b/pkg/visor/visor_test.go @@ -11,18 +11,18 @@ import ( "testing" "time" - "github.com/skycoin/dmsg" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/dmsg/disc" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/dmsg" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/dmsg/disc" + "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/skycoin/skywire/pkg/app" - "github.com/skycoin/skywire/pkg/routing" - "github.com/skycoin/skywire/pkg/snet" - "github.com/skycoin/skywire/pkg/transport" - "github.com/skycoin/skywire/pkg/util/pathutil" + "github.com/SkycoinProject/skywire-mainnet/pkg/app" + "github.com/SkycoinProject/skywire-mainnet/pkg/routing" + "github.com/SkycoinProject/skywire-mainnet/pkg/snet" + "github.com/SkycoinProject/skywire-mainnet/pkg/transport" + "github.com/SkycoinProject/skywire-mainnet/pkg/util/pathutil" ) var masterLogger *logging.MasterLogger diff --git a/vendor/github.com/skycoin/dmsg/.gitignore b/vendor/github.com/SkycoinProject/dmsg/.gitignore similarity index 100% rename from vendor/github.com/skycoin/dmsg/.gitignore rename to vendor/github.com/SkycoinProject/dmsg/.gitignore diff --git a/vendor/github.com/skycoin/dmsg/.golangci.yml b/vendor/github.com/SkycoinProject/dmsg/.golangci.yml similarity index 100% rename from vendor/github.com/skycoin/dmsg/.golangci.yml rename to vendor/github.com/SkycoinProject/dmsg/.golangci.yml diff --git a/vendor/github.com/skycoin/dmsg/.travis.yml b/vendor/github.com/SkycoinProject/dmsg/.travis.yml similarity index 100% rename from vendor/github.com/skycoin/dmsg/.travis.yml rename to vendor/github.com/SkycoinProject/dmsg/.travis.yml diff --git a/vendor/github.com/skycoin/dmsg/Makefile b/vendor/github.com/SkycoinProject/dmsg/Makefile similarity index 95% rename from vendor/github.com/skycoin/dmsg/Makefile rename to vendor/github.com/SkycoinProject/dmsg/Makefile index f7ee1e651..c9c376c6c 100644 --- a/vendor/github.com/skycoin/dmsg/Makefile +++ b/vendor/github.com/SkycoinProject/dmsg/Makefile @@ -27,7 +27,7 @@ install-linters: ## Install linters ${OPTS} go get -u golang.org/x/tools/cmd/goimports format: ## Formats the code. Must have goimports installed (use make install-linters). - ${OPTS} goimports -w -local github.com/skycoin/dmsg . + ${OPTS} goimports -w -local github.com/SkycoinProject/dmsg . dep: ## Sorts dependencies ${OPTS} go mod download diff --git a/vendor/github.com/skycoin/dmsg/README.md b/vendor/github.com/SkycoinProject/dmsg/README.md similarity index 100% rename from vendor/github.com/skycoin/dmsg/README.md rename to vendor/github.com/SkycoinProject/dmsg/README.md diff --git a/vendor/github.com/skycoin/dmsg/TESTING.md b/vendor/github.com/SkycoinProject/dmsg/TESTING.md similarity index 100% rename from vendor/github.com/skycoin/dmsg/TESTING.md rename to vendor/github.com/SkycoinProject/dmsg/TESTING.md diff --git a/vendor/github.com/skycoin/dmsg/cipher/cipher.go b/vendor/github.com/SkycoinProject/dmsg/cipher/cipher.go similarity index 98% rename from vendor/github.com/skycoin/dmsg/cipher/cipher.go rename to vendor/github.com/SkycoinProject/dmsg/cipher/cipher.go index 86f567538..c62f6d1a7 100644 --- a/vendor/github.com/skycoin/dmsg/cipher/cipher.go +++ b/vendor/github.com/SkycoinProject/dmsg/cipher/cipher.go @@ -1,5 +1,5 @@ // Package cipher implements common golang encoding interfaces for -// github.com/skycoin/skycoin/src/cipher +// github.com/SkycoinProject/skycoin/src/cipher package cipher import ( @@ -7,7 +7,7 @@ import ( "fmt" "strings" - "github.com/skycoin/skycoin/src/cipher" + "github.com/SkycoinProject/skycoin/src/cipher" ) func init() { diff --git a/vendor/github.com/SkycoinProject/dmsg/client.go b/vendor/github.com/SkycoinProject/dmsg/client.go new file mode 100644 index 000000000..2fdc6136f --- /dev/null +++ b/vendor/github.com/SkycoinProject/dmsg/client.go @@ -0,0 +1,583 @@ +package dmsg + +import ( + "context" + "errors" + "fmt" + "net" + "sync" + "time" + + "github.com/sirupsen/logrus" + "github.com/SkycoinProject/skycoin/src/util/logging" + + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/dmsg/disc" + "github.com/SkycoinProject/dmsg/noise" +) + +var log = logging.MustGetLogger("dmsg") + +const ( + clientReconnectInterval = 3 * time.Second +) + +var ( + // ErrNoSrv indicate that remote client does not have DelegatedServers in entry. + ErrNoSrv = errors.New("remote has no DelegatedServers") + // ErrClientClosed indicates that client is closed and not accepting new connections. + ErrClientClosed = errors.New("client closed") + // ErrClientAcceptMaxed indicates that the client cannot take in more accepts. + ErrClientAcceptMaxed = errors.New("client accepts buffer maxed") +) + +// ClientConn represents a connection between a dmsg.Client and dmsg.Server from a client's perspective. +type ClientConn struct { + log *logging.Logger + + net.Conn // conn to dmsg server + local cipher.PubKey // local client's pk + remoteSrv cipher.PubKey // dmsg server's public key + + // nextInitID keeps track of unused tp_ids to assign a future locally-initiated tp. + // locally-initiated tps use an even tp_id between local and intermediary dms_server. + nextInitID uint16 + + // Transports: map of transports to remote dms_clients (key: tp_id, val: transport). + tps map[uint16]*Transport + mx sync.RWMutex // to protect tps + + done chan struct{} + once sync.Once + wg sync.WaitGroup +} + +// NewClientConn creates a new ClientConn. +func NewClientConn(log *logging.Logger, conn net.Conn, local, remote cipher.PubKey) *ClientConn { + cc := &ClientConn{ + log: log, + Conn: conn, + local: local, + remoteSrv: remote, + nextInitID: randID(true), + tps: make(map[uint16]*Transport), + done: make(chan struct{}), + } + cc.wg.Add(1) + return cc +} + +// RemotePK returns the remote Server's PK that the ClientConn is connected to. +func (c *ClientConn) RemotePK() cipher.PubKey { return c.remoteSrv } + +func (c *ClientConn) getNextInitID(ctx context.Context) (uint16, error) { + for { + select { + case <-c.done: + return 0, ErrClientClosed + case <-ctx.Done(): + return 0, ctx.Err() + default: + if ch := c.tps[c.nextInitID]; ch != nil && !ch.IsClosed() { + c.nextInitID += 2 + continue + } + c.tps[c.nextInitID] = nil + id := c.nextInitID + c.nextInitID = id + 2 + return id, nil + } + } +} + +func (c *ClientConn) addTp(ctx context.Context, clientPK cipher.PubKey) (*Transport, error) { + c.mx.Lock() + defer c.mx.Unlock() + + id, err := c.getNextInitID(ctx) + if err != nil { + return nil, err + } + tp := NewTransport(c.Conn, c.log, c.local, clientPK, id, c.delTp) + c.tps[id] = tp + return tp, nil +} + +func (c *ClientConn) setTp(tp *Transport) { + c.mx.Lock() + c.tps[tp.id] = tp + c.mx.Unlock() +} + +func (c *ClientConn) delTp(id uint16) { + c.mx.Lock() + c.tps[id] = nil + c.mx.Unlock() +} + +func (c *ClientConn) getTp(id uint16) (*Transport, bool) { + c.mx.RLock() + tp := c.tps[id] + c.mx.RUnlock() + ok := tp != nil && !tp.IsClosed() + return tp, ok +} + +func (c *ClientConn) setNextInitID(nextInitID uint16) { + c.mx.Lock() + c.nextInitID = nextInitID + c.mx.Unlock() +} + +func (c *ClientConn) readOK() error { + fr, err := readFrame(c.Conn) + if err != nil { + return errors.New("failed to get OK from server") + } + + ft, _, _ := fr.Disassemble() + if ft != OkType { + return fmt.Errorf("wrong frame from server: %v", ft) + } + + return nil +} + +func (c *ClientConn) handleRequestFrame(accept chan<- *Transport, id uint16, p []byte) (cipher.PubKey, error) { + // remotely-initiated tps should: + // - have a payload structured as 'init_pk:resp_pk'. + // - resp_pk should be of local client. + // - use an odd tp_id with the intermediary dmsg_server. + initPK, respPK, ok := splitPKs(p) + if !ok || respPK != c.local || isInitiatorID(id) { + if err := writeCloseFrame(c.Conn, id, 0); err != nil { + return initPK, err + } + return initPK, ErrRequestCheckFailed + } + + tp := NewTransport(c.Conn, c.log, c.local, initPK, id, c.delTp) + + select { + case <-c.done: + if err := tp.Close(); err != nil { + log.WithError(err).Warn("Failed to close transport") + } + return initPK, ErrClientClosed + default: + select { + case accept <- tp: + c.setTp(tp) + if err := tp.WriteAccept(); err != nil { + return initPK, err + } + go tp.Serve() + return initPK, nil + + default: + if err := tp.Close(); err != nil { + log.WithError(err).Warn("Failed to close transport") + } + return initPK, ErrClientAcceptMaxed + } + } +} + +// Serve handles incoming frames. +// Remote-initiated tps that are successfully created are pushing into 'accept' and exposed via 'Client.Accept()'. +func (c *ClientConn) Serve(ctx context.Context, accept chan<- *Transport) (err error) { + log := c.log.WithField("remoteServer", c.remoteSrv) + log.WithField("connCount", incrementServeCount()).Infoln("ServingConn") + defer func() { + c.close() + log.WithError(err).WithField("connCount", decrementServeCount()).Infoln("ConnectionClosed") + c.wg.Done() + }() + + for { + f, err := readFrame(c.Conn) + if err != nil { + return fmt.Errorf("read failed: %s", err) + } + log = log.WithField("received", f) + + ft, id, p := f.Disassemble() + + // If tp of tp_id exists, attempt to forward frame to tp. + // delete tp on any failure. + + if tp, ok := c.getTp(id); ok { + if err := tp.HandleFrame(f); err != nil { + log.WithError(err).Warnf("Rejected [%s]: Transport closed.", ft) + } + continue + } + + // if tp does not exist, frame should be 'REQUEST'. + // otherwise, handle any unexpected frames accordingly. + + c.delTp(id) // rm tp in case closed tp is not fully removed. + + switch ft { + case RequestType: + c.wg.Add(1) + go func(log *logrus.Entry) { + defer c.wg.Done() + initPK, err := c.handleRequestFrame(accept, id, p) + if err != nil { + log.WithField("remoteClient", initPK).WithError(err).Infoln("Rejected [REQUEST]") + if isWriteError(err) || err == ErrClientClosed { + err := c.Close() + log.WithError(err).Warn("ClosingConnection") + } + return + } + log.WithField("remoteClient", initPK).Infoln("Accepted [REQUEST]") + }(log) + + default: + log.Debugf("Ignored [%s]: No transport of given ID.", ft) + if ft != CloseType { + if err := writeCloseFrame(c.Conn, id, 0); err != nil { + return err + } + } + } + } +} + +// DialTransport dials a transport to remote dms_client. +func (c *ClientConn) DialTransport(ctx context.Context, clientPK cipher.PubKey) (*Transport, error) { + tp, err := c.addTp(ctx, clientPK) + if err != nil { + return nil, err + } + if err := tp.WriteRequest(); err != nil { + return nil, err + } + if err := tp.ReadAccept(ctx); err != nil { + return nil, err + } + go tp.Serve() + return tp, nil +} + +func (c *ClientConn) close() (closed bool) { + if c == nil { + return false + } + c.once.Do(func() { + closed = true + c.log.WithField("remoteServer", c.remoteSrv).Infoln("ClosingConnection") + close(c.done) + c.mx.Lock() + for _, tp := range c.tps { + tp := tp + go func() { + if err := tp.Close(); err != nil { + log.WithError(err).Warn("Failed to close transport") + } + }() + } + if err := c.Conn.Close(); err != nil { + log.WithError(err).Warn("Failed to close connection") + } + c.mx.Unlock() + }) + return closed +} + +// Close closes the connection to dms_server. +func (c *ClientConn) Close() error { + if c.close() { + c.wg.Wait() + } + return nil +} + +// ClientOption represents an optional argument for Client. +type ClientOption func(c *Client) error + +// SetLogger sets the internal logger for Client. +func SetLogger(log *logging.Logger) ClientOption { + return func(c *Client) error { + if log == nil { + return errors.New("nil logger set") + } + c.log = log + return nil + } +} + +// Client implements transport.Factory +type Client struct { + log *logging.Logger + + pk cipher.PubKey + sk cipher.SecKey + dc disc.APIClient + + conns map[cipher.PubKey]*ClientConn // conns with messaging servers. Key: pk of server + mx sync.RWMutex + + accept chan *Transport + done chan struct{} + once sync.Once +} + +// NewClient creates a new Client. +func NewClient(pk cipher.PubKey, sk cipher.SecKey, dc disc.APIClient, opts ...ClientOption) *Client { + c := &Client{ + log: logging.MustGetLogger("dmsg_client"), + pk: pk, + sk: sk, + dc: dc, + conns: make(map[cipher.PubKey]*ClientConn), + accept: make(chan *Transport, AcceptBufferSize), + done: make(chan struct{}), + } + for _, opt := range opts { + if err := opt(c); err != nil { + panic(err) + } + } + return c +} + +func (c *Client) updateDiscEntry(ctx context.Context) error { + srvPKs := make([]cipher.PubKey, 0, len(c.conns)) + for pk := range c.conns { + srvPKs = append(srvPKs, pk) + } + entry, err := c.dc.Entry(ctx, c.pk) + if err != nil { + entry = disc.NewClientEntry(c.pk, 0, srvPKs) + if err := entry.Sign(c.sk); err != nil { + return err + } + return c.dc.SetEntry(ctx, entry) + } + entry.Client.DelegatedServers = srvPKs + c.log.Infoln("updatingEntry:", entry) + return c.dc.UpdateEntry(ctx, c.sk, entry) +} + +func (c *Client) setConn(ctx context.Context, conn *ClientConn) { + c.mx.Lock() + c.conns[conn.remoteSrv] = conn + if err := c.updateDiscEntry(ctx); err != nil { + c.log.WithError(err).Warn("updateEntry: failed") + } + c.mx.Unlock() +} + +func (c *Client) delConn(ctx context.Context, pk cipher.PubKey) { + c.mx.Lock() + delete(c.conns, pk) + if err := c.updateDiscEntry(ctx); err != nil { + c.log.WithError(err).Warn("updateEntry: failed") + } + c.mx.Unlock() +} + +func (c *Client) getConn(pk cipher.PubKey) (*ClientConn, bool) { + c.mx.RLock() + l, ok := c.conns[pk] + c.mx.RUnlock() + return l, ok +} + +func (c *Client) connCount() int { + c.mx.RLock() + n := len(c.conns) + c.mx.RUnlock() + return n +} + +// InitiateServerConnections initiates connections with dms_servers. +func (c *Client) InitiateServerConnections(ctx context.Context, min int) error { + if min == 0 { + return nil + } + entries, err := c.findServerEntries(ctx) + if err != nil { + return err + } + c.log.Info("found dms_server entries:", entries) + if err := c.findOrConnectToServers(ctx, entries, min); err != nil { + return err + } + return nil +} + +func (c *Client) findServerEntries(ctx context.Context) ([]*disc.Entry, error) { + for { + entries, err := c.dc.AvailableServers(ctx) + if err != nil || len(entries) == 0 { + select { + case <-ctx.Done(): + return nil, fmt.Errorf("dms_servers are not available: %s", err) + default: + retry := time.Second + c.log.WithError(err).Warnf("no dms_servers found: trying again in %d second...", retry) + time.Sleep(retry) + continue + } + } + return entries, nil + } +} + +func (c *Client) findOrConnectToServers(ctx context.Context, entries []*disc.Entry, min int) error { + for _, entry := range entries { + _, err := c.findOrConnectToServer(ctx, entry.Static) + if err != nil { + c.log.Warnf("findOrConnectToServers: failed to find/connect to server %s: %s", entry.Static, err) + continue + } + c.log.Infof("findOrConnectToServers: found/connected to server %s", entry.Static) + if c.connCount() >= min { + return nil + } + } + return fmt.Errorf("findOrConnectToServers: all servers failed") +} + +func (c *Client) findOrConnectToServer(ctx context.Context, srvPK cipher.PubKey) (*ClientConn, error) { + if conn, ok := c.getConn(srvPK); ok { + return conn, nil + } + + entry, err := c.dc.Entry(ctx, srvPK) + if err != nil { + return nil, err + } + if entry.Server == nil { + return nil, errors.New("entry is of client instead of server") + } + + tcpConn, err := net.Dial("tcp", entry.Server.Address) + if err != nil { + return nil, err + } + ns, err := noise.New(noise.HandshakeXK, noise.Config{ + LocalPK: c.pk, + LocalSK: c.sk, + RemotePK: srvPK, + Initiator: true, + }) + if err != nil { + return nil, err + } + nc, err := noise.WrapConn(tcpConn, ns, TransportHandshakeTimeout) + if err != nil { + return nil, err + } + + conn := NewClientConn(c.log, nc, c.pk, srvPK) + if err := conn.readOK(); err != nil { + return nil, err + } + + c.setConn(ctx, conn) + + go func() { + err := conn.Serve(ctx, c.accept) + conn.log.WithError(err).WithField("remoteServer", srvPK).Warn("connected with server closed") + c.delConn(ctx, srvPK) + + // reconnect logic. + retryServerConnect: + select { + case <-c.done: + case <-ctx.Done(): + case <-time.After(clientReconnectInterval): + conn.log.WithField("remoteServer", srvPK).Warn("Reconnecting") + if _, err := c.findOrConnectToServer(ctx, srvPK); err != nil { + conn.log.WithError(err).WithField("remoteServer", srvPK).Warn("ReconnectionFailed") + goto retryServerConnect + } + conn.log.WithField("remoteServer", srvPK).Warn("ReconnectionSucceeded") + } + }() + return conn, nil +} + +// Accept accepts remotely-initiated tps. +func (c *Client) Accept(ctx context.Context) (*Transport, error) { + select { + case tp, ok := <-c.accept: + if !ok { + return nil, ErrClientClosed + } + return tp, nil + case <-c.done: + return nil, ErrClientClosed + case <-ctx.Done(): + return nil, ctx.Err() + } +} + +// Dial dials a transport to remote dms_client. +func (c *Client) Dial(ctx context.Context, remote cipher.PubKey) (*Transport, error) { + entry, err := c.dc.Entry(ctx, remote) + if err != nil { + return nil, fmt.Errorf("get entry failure: %s", err) + } + if entry.Client == nil { + return nil, errors.New("entry is of server instead of client") + } + if len(entry.Client.DelegatedServers) == 0 { + return nil, ErrNoSrv + } + for _, srvPK := range entry.Client.DelegatedServers { + conn, err := c.findOrConnectToServer(ctx, srvPK) + if err != nil { + c.log.WithError(err).Warn("failed to connect to server") + continue + } + return conn.DialTransport(ctx, remote) + } + return nil, errors.New("failed to find dms_servers for given client pk") +} + +// Local returns the local dms_client's public key. +func (c *Client) Local() cipher.PubKey { + return c.pk +} + +// Type returns the transport type. +func (c *Client) Type() string { + return Type +} + +// Close closes the dms_client and associated connections. +// TODO(evaninjin): proper error handling. +func (c *Client) Close() error { + if c == nil { + return nil + } + + c.once.Do(func() { + close(c.done) + + c.mx.Lock() + for _, conn := range c.conns { + if err := conn.Close(); err != nil { + log.WithError(err).Warn("Failed to close connection") + } + } + c.conns = make(map[cipher.PubKey]*ClientConn) + c.mx.Unlock() + + for { + select { + case <-c.accept: + default: + close(c.accept) + return + } + } + }) + return nil +} diff --git a/vendor/github.com/skycoin/dmsg/disc/client.go b/vendor/github.com/SkycoinProject/dmsg/disc/client.go similarity index 97% rename from vendor/github.com/skycoin/dmsg/disc/client.go rename to vendor/github.com/SkycoinProject/dmsg/disc/client.go index 9f3d4c2ad..a7238320f 100644 --- a/vendor/github.com/skycoin/dmsg/disc/client.go +++ b/vendor/github.com/SkycoinProject/dmsg/disc/client.go @@ -11,9 +11,9 @@ import ( "sync" "time" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/skycoin/src/util/logging" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" ) var log = logging.MustGetLogger("disc") diff --git a/vendor/github.com/skycoin/dmsg/disc/entry.go b/vendor/github.com/SkycoinProject/dmsg/disc/entry.go similarity index 99% rename from vendor/github.com/skycoin/dmsg/disc/entry.go rename to vendor/github.com/SkycoinProject/dmsg/disc/entry.go index afebaabcd..bdeafb528 100644 --- a/vendor/github.com/skycoin/dmsg/disc/entry.go +++ b/vendor/github.com/SkycoinProject/dmsg/disc/entry.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" ) const currentVersion = "0.0.1" diff --git a/vendor/github.com/skycoin/dmsg/disc/http_message.go b/vendor/github.com/SkycoinProject/dmsg/disc/http_message.go similarity index 100% rename from vendor/github.com/skycoin/dmsg/disc/http_message.go rename to vendor/github.com/SkycoinProject/dmsg/disc/http_message.go diff --git a/vendor/github.com/skycoin/dmsg/disc/testing.go b/vendor/github.com/SkycoinProject/dmsg/disc/testing.go similarity index 98% rename from vendor/github.com/skycoin/dmsg/disc/testing.go rename to vendor/github.com/SkycoinProject/dmsg/disc/testing.go index dd2eeab9d..8dc40964c 100644 --- a/vendor/github.com/skycoin/dmsg/disc/testing.go +++ b/vendor/github.com/SkycoinProject/dmsg/disc/testing.go @@ -7,7 +7,7 @@ import ( "sync" "time" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" ) // MockClient is an APIClient mock. The mock doesn't reply with the same errors as the diff --git a/vendor/github.com/skycoin/dmsg/frame.go b/vendor/github.com/SkycoinProject/dmsg/frame.go similarity index 85% rename from vendor/github.com/skycoin/dmsg/frame.go rename to vendor/github.com/SkycoinProject/dmsg/frame.go index 33b354ef9..d00833647 100644 --- a/vendor/github.com/skycoin/dmsg/frame.go +++ b/vendor/github.com/SkycoinProject/dmsg/frame.go @@ -8,17 +8,14 @@ import ( "sync/atomic" "time" - "github.com/skycoin/dmsg/ioutil" + "github.com/SkycoinProject/dmsg/ioutil" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" ) const ( // Type returns the transport type string. Type = "dmsg" - // HandshakePayloadVersion contains payload version to maintain compatibility with future versions - // of HandshakePayload format. - HandshakePayloadVersion = "1" tpBufCap = math.MaxUint16 tpBufFrameCap = math.MaxUint8 @@ -34,15 +31,6 @@ var ( AcceptBufferSize = 20 ) -// HandshakePayload represents format of payload sent with REQUEST frames. -// TODO(evanlinjin): Use 'dmsg.Addr' for PK:Port pair. -type HandshakePayload struct { - Version string `json:"version"` // just in case the struct changes. - InitPK cipher.PubKey `json:"init_pk"` - RespPK cipher.PubKey `json:"resp_pk"` - Port uint16 `json:"port"` -} - func isInitiatorID(tpID uint16) bool { return tpID%2 == 0 } func randID(initiator bool) uint16 { @@ -88,11 +76,6 @@ const ( AckType = FrameType(0xb) ) -// Reasons for closing frames -const ( - PlaceholderReason = iota -) - // Frame is the dmsg data unit. type Frame []byte diff --git a/vendor/github.com/skycoin/dmsg/go.mod b/vendor/github.com/SkycoinProject/dmsg/go.mod similarity index 78% rename from vendor/github.com/skycoin/dmsg/go.mod rename to vendor/github.com/SkycoinProject/dmsg/go.mod index a24455c1f..7efd7a29d 100644 --- a/vendor/github.com/skycoin/dmsg/go.mod +++ b/vendor/github.com/SkycoinProject/dmsg/go.mod @@ -1,20 +1,19 @@ -module github.com/skycoin/dmsg +module github.com/SkycoinProject/dmsg go 1.12 require ( + github.com/SkycoinProject/skycoin v0.26.0 github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6 github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect github.com/kr/pretty v0.1.0 // indirect github.com/mattn/go-colorable v0.1.2 // indirect github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect github.com/sirupsen/logrus v1.4.2 - github.com/skycoin/skycoin v0.26.0 + github.com/skycoin/skycoin v0.26.0 // indirect github.com/stretchr/testify v1.3.0 golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4 // indirect golang.org/x/net v0.0.0-20190620200207-3b0461eec859 golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb // indirect - golang.org/x/text v0.3.2 // indirect - golang.org/x/tools v0.0.0-20190627182818-9947fec5c3ab // indirect gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect ) diff --git a/vendor/github.com/skycoin/dmsg/go.sum b/vendor/github.com/SkycoinProject/dmsg/go.sum similarity index 84% rename from vendor/github.com/skycoin/dmsg/go.sum rename to vendor/github.com/SkycoinProject/dmsg/go.sum index c6a730a9e..9bd02b3dd 100644 --- a/vendor/github.com/skycoin/dmsg/go.sum +++ b/vendor/github.com/SkycoinProject/dmsg/go.sum @@ -1,9 +1,10 @@ +github.com/SkycoinProject/skycoin v0.26.0 h1:8/ZRZb2VM2DM4YTIitRJMZ3Yo/3H1FFmbCMx5o6ekmA= +github.com/SkycoinProject/skycoin v0.26.0/go.mod h1:xqPLOKh5B6GBZlGA7B5IJfQmCy7mwimD9NlqxR3gMXo= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6 h1:u/UEqS66A5ckRmS4yNpjmVH56sVtS/RfclBAYocb4as= github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:1i71OnUq3iUe1ma7Lr6yG6/rjvM3emb6yoL7xLFzcVQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -32,22 +33,15 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4 h1:ydJNl0ENAG67pFbB+9tfhiL2pYqLhfoaZFw/cjLhY4A= golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb h1:fgwFCsaw9buMuxNd6+DQfAuSFqbNiQZpcgJQAgJsK6k= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190627182818-9947fec5c3ab h1:uOzhX2fm3C4BmBwW2a7lnJQD7qel2+4uhmTc8czKBCU= -golang.org/x/tools v0.0.0-20190627182818-9947fec5c3ab/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/vendor/github.com/skycoin/dmsg/ioutil/ack_waiter.go b/vendor/github.com/SkycoinProject/dmsg/ioutil/ack_waiter.go similarity index 100% rename from vendor/github.com/skycoin/dmsg/ioutil/ack_waiter.go rename to vendor/github.com/SkycoinProject/dmsg/ioutil/ack_waiter.go diff --git a/vendor/github.com/skycoin/dmsg/ioutil/atomic_bool.go b/vendor/github.com/SkycoinProject/dmsg/ioutil/atomic_bool.go similarity index 100% rename from vendor/github.com/skycoin/dmsg/ioutil/atomic_bool.go rename to vendor/github.com/SkycoinProject/dmsg/ioutil/atomic_bool.go diff --git a/vendor/github.com/skycoin/dmsg/ioutil/buf_read.go b/vendor/github.com/SkycoinProject/dmsg/ioutil/buf_read.go similarity index 100% rename from vendor/github.com/skycoin/dmsg/ioutil/buf_read.go rename to vendor/github.com/SkycoinProject/dmsg/ioutil/buf_read.go diff --git a/vendor/github.com/skycoin/dmsg/ioutil/logging.go b/vendor/github.com/SkycoinProject/dmsg/ioutil/logging.go similarity index 56% rename from vendor/github.com/skycoin/dmsg/ioutil/logging.go rename to vendor/github.com/SkycoinProject/dmsg/ioutil/logging.go index 71c97a40e..cc42d0d4e 100644 --- a/vendor/github.com/skycoin/dmsg/ioutil/logging.go +++ b/vendor/github.com/SkycoinProject/dmsg/ioutil/logging.go @@ -1,7 +1,7 @@ package ioutil import ( - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/skycoin/src/util/logging" ) var log = logging.MustGetLogger("ioutil") diff --git a/vendor/github.com/skycoin/dmsg/noise/dh.go b/vendor/github.com/SkycoinProject/dmsg/noise/dh.go similarity index 93% rename from vendor/github.com/skycoin/dmsg/noise/dh.go rename to vendor/github.com/SkycoinProject/dmsg/noise/dh.go index 6da7ab693..dfd9e49fc 100644 --- a/vendor/github.com/skycoin/dmsg/noise/dh.go +++ b/vendor/github.com/SkycoinProject/dmsg/noise/dh.go @@ -4,7 +4,7 @@ import ( "io" "github.com/flynn/noise" - "github.com/skycoin/skycoin/src/cipher" + "github.com/SkycoinProject/skycoin/src/cipher" ) // Secp256k1 implements `noise.DHFunc`. diff --git a/vendor/github.com/skycoin/dmsg/noise/net.go b/vendor/github.com/SkycoinProject/dmsg/noise/net.go similarity index 99% rename from vendor/github.com/skycoin/dmsg/noise/net.go rename to vendor/github.com/SkycoinProject/dmsg/noise/net.go index e065daff6..5759a77f8 100644 --- a/vendor/github.com/skycoin/dmsg/noise/net.go +++ b/vendor/github.com/SkycoinProject/dmsg/noise/net.go @@ -11,7 +11,7 @@ import ( "github.com/flynn/noise" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" ) var ( diff --git a/vendor/github.com/skycoin/dmsg/noise/noise.go b/vendor/github.com/SkycoinProject/dmsg/noise/noise.go similarity index 97% rename from vendor/github.com/skycoin/dmsg/noise/noise.go rename to vendor/github.com/SkycoinProject/dmsg/noise/noise.go index 3b36cdf79..3c0f0cf1b 100644 --- a/vendor/github.com/skycoin/dmsg/noise/noise.go +++ b/vendor/github.com/SkycoinProject/dmsg/noise/noise.go @@ -4,11 +4,11 @@ import ( "crypto/rand" "encoding/binary" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/flynn/noise" - "github.com/skycoin/dmsg/cipher" + "github.com/SkycoinProject/dmsg/cipher" ) var noiseLogger = logging.MustGetLogger("noise") // TODO: initialize properly or remove diff --git a/vendor/github.com/skycoin/dmsg/noise/read_writer.go b/vendor/github.com/SkycoinProject/dmsg/noise/read_writer.go similarity index 97% rename from vendor/github.com/skycoin/dmsg/noise/read_writer.go rename to vendor/github.com/SkycoinProject/dmsg/noise/read_writer.go index 0a17acf5a..355f1cfbe 100644 --- a/vendor/github.com/skycoin/dmsg/noise/read_writer.go +++ b/vendor/github.com/SkycoinProject/dmsg/noise/read_writer.go @@ -8,8 +8,8 @@ import ( "sync" "time" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/dmsg/ioutil" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/dmsg/ioutil" ) // ReadWriter implements noise encrypted read writer. diff --git a/vendor/github.com/skycoin/dmsg/server.go b/vendor/github.com/SkycoinProject/dmsg/server.go similarity index 96% rename from vendor/github.com/skycoin/dmsg/server.go rename to vendor/github.com/SkycoinProject/dmsg/server.go index ba0ee3dd3..0cf4cad1f 100644 --- a/vendor/github.com/skycoin/dmsg/server.go +++ b/vendor/github.com/SkycoinProject/dmsg/server.go @@ -9,11 +9,11 @@ import ( "sync/atomic" "time" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/skycoin/src/util/logging" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/dmsg/disc" - "github.com/skycoin/dmsg/noise" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/dmsg/disc" + "github.com/SkycoinProject/dmsg/noise" ) // ErrListenerAlreadyWrappedToNoise occurs when the provided net.Listener is already wrapped with noise.Listener @@ -143,7 +143,6 @@ func (c *ServerConn) Serve(ctx context.Context, getConn getConnFunc) (err error) log.WithError(err).Warn("Failed to close connection") } }() - log.WithField("connCount", incrementServeCount()).Infoln("ServingConn") err = c.writeOK() @@ -156,7 +155,7 @@ func (c *ServerConn) Serve(ctx context.Context, getConn getConnFunc) (err error) if err != nil { return fmt.Errorf("read failed: %s", err) } - log := log.WithField("received", f) + log = log.WithField("received", f) ft, id, p := f.Disassemble() @@ -201,7 +200,7 @@ func (c *ServerConn) Serve(ctx context.Context, getConn getConnFunc) (err error) func (c *ServerConn) delChan(id uint16, why byte) error { c.delNext(id) - if err := writeCloseFrame(c.Conn, id, why); err != nil { + if err := writeFrame(c.Conn, MakeFrame(CloseType, id, []byte{why})); err != nil { return fmt.Errorf("failed to write frame: %s", err) } return nil @@ -228,11 +227,11 @@ func (c *ServerConn) forwardFrame(ft FrameType, id uint16, p []byte) (*NextConn, // nolint:unparam func (c *ServerConn) handleRequest(ctx context.Context, getLink getConnFunc, id uint16, p []byte) (*NextConn, byte, bool) { - payload, err := unmarshalHandshakePayload(p) - if err != nil || payload.InitPK != c.PK() { + initPK, respPK, ok := splitPKs(p) + if !ok || initPK != c.PK() { return nil, 0, false } - respL, ok := getLink(payload.RespPK) + respL, ok := getLink(respPK) if !ok { return nil, 0, false } diff --git a/vendor/github.com/skycoin/dmsg/testing.go b/vendor/github.com/SkycoinProject/dmsg/testing.go similarity index 89% rename from vendor/github.com/skycoin/dmsg/testing.go rename to vendor/github.com/SkycoinProject/dmsg/testing.go index 49a181b75..ef9095b9f 100644 --- a/vendor/github.com/skycoin/dmsg/testing.go +++ b/vendor/github.com/SkycoinProject/dmsg/testing.go @@ -4,7 +4,6 @@ import ( "errors" "fmt" "io" - "net" "testing" "time" @@ -43,12 +42,10 @@ func checkConnCount(t *testing.T, delay time.Duration, count int, ccs ...connCou })) } -func checkTransportsClosed(t *testing.T, transports ...net.Conn) { - for _, tr := range transports { - if tr, ok := tr.(*Transport); ok && tr != nil { - assert.False(t, isDoneChanOpen(tr.done)) - assert.False(t, isReadChanOpen(tr.inCh)) - } +func checkTransportsClosed(t *testing.T, transports ...*Transport) { + for _, transport := range transports { + assert.False(t, isDoneChanOpen(transport.done)) + assert.False(t, isReadChanOpen(transport.inCh)) } } diff --git a/vendor/github.com/skycoin/dmsg/transport.go b/vendor/github.com/SkycoinProject/dmsg/transport.go similarity index 86% rename from vendor/github.com/skycoin/dmsg/transport.go rename to vendor/github.com/SkycoinProject/dmsg/transport.go index 2b1da95a7..613aa7cb9 100644 --- a/vendor/github.com/skycoin/dmsg/transport.go +++ b/vendor/github.com/SkycoinProject/dmsg/transport.go @@ -8,10 +8,10 @@ import ( "net" "sync" - "github.com/skycoin/skycoin/src/util/logging" + "github.com/SkycoinProject/skycoin/src/util/logging" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/dmsg/ioutil" + "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/dmsg/ioutil" ) // Errors related to REQUEST frames. @@ -19,18 +19,16 @@ var ( ErrRequestRejected = errors.New("failed to create transport: request rejected") ErrRequestCheckFailed = errors.New("failed to create transport: request check failed") ErrAcceptCheckFailed = errors.New("failed to create transport: accept check failed") - ErrPortNotListening = errors.New("failed to create transport: port not listening") ) -// Transport represents communication between two nodes via a single hop: -// a connection from dmsg.Client to remote dmsg.Client (via dmsg.Server intermediary). +// Transport represents a connection from dmsg.Client to remote dmsg.Client (via dmsg.Server intermediary). type Transport struct { net.Conn // underlying connection to dmsg.Server log *logging.Logger - id uint16 // tp ID that identifies this dmsg.transport - local Addr // local PK - remote Addr // remote PK + id uint16 // tp ID that identifies this dmsg.Transport + local cipher.PubKey // local PK + remote cipher.PubKey // remote PK inCh chan Frame // handles incoming frames (from dmsg.Client) inMx sync.Mutex // protects 'inCh' @@ -51,7 +49,7 @@ type Transport struct { } // NewTransport creates a new dms_tp. -func NewTransport(conn net.Conn, log *logging.Logger, local, remote Addr, id uint16, doneFunc func(id uint16)) *Transport { +func NewTransport(conn net.Conn, log *logging.Logger, local, remote cipher.PubKey, id uint16, doneFunc func(id uint16)) *Transport { tp := &Transport{ Conn: conn, log: log, @@ -115,7 +113,7 @@ func (tp *Transport) close() (closed bool) { // Close closes the dmsg_tp. func (tp *Transport) Close() error { if tp.close() { - if err := writeCloseFrame(tp.Conn, tp.id, PlaceholderReason); err != nil { + if err := writeFrame(tp.Conn, MakeFrame(CloseType, tp.id, []byte{0})); err != nil { log.WithError(err).Warn("Failed to write frame") } } @@ -134,20 +132,14 @@ func (tp *Transport) IsClosed() bool { // LocalPK returns the local public key of the transport. func (tp *Transport) LocalPK() cipher.PubKey { - return tp.local.PK + return tp.local } // RemotePK returns the remote public key of the transport. func (tp *Transport) RemotePK() cipher.PubKey { - return tp.remote.PK + return tp.remote } -// LocalAddr returns local address in from : -func (tp *Transport) LocalAddr() net.Addr { return tp.local } - -// RemoteAddr returns remote address in form : -func (tp *Transport) RemoteAddr() net.Addr { return tp.remote } - // Type returns the transport type. func (tp *Transport) Type() string { return Type @@ -170,18 +162,8 @@ func (tp *Transport) HandleFrame(f Frame) error { } // WriteRequest writes a REQUEST frame to dmsg_server to be forwarded to associated client. -func (tp *Transport) WriteRequest(port uint16) error { - payload := HandshakePayload{ - Version: HandshakePayloadVersion, - InitPK: tp.local.PK, - RespPK: tp.remote.PK, - Port: port, - } - payloadBytes, err := marshalHandshakePayload(payload) - if err != nil { - return err - } - f := MakeFrame(RequestType, tp.id, payloadBytes) +func (tp *Transport) WriteRequest() error { + f := MakeFrame(RequestType, tp.id, combinePKs(tp.local, tp.remote)) if err := writeFrame(tp.Conn, f); err != nil { tp.log.WithError(err).Error("HandshakeFailed") tp.close() @@ -200,7 +182,7 @@ func (tp *Transport) WriteAccept() (err error) { } }() - f := MakeFrame(AcceptType, tp.id, combinePKs(tp.remote.PK, tp.local.PK)) + f := MakeFrame(AcceptType, tp.id, combinePKs(tp.remote, tp.local)) if err = writeFrame(tp.Conn, f); err != nil { tp.close() return err @@ -243,7 +225,7 @@ func (tp *Transport) ReadAccept(ctx context.Context) (err error) { // - resp_pk should be of remote client. // - use an even number with the intermediary dmsg_server. initPK, respPK, ok := splitPKs(p) - if !ok || initPK != tp.local.PK || respPK != tp.remote.PK || !isInitiatorID(id) { + if !ok || initPK != tp.local || respPK != tp.remote || !isInitiatorID(id) { if err := tp.Close(); err != nil { log.WithError(err).Warn("Failed to close transport") } @@ -275,7 +257,7 @@ func (tp *Transport) Serve() { // also write CLOSE frame if this is the first time 'close' is triggered defer func() { if tp.close() { - if err := writeCloseFrame(tp.Conn, tp.id, PlaceholderReason); err != nil { + if err := writeCloseFrame(tp.Conn, tp.id, 0); err != nil { log.WithError(err).Warn("Failed to write close frame") } } diff --git a/vendor/github.com/skycoin/skycoin/src/cipher/address.go b/vendor/github.com/SkycoinProject/skycoin/src/cipher/address.go similarity index 100% rename from vendor/github.com/skycoin/skycoin/src/cipher/address.go rename to vendor/github.com/SkycoinProject/skycoin/src/cipher/address.go diff --git a/vendor/github.com/skycoin/skycoin/src/cipher/bitcoin.go b/vendor/github.com/SkycoinProject/skycoin/src/cipher/bitcoin.go similarity index 100% rename from vendor/github.com/skycoin/skycoin/src/cipher/bitcoin.go rename to vendor/github.com/SkycoinProject/skycoin/src/cipher/bitcoin.go diff --git a/vendor/github.com/skycoin/skycoin/src/cipher/crypto.go b/vendor/github.com/SkycoinProject/skycoin/src/cipher/crypto.go similarity index 100% rename from vendor/github.com/skycoin/skycoin/src/cipher/crypto.go rename to vendor/github.com/SkycoinProject/skycoin/src/cipher/crypto.go diff --git a/vendor/github.com/skycoin/skycoin/src/cipher/hash.go b/vendor/github.com/SkycoinProject/skycoin/src/cipher/hash.go similarity index 100% rename from vendor/github.com/skycoin/skycoin/src/cipher/hash.go rename to vendor/github.com/SkycoinProject/skycoin/src/cipher/hash.go diff --git a/vendor/github.com/skycoin/skycoin/src/util/logging/formatter.go b/vendor/github.com/SkycoinProject/skycoin/src/util/logging/formatter.go similarity index 100% rename from vendor/github.com/skycoin/skycoin/src/util/logging/formatter.go rename to vendor/github.com/SkycoinProject/skycoin/src/util/logging/formatter.go diff --git a/vendor/github.com/skycoin/skycoin/src/util/logging/hooks.go b/vendor/github.com/SkycoinProject/skycoin/src/util/logging/hooks.go similarity index 100% rename from vendor/github.com/skycoin/skycoin/src/util/logging/hooks.go rename to vendor/github.com/SkycoinProject/skycoin/src/util/logging/hooks.go diff --git a/vendor/github.com/skycoin/skycoin/src/util/logging/logger.go b/vendor/github.com/SkycoinProject/skycoin/src/util/logging/logger.go similarity index 100% rename from vendor/github.com/skycoin/skycoin/src/util/logging/logger.go rename to vendor/github.com/SkycoinProject/skycoin/src/util/logging/logger.go diff --git a/vendor/github.com/skycoin/skycoin/src/util/logging/logging.go b/vendor/github.com/SkycoinProject/skycoin/src/util/logging/logging.go similarity index 100% rename from vendor/github.com/skycoin/skycoin/src/util/logging/logging.go rename to vendor/github.com/SkycoinProject/skycoin/src/util/logging/logging.go diff --git a/vendor/github.com/alecthomas/units/go.mod b/vendor/github.com/alecthomas/units/go.mod index f57217327..c7fb91f2b 100644 --- a/vendor/github.com/alecthomas/units/go.mod +++ b/vendor/github.com/alecthomas/units/go.mod @@ -1 +1,3 @@ module github.com/alecthomas/units + +require github.com/stretchr/testify v1.4.0 diff --git a/vendor/github.com/alecthomas/units/go.sum b/vendor/github.com/alecthomas/units/go.sum new file mode 100644 index 000000000..8fdee5854 --- /dev/null +++ b/vendor/github.com/alecthomas/units/go.sum @@ -0,0 +1,11 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/skycoin/dmsg/addr.go b/vendor/github.com/skycoin/dmsg/addr.go deleted file mode 100644 index 2be739b40..000000000 --- a/vendor/github.com/skycoin/dmsg/addr.go +++ /dev/null @@ -1,26 +0,0 @@ -package dmsg - -import ( - "fmt" - - "github.com/skycoin/dmsg/cipher" -) - -// Addr implements net.Addr for skywire addresses. -type Addr struct { - PK cipher.PubKey - Port uint16 -} - -// Network returns "dmsg" -func (Addr) Network() string { - return Type -} - -// String returns public key and port of node split by colon. -func (a Addr) String() string { - if a.Port == 0 { - return fmt.Sprintf("%s:~", a.PK) - } - return fmt.Sprintf("%s:%d", a.PK, a.Port) -} diff --git a/vendor/github.com/skycoin/dmsg/client.go b/vendor/github.com/skycoin/dmsg/client.go deleted file mode 100644 index 587d03bcb..000000000 --- a/vendor/github.com/skycoin/dmsg/client.go +++ /dev/null @@ -1,317 +0,0 @@ -package dmsg - -import ( - "context" - "errors" - "fmt" - "net" - "sync" - "time" - - "github.com/skycoin/skycoin/src/util/logging" - - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/dmsg/disc" - "github.com/skycoin/dmsg/noise" -) - -var log = logging.MustGetLogger("dmsg") - -const ( - clientReconnectInterval = 3 * time.Second -) - -var ( - // ErrNoSrv indicate that remote client does not have DelegatedServers in entry. - ErrNoSrv = errors.New("remote has no DelegatedServers") - // ErrClientClosed indicates that client is closed and not accepting new connections. - ErrClientClosed = errors.New("client closed") - // ErrClientAcceptMaxed indicates that the client cannot take in more accepts. - ErrClientAcceptMaxed = errors.New("client accepts buffer maxed") -) - -// ClientOption represents an optional argument for Client. -type ClientOption func(c *Client) error - -// SetLogger sets the internal logger for Client. -func SetLogger(log *logging.Logger) ClientOption { - return func(c *Client) error { - if log == nil { - return errors.New("nil logger set") - } - c.log = log - return nil - } -} - -// Client implements transport.Factory -type Client struct { - log *logging.Logger - - pk cipher.PubKey - sk cipher.SecKey - dc disc.APIClient - - conns map[cipher.PubKey]*ClientConn // conns with messaging servers. Key: pk of server - mx sync.RWMutex - - pm *PortManager - - // accept map[uint16]chan *transport - done chan struct{} - once sync.Once -} - -// NewClient creates a new Client. -func NewClient(pk cipher.PubKey, sk cipher.SecKey, dc disc.APIClient, opts ...ClientOption) *Client { - c := &Client{ - log: logging.MustGetLogger("dmsg_client"), - pk: pk, - sk: sk, - dc: dc, - conns: make(map[cipher.PubKey]*ClientConn), - pm: newPortManager(), - // accept: make(chan *transport, AcceptBufferSize), - // accept: make(map[uint16]chan *transport), - done: make(chan struct{}), - } - for _, opt := range opts { - if err := opt(c); err != nil { - panic(err) - } - } - return c -} - -func (c *Client) updateDiscEntry(ctx context.Context) error { - srvPKs := make([]cipher.PubKey, 0, len(c.conns)) - for pk := range c.conns { - srvPKs = append(srvPKs, pk) - } - entry, err := c.dc.Entry(ctx, c.pk) - if err != nil { - entry = disc.NewClientEntry(c.pk, 0, srvPKs) - if err := entry.Sign(c.sk); err != nil { - return err - } - return c.dc.SetEntry(ctx, entry) - } - entry.Client.DelegatedServers = srvPKs - c.log.Infoln("updatingEntry:", entry) - return c.dc.UpdateEntry(ctx, c.sk, entry) -} - -func (c *Client) setConn(ctx context.Context, conn *ClientConn) { - c.mx.Lock() - c.conns[conn.remoteSrv] = conn - if err := c.updateDiscEntry(ctx); err != nil { - c.log.WithError(err).Warn("updateEntry: failed") - } - c.mx.Unlock() -} - -func (c *Client) delConn(ctx context.Context, pk cipher.PubKey) { - c.mx.Lock() - delete(c.conns, pk) - if err := c.updateDiscEntry(ctx); err != nil { - c.log.WithError(err).Warn("updateEntry: failed") - } - c.mx.Unlock() -} - -func (c *Client) getConn(pk cipher.PubKey) (*ClientConn, bool) { - c.mx.RLock() - l, ok := c.conns[pk] - c.mx.RUnlock() - return l, ok -} - -func (c *Client) connCount() int { - c.mx.RLock() - n := len(c.conns) - c.mx.RUnlock() - return n -} - -// InitiateServerConnections initiates connections with dms_servers. -func (c *Client) InitiateServerConnections(ctx context.Context, min int) error { - if min == 0 { - return nil - } - entries, err := c.findServerEntries(ctx) - if err != nil { - return err - } - c.log.Info("found dms_server entries:", entries) - if err := c.findOrConnectToServers(ctx, entries, min); err != nil { - return err - } - return nil -} - -func (c *Client) findServerEntries(ctx context.Context) ([]*disc.Entry, error) { - for { - entries, err := c.dc.AvailableServers(ctx) - if err != nil || len(entries) == 0 { - select { - case <-ctx.Done(): - return nil, fmt.Errorf("dms_servers are not available: %s", err) - default: - retry := time.Second - c.log.WithError(err).Warnf("no dms_servers found: trying again in %v...", retry) - time.Sleep(retry) - continue - } - } - return entries, nil - } -} - -func (c *Client) findOrConnectToServers(ctx context.Context, entries []*disc.Entry, min int) error { - for _, entry := range entries { - _, err := c.findOrConnectToServer(ctx, entry.Static) - if err != nil { - c.log.Warnf("findOrConnectToServers: failed to find/connect to server %s: %s", entry.Static, err) - continue - } - c.log.Infof("findOrConnectToServers: found/connected to server %s", entry.Static) - if c.connCount() >= min { - return nil - } - } - return fmt.Errorf("findOrConnectToServers: all servers failed") -} - -func (c *Client) findOrConnectToServer(ctx context.Context, srvPK cipher.PubKey) (*ClientConn, error) { - if conn, ok := c.getConn(srvPK); ok { - return conn, nil - } - - entry, err := c.dc.Entry(ctx, srvPK) - if err != nil { - return nil, err - } - if entry.Server == nil { - return nil, errors.New("entry is of client instead of server") - } - - tcpConn, err := net.Dial("tcp", entry.Server.Address) - if err != nil { - return nil, err - } - ns, err := noise.New(noise.HandshakeXK, noise.Config{ - LocalPK: c.pk, - LocalSK: c.sk, - RemotePK: srvPK, - Initiator: true, - }) - if err != nil { - return nil, err - } - nc, err := noise.WrapConn(tcpConn, ns, TransportHandshakeTimeout) - if err != nil { - return nil, err - } - - conn := NewClientConn(c.log, nc, c.pk, srvPK, c.pm) - if err := conn.readOK(); err != nil { - return nil, err - } - - c.setConn(ctx, conn) - - go func() { - err := conn.Serve(ctx) - conn.log.WithError(err).WithField("remoteServer", srvPK).Warn("connected with server closed") - c.delConn(ctx, srvPK) - - // reconnect logic. - retryServerConnect: - select { - case <-c.done: - case <-ctx.Done(): - case <-time.After(clientReconnectInterval): - conn.log.WithField("remoteServer", srvPK).Warn("Reconnecting") - if _, err := c.findOrConnectToServer(ctx, srvPK); err != nil { - conn.log.WithError(err).WithField("remoteServer", srvPK).Warn("ReconnectionFailed") - goto retryServerConnect - } - conn.log.WithField("remoteServer", srvPK).Warn("ReconnectionSucceeded") - } - }() - return conn, nil -} - -// Listen creates a listener on a given port, adds it to port manager and returns the listener. -func (c *Client) Listen(port uint16) (*Listener, error) { - l, ok := c.pm.NewListener(c.pk, port) - if !ok { - return nil, errors.New("port is busy") - } - return l, nil -} - -// Dial dials a transport to remote dms_client. -func (c *Client) Dial(ctx context.Context, remote cipher.PubKey, port uint16) (*Transport, error) { - entry, err := c.dc.Entry(ctx, remote) - if err != nil { - return nil, fmt.Errorf("get entry failure: %s", err) - } - if entry.Client == nil { - return nil, errors.New("entry is of server instead of client") - } - if len(entry.Client.DelegatedServers) == 0 { - return nil, ErrNoSrv - } - for _, srvPK := range entry.Client.DelegatedServers { - conn, err := c.findOrConnectToServer(ctx, srvPK) - if err != nil { - c.log.WithError(err).Warn("failed to connect to server") - continue - } - return conn.DialTransport(ctx, remote, port) - } - return nil, errors.New("failed to find dms_servers for given client pk") -} - -// Addr returns the local dms_client's public key. -func (c *Client) Addr() net.Addr { - return Addr{ - PK: c.pk, - } -} - -// Type returns the transport type. -func (c *Client) Type() string { - return Type -} - -// Close closes the dms_client and associated connections. -// TODO(evaninjin): proper error handling. -func (c *Client) Close() error { - if c == nil { - return nil - } - - c.once.Do(func() { - close(c.done) - - c.mx.Lock() - for _, conn := range c.conns { - if err := conn.Close(); err != nil { - log.WithError(err).Warn("Failed to close connection") - } - } - c.conns = make(map[cipher.PubKey]*ClientConn) - c.mx.Unlock() - - c.pm.mu.Lock() - defer c.pm.mu.Unlock() - - for _, lis := range c.pm.listeners { - lis.close() - } - }) - - return nil -} diff --git a/vendor/github.com/skycoin/dmsg/client_conn.go b/vendor/github.com/skycoin/dmsg/client_conn.go deleted file mode 100644 index 9ee1895af..000000000 --- a/vendor/github.com/skycoin/dmsg/client_conn.go +++ /dev/null @@ -1,301 +0,0 @@ -package dmsg - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "net" - "sync" - - "github.com/sirupsen/logrus" - "github.com/skycoin/skycoin/src/util/logging" - - "github.com/skycoin/dmsg/cipher" -) - -// ClientConn represents a connection between a dmsg.Client and dmsg.Server from a client's perspective. -type ClientConn struct { - log *logging.Logger - - net.Conn // conn to dmsg server - local cipher.PubKey // local client's pk - remoteSrv cipher.PubKey // dmsg server's public key - - // nextInitID keeps track of unused tp_ids to assign a future locally-initiated tp. - // locally-initiated tps use an even tp_id between local and intermediary dms_server. - nextInitID uint16 - - // Transports: map of transports to remote dms_clients (key: tp_id, val: transport). - tps map[uint16]*Transport - mx sync.RWMutex // to protect tps - - pm *PortManager - - done chan struct{} - once sync.Once - wg sync.WaitGroup -} - -// NewClientConn creates a new ClientConn. -func NewClientConn(log *logging.Logger, conn net.Conn, local, remote cipher.PubKey, pm *PortManager) *ClientConn { - cc := &ClientConn{ - log: log, - Conn: conn, - local: local, - remoteSrv: remote, - nextInitID: randID(true), - tps: make(map[uint16]*Transport), - pm: pm, - done: make(chan struct{}), - } - cc.wg.Add(1) - return cc -} - -// RemotePK returns the remote Server's PK that the ClientConn is connected to. -func (c *ClientConn) RemotePK() cipher.PubKey { return c.remoteSrv } - -func (c *ClientConn) getNextInitID(ctx context.Context) (uint16, error) { - for { - select { - case <-c.done: - return 0, ErrClientClosed - case <-ctx.Done(): - return 0, ctx.Err() - default: - if ch := c.tps[c.nextInitID]; ch != nil && !ch.IsClosed() { - c.nextInitID += 2 - continue - } - c.tps[c.nextInitID] = nil - id := c.nextInitID - c.nextInitID = id + 2 - return id, nil - } - } -} - -func (c *ClientConn) addTp(ctx context.Context, rPK cipher.PubKey, lPort, rPort uint16) (*Transport, error) { - c.mx.Lock() - defer c.mx.Unlock() - - id, err := c.getNextInitID(ctx) - if err != nil { - return nil, err - } - tp := NewTransport(c.Conn, c.log, Addr{c.local, lPort}, Addr{rPK, rPort}, id, c.delTp) - c.tps[id] = tp - return tp, nil -} - -func (c *ClientConn) setTp(tp *Transport) { - c.mx.Lock() - c.tps[tp.id] = tp - c.mx.Unlock() -} - -func (c *ClientConn) delTp(id uint16) { - c.mx.Lock() - c.tps[id] = nil - c.mx.Unlock() -} - -func (c *ClientConn) getTp(id uint16) (*Transport, bool) { - c.mx.RLock() - tp := c.tps[id] - c.mx.RUnlock() - ok := tp != nil && !tp.IsClosed() - return tp, ok -} - -func (c *ClientConn) setNextInitID(nextInitID uint16) { - c.mx.Lock() - c.nextInitID = nextInitID - c.mx.Unlock() -} - -func (c *ClientConn) readOK() error { - fr, err := readFrame(c.Conn) - if err != nil { - return errors.New("failed to get OK from server") - } - - ft, _, _ := fr.Disassemble() - if ft != OkType { - return fmt.Errorf("wrong frame from server: %v", ft) - } - - return nil -} - -func (c *ClientConn) handleRequestFrame(id uint16, p []byte) (cipher.PubKey, error) { - // remotely-initiated tps should: - // - have a payload structured as HandshakePayload marshaled to JSON. - // - resp_pk should be of local client. - // - use an odd tp_id with the intermediary dmsg_server. - payload, err := unmarshalHandshakePayload(p) - if err != nil { - // TODO(nkryuchkov): When implementing reasons, send that payload format is incorrect. - if err := writeCloseFrame(c.Conn, id, PlaceholderReason); err != nil { - return cipher.PubKey{}, err - } - return cipher.PubKey{}, ErrRequestCheckFailed - } - - if payload.RespPK != c.local || isInitiatorID(id) { - // TODO(nkryuchkov): When implementing reasons, send that payload is malformed. - if err := writeCloseFrame(c.Conn, id, PlaceholderReason); err != nil { - return payload.InitPK, err - } - return payload.InitPK, ErrRequestCheckFailed - } - - lis, ok := c.pm.Listener(payload.Port) - if !ok { - // TODO(nkryuchkov): When implementing reasons, send that port is not listening - if err := writeCloseFrame(c.Conn, id, PlaceholderReason); err != nil { - return payload.InitPK, err - } - return payload.InitPK, ErrPortNotListening - } - - tp := NewTransport(c.Conn, c.log, Addr{c.local, payload.Port}, Addr{payload.InitPK, 0}, id, c.delTp) // TODO: Have proper remote port. - - select { - case <-c.done: - if err := tp.Close(); err != nil { - log.WithError(err).Warn("Failed to close transport") - } - return payload.InitPK, ErrClientClosed - - default: - err := lis.IntroduceTransport(tp) - if err == nil || err == ErrClientAcceptMaxed { - c.setTp(tp) - } - return payload.InitPK, err - } -} - -// Serve handles incoming frames. -// Remote-initiated tps that are successfully created are pushing into 'accept' and exposed via 'Client.Accept()'. -func (c *ClientConn) Serve(ctx context.Context) (err error) { - log := c.log.WithField("remoteServer", c.remoteSrv) - log.WithField("connCount", incrementServeCount()).Infoln("ServingConn") - defer func() { - c.close() - log.WithError(err).WithField("connCount", decrementServeCount()).Infoln("ConnectionClosed") - c.wg.Done() - }() - - for { - f, err := readFrame(c.Conn) - if err != nil { - return fmt.Errorf("read failed: %s", err) - } - log = log.WithField("received", f) - - ft, id, p := f.Disassemble() - - // If tp of tp_id exists, attempt to forward frame to tp. - // delete tp on any failure. - - if tp, ok := c.getTp(id); ok { - if err := tp.HandleFrame(f); err != nil { - log.WithError(err).Warnf("Rejected [%s]: Transport closed.", ft) - } - continue - } - - // if tp does not exist, frame should be 'REQUEST'. - // otherwise, handle any unexpected frames accordingly. - - c.delTp(id) // rm tp in case closed tp is not fully removed. - - switch ft { - case RequestType: - c.wg.Add(1) - go func(log *logrus.Entry) { - defer c.wg.Done() - initPK, err := c.handleRequestFrame(id, p) - if err != nil { - log.WithField("remoteClient", initPK).WithError(err).Infoln("Rejected [REQUEST]") - if isWriteError(err) || err == ErrClientClosed { - err := c.Close() - log.WithError(err).Warn("ClosingConnection") - } - return - } - log.WithField("remoteClient", initPK).Infoln("Accepted [REQUEST]") - }(log) - - default: - log.Debugf("Ignored [%s]: No transport of given ID.", ft) - if ft != CloseType { - if err := writeCloseFrame(c.Conn, id, PlaceholderReason); err != nil { - return err - } - } - } - } -} - -// DialTransport dials a transport to remote dms_client. -func (c *ClientConn) DialTransport(ctx context.Context, clientPK cipher.PubKey, port uint16) (*Transport, error) { - tp, err := c.addTp(ctx, clientPK, 0, port) // TODO: Have proper local port. - if err != nil { - return nil, err - } - if err := tp.WriteRequest(port); err != nil { - return nil, err - } - if err := tp.ReadAccept(ctx); err != nil { - return nil, err - } - go tp.Serve() - return tp, nil -} - -func (c *ClientConn) close() (closed bool) { - if c == nil { - return false - } - c.once.Do(func() { - closed = true - c.log.WithField("remoteServer", c.remoteSrv).Infoln("ClosingConnection") - close(c.done) - c.mx.Lock() - for _, tp := range c.tps { - tp := tp - go func() { - if err := tp.Close(); err != nil { - log.WithError(err).Warn("Failed to close transport") - } - }() - } - if err := c.Conn.Close(); err != nil { - log.WithError(err).Warn("Failed to close connection") - } - c.mx.Unlock() - }) - return closed -} - -// Close closes the connection to dms_server. -func (c *ClientConn) Close() error { - if c.close() { - c.wg.Wait() - } - return nil -} - -func marshalHandshakePayload(p HandshakePayload) ([]byte, error) { - return json.Marshal(p) -} - -func unmarshalHandshakePayload(b []byte) (HandshakePayload, error) { - var p HandshakePayload - err := json.Unmarshal(b, &p) - return p, err -} diff --git a/vendor/github.com/skycoin/dmsg/listener.go b/vendor/github.com/skycoin/dmsg/listener.go deleted file mode 100644 index 2c685f8f1..000000000 --- a/vendor/github.com/skycoin/dmsg/listener.go +++ /dev/null @@ -1,123 +0,0 @@ -package dmsg - -import ( - "net" - "sync" - - "github.com/skycoin/dmsg/cipher" -) - -// Listener listens for remote-initiated transports. -type Listener struct { - pk cipher.PubKey - port uint16 - mx sync.Mutex // protects 'accept' - accept chan *Transport - done chan struct{} - once sync.Once -} - -func newListener(pk cipher.PubKey, port uint16) *Listener { - return &Listener{ - pk: pk, - port: port, - accept: make(chan *Transport, AcceptBufferSize), - done: make(chan struct{}), - } -} - -// Accept accepts a connection. -func (l *Listener) Accept() (net.Conn, error) { - return l.AcceptTransport() -} - -// Close closes the listener. -func (l *Listener) Close() error { - if l.close() { - return nil - } - return ErrClientClosed -} - -func (l *Listener) close() (closed bool) { - l.once.Do(func() { - closed = true - - l.mx.Lock() - defer l.mx.Unlock() - - close(l.done) - for { - select { - case <-l.accept: - default: - close(l.accept) - return - } - } - }) - return closed -} - -func (l *Listener) isClosed() bool { - select { - case <-l.done: - return true - default: - return false - } -} - -// Addr returns the listener's address. -func (l *Listener) Addr() net.Addr { - return Addr{ - PK: l.pk, - Port: l.port, - } -} - -// AcceptTransport accepts a transport connection. -func (l *Listener) AcceptTransport() (*Transport, error) { - select { - case <-l.done: - return nil, ErrClientClosed - case tp, ok := <-l.accept: - if !ok { - return nil, ErrClientClosed - } - return tp, nil - } -} - -// Type returns the transport type. -func (l *Listener) Type() string { - return Type -} - -// IntroduceTransport handles a transport after receiving a REQUEST frame. -func (l *Listener) IntroduceTransport(tp *Transport) error { - l.mx.Lock() - defer l.mx.Unlock() - - if l.isClosed() { - return ErrClientClosed - } - - select { - case <-l.done: - return ErrClientClosed - - case l.accept <- tp: - if err := tp.WriteAccept(); err != nil { - return err - } - go tp.Serve() - return nil - - default: - if err := tp.Close(); err != nil { - log.WithError(err).Warn("Failed to close transport") - } - return ErrClientAcceptMaxed - } -} diff --git a/vendor/github.com/skycoin/dmsg/port_manager.go b/vendor/github.com/skycoin/dmsg/port_manager.go deleted file mode 100644 index 63540c701..000000000 --- a/vendor/github.com/skycoin/dmsg/port_manager.go +++ /dev/null @@ -1,72 +0,0 @@ -package dmsg - -import ( - "math/rand" - "sync" - "time" - - "github.com/skycoin/dmsg/cipher" -) - -const ( - firstEphemeralPort = 49152 - lastEphemeralPort = 65535 -) - -// PortManager manages ports of nodes. -type PortManager struct { - mu sync.RWMutex - rand *rand.Rand - listeners map[uint16]*Listener -} - -func newPortManager() *PortManager { - return &PortManager{ - rand: rand.New(rand.NewSource(time.Now().UnixNano())), - listeners: make(map[uint16]*Listener), - } -} - -// Listener returns a listener assigned to a given port. -func (pm *PortManager) Listener(port uint16) (*Listener, bool) { - pm.mu.RLock() - defer pm.mu.RUnlock() - - l, ok := pm.listeners[port] - return l, ok -} - -// NewListener assigns listener to port if port is available. -func (pm *PortManager) NewListener(pk cipher.PubKey, port uint16) (*Listener, bool) { - pm.mu.Lock() - defer pm.mu.Unlock() - if _, ok := pm.listeners[port]; ok { - return nil, false - } - l := newListener(pk, port) - pm.listeners[port] = l - return l, true -} - -// RemoveListener removes listener assigned to port. -func (pm *PortManager) RemoveListener(port uint16) { - pm.mu.Lock() - defer pm.mu.Unlock() - - delete(pm.listeners, port) -} - -// NextEmptyEphemeralPort returns next random ephemeral port. -// It has a value between firstEphemeralPort and lastEphemeralPort. -func (pm *PortManager) NextEmptyEphemeralPort() uint16 { - for { - port := pm.randomEphemeralPort() - if _, ok := pm.Listener(port); !ok { - return port - } - } -} - -func (pm *PortManager) randomEphemeralPort() uint16 { - return uint16(firstEphemeralPort + pm.rand.Intn(lastEphemeralPort-firstEphemeralPort)) -} diff --git a/vendor/modules.txt b/vendor/modules.txt index ecea517de..d2f314634 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,7 +1,16 @@ +# github.com/SkycoinProject/dmsg v0.0.0-20190917230949-27f4fd2f25fb +github.com/SkycoinProject/dmsg/cipher +github.com/SkycoinProject/dmsg +github.com/SkycoinProject/dmsg/disc +github.com/SkycoinProject/dmsg/noise +github.com/SkycoinProject/dmsg/ioutil +# github.com/SkycoinProject/skycoin v0.26.0 +github.com/SkycoinProject/skycoin/src/util/logging +github.com/SkycoinProject/skycoin/src/cipher # github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 github.com/alecthomas/template github.com/alecthomas/template/parse -# github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4 +# github.com/alecthomas/units v0.0.0-20190910110746-680d30ca3117 github.com/alecthomas/units # github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 github.com/armon/go-socks5 @@ -62,15 +71,7 @@ github.com/prometheus/procfs/internal/fs # github.com/sirupsen/logrus v1.4.2 github.com/sirupsen/logrus github.com/sirupsen/logrus/hooks/syslog -# github.com/skycoin/dmsg v0.0.0-20190904181013-b781e3cbebc6 -github.com/skycoin/dmsg/cipher -github.com/skycoin/dmsg -github.com/skycoin/dmsg/disc -github.com/skycoin/dmsg/noise -github.com/skycoin/dmsg/ioutil # github.com/skycoin/skycoin v0.26.0 -github.com/skycoin/skycoin/src/util/logging -github.com/skycoin/skycoin/src/cipher github.com/skycoin/skycoin/src/cipher/base58 github.com/skycoin/skycoin/src/cipher/ripemd160 github.com/skycoin/skycoin/src/cipher/secp256k1-go