Skip to content

Commit

Permalink
rename node to visor
Browse files Browse the repository at this point in the history
  • Loading branch information
Kifen committed Jan 30, 2020
1 parent e4236d6 commit e656d82
Show file tree
Hide file tree
Showing 56 changed files with 631 additions and 631 deletions.
30 changes: 15 additions & 15 deletions ci_scripts/run-pkg-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m
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/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/SkycoinProject/skywire-mainnet/pkg/hypervisor -run TestNewVisor >> ./logs/pkg/TestNewVisor.log

go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/node -run TestDmsgDiscovery >> ./logs/pkg/TestDmsgDiscovery.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/SkycoinProject/skywire-mainnet/pkg/visor -run TestDmsgDiscovery >> ./logs/pkg/TestDmsgDiscovery.log
go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/visor -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/visor -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/visor -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/visor -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/visor -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/visor -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/visor -run TestNewVisor >> ./logs/pkg/TestNewVisor.log
go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/visor -run TestVisorStartClose >> ./logs/pkg/TestVisorStartClose.log
go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/visor -run TestVisorSpawnApp >> ./logs/pkg/TestVisorSpawnApp.log
go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/visor -run TestVisorSpawnAppValidations >> ./logs/pkg/TestVisorSpawnAppValidations.log
go clean -testcache &> /dev/null || go test -race -tags no_ci -cover -timeout=5m github.com/SkycoinProject/skywire-mainnet/pkg/visor -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/visor -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/visor -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/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
Expand Down
4 changes: 2 additions & 2 deletions cmd/apps/helloworld/helloworld.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func main() {

log.Printf("Message from %s: %s\n", conn.RemoteAddr().String(), string(buf))
if _, err := conn.Write([]byte("pong")); err != nil {
log.Printf("Failed to write to a remote node: %v\n", err)
log.Printf("Failed to write to a remote visor: %v\n", err)
// TODO: close conn
}
}()
Expand All @@ -77,7 +77,7 @@ func main() {
}

if _, err := conn.Write([]byte("ping")); err != nil {
log.Fatalf("Failed to write to a remote node: %v\n", err)
log.Fatalf("Failed to write to a remote visor: %v\n", err)
}

buf := make([]byte, 4)
Expand Down
4 changes: 2 additions & 2 deletions cmd/apps/skychat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Chat only supports one WEB client user at a time.

## Local setup

Create 2 node config files:
Create 2 visor config files:

`skywire1.json`

Expand Down Expand Up @@ -41,7 +41,7 @@ Create 2 node config files:
}
```

Compile binaries and start 2 nodes:
Compile binaries and start 2 visors:

```bash
$ go build -o apps/skychat.v1.0 ./cmd/apps/skychat
Expand Down
2 changes: 1 addition & 1 deletion cmd/apps/skysocks-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

`skysocks-client` app implements client for the SOCKS5 app.

It opens persistent `skywire` connection to the configured remote node
It opens persistent `skywire` connection to the configured remote visor
and local TCP port, all incoming TCP traffics is forwarded to the
~skywire~ connection.

Expand Down
6 changes: 3 additions & 3 deletions cmd/apps/skysocks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ If none are provided, the server does not require authentication.

## Local setup

Create 2 node config files:
Create 2 visor config files:

- `skywire1.json`

Expand Down Expand Up @@ -44,7 +44,7 @@ Create 2 node config files:
}
```

Compile binaries and start 2 nodes:
Compile binaries and start 2 visors:

```sh
$ go build -o apps/skysocks.v1.0 ./cmd/apps/skysocks
Expand All @@ -53,7 +53,7 @@ $ ./skywire-visor skywire1.json
$ ./skywire-visor skywire2.json
```

You should be able to connect to a secondary node via `curl`:
You should be able to connect to a secondary visor via `curl`:

```sh
$ curl -v -x socks5://123456:@localhost:1080 https://api.ipify.org
Expand Down
2 changes: 1 addition & 1 deletion cmd/hypervisor/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Hypervisor

Hypervisor exposes node management operations via web API.
Hypervisor exposes visor management operations via web API.

**Generate config file:**

Expand Down
20 changes: 10 additions & 10 deletions cmd/hypervisor/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var (
configPath string
mock bool
mockEnableAuth bool
mockNodes int
mockVisors int
mockMaxTps int
mockMaxRoutes int
)
Expand All @@ -35,15 +35,15 @@ func init() {
rootCmd.Flags().StringVarP(&configPath, "config", "c", "./hypervisor-config.json", "hypervisor config path")
rootCmd.Flags().BoolVarP(&mock, "mock", "m", false, "whether to run hypervisor with mock data")
rootCmd.Flags().BoolVar(&mockEnableAuth, "mock-enable-auth", false, "whether to enable user management in mock mode")
rootCmd.Flags().IntVar(&mockNodes, "mock-nodes", 5, "number of app nodes to have in mock mode")
rootCmd.Flags().IntVar(&mockMaxTps, "mock-max-tps", 10, "max number of transports per mock app node")
rootCmd.Flags().IntVar(&mockMaxRoutes, "mock-max-routes", 30, "max number of routes per node")
rootCmd.Flags().IntVar(&mockVisors, "mock-visors", 5, "number of app visors to have in mock mode")
rootCmd.Flags().IntVar(&mockMaxTps, "mock-max-tps", 10, "max number of transports per mock app visor")
rootCmd.Flags().IntVar(&mockMaxRoutes, "mock-max-routes", 30, "max number of routes per visor")
}

// nolint:gochecknoglobals
var rootCmd = &cobra.Command{
Use: "hypervisor",
Short: "Manages Skywire App Nodes",
Short: "Manages Skywire App Visors",
Run: func(_ *cobra.Command, args []string) {
if _, err := buildinfo.Get().WriteTo(os.Stdout); err != nil {
log.Printf("Failed to output build info: %v", err)
Expand All @@ -66,7 +66,7 @@ var rootCmd = &cobra.Command{
rpcAddr = config.Interfaces.RPCAddr
)

m, err := hypervisor.NewNode(config)
m, err := hypervisor.NewVisor(config)
if err != nil {
log.Fatalln("Failed to start hypervisor:", err)
}
Expand All @@ -93,10 +93,10 @@ var rootCmd = &cobra.Command{

if mock {
err := m.AddMockData(hypervisor.MockConfig{
Nodes: mockNodes,
MaxTpsPerNode: mockMaxTps,
MaxRoutesPerNode: mockMaxRoutes,
EnableAuth: mockEnableAuth,
Visors: mockVisors,
MaxTpsPerVisor: mockMaxTps,
MaxRoutesPerVisor: mockMaxRoutes,
EnableAuth: mockEnableAuth,
})
if err != nil {
log.Fatalln("Failed to add mock data:", err)
Expand Down
Loading

0 comments on commit e656d82

Please sign in to comment.