Skip to content

Commit

Permalink
Remove BoltDB routing table
Browse files Browse the repository at this point in the history
  • Loading branch information
nkryuchkov committed Sep 10, 2019
1 parent 48280c4 commit b249fa6
Show file tree
Hide file tree
Showing 14 changed files with 9 additions and 255 deletions.
4 changes: 0 additions & 4 deletions cmd/skywire-cli/commands/node/gen-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,13 @@ func homeConfig() *visor.Config {
c := defaultConfig()
c.AppsPath = filepath.Join(pathutil.HomeDir(), ".skycoin/skywire/apps")
c.Transport.LogStore.Location = filepath.Join(pathutil.HomeDir(), ".skycoin/skywire/transport_logs")
c.Routing.Table.Location = filepath.Join(pathutil.HomeDir(), ".skycoin/skywire/routing.db")
return c
}

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"
return c
}

Expand Down Expand Up @@ -105,8 +103,6 @@ func defaultConfig() *visor.Config {
log.WithError(err).Warnf("Failed to unmarshal default setup node public key %s", defaultSetupNodePK)
}
conf.Routing.SetupNodes = []cipher.PubKey{sPK}
conf.Routing.Table.Type = "boltdb"
conf.Routing.Table.Location = "./skywire/routing.db"
conf.Routing.RouteFinderTimeout = visor.Duration(10 * time.Second)

conf.Hypervisors = []visor.HypervisorConfig{}
Expand Down
6 changes: 1 addition & 5 deletions integration/generic/nodeA.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@
"setup_nodes": [
"0324579f003e6b4048bae2def4365e634d8e0e3054a20fc7af49daf2a179658557"
],
"route_finder": "https://routefinder.skywire.skycoin.net/",
"table": {
"type": "boltdb",
"location": "./local/nodeA/routing.db"
}
"route_finder": "https://routefinder.skywire.skycoin.net/"
},
"apps": [
{
Expand Down
6 changes: 1 addition & 5 deletions integration/generic/nodeC.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@
"setup_nodes": [
"0324579f003e6b4048bae2def4365e634d8e0e3054a20fc7af49daf2a179658557"
],
"route_finder": "https://routefinder.skywire.skycoin.net/",
"table": {
"type": "boltdb",
"location": "./local/nodeC/routing.db"
}
"route_finder": "https://routefinder.skywire.skycoin.net/"
},
"apps": [
{
Expand Down
6 changes: 1 addition & 5 deletions integration/intermediary-nodeB.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@
"0324579f003e6b4048bae2def4365e634d8e0e3054a20fc7af49daf2a179658557"
],
"route_finder": "https://routefinder.skywire.skycoin.net/",
"route_finder_timeout": "60s",
"table": {
"type": "boltdb",
"location": "./local/nodeB/routing.db"
}
"route_finder_timeout": "60s"
},
"apps": [],
"trusted_nodes": [],
Expand Down
6 changes: 1 addition & 5 deletions integration/messaging/nodeA.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@
"0324579f003e6b4048bae2def4365e634d8e0e3054a20fc7af49daf2a179658557"
],
"route_finder": "https://routefinder.skywire.skycoin.net/",
"route_finder_timeout": "60s",
"table": {
"type": "boltdb",
"location": "./local/nodeA/routing.db"
}
"route_finder_timeout": "60s"
},
"apps": [
{
Expand Down
6 changes: 1 addition & 5 deletions integration/messaging/nodeC.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@
"0324579f003e6b4048bae2def4365e634d8e0e3054a20fc7af49daf2a179658557"
],
"route_finder": "https://routefinder.skywire.skycoin.net/",
"route_finder_timeout": "60s",
"table": {
"type": "boltdb",
"location": "./local/nodeC/routing.db"
}
"route_finder_timeout": "60s"
},
"apps": [
{
Expand Down
6 changes: 1 addition & 5 deletions integration/proxy/nodeA.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@
"setup_nodes": [
"0324579f003e6b4048bae2def4365e634d8e0e3054a20fc7af49daf2a179658557"
],
"route_finder": "https://routefinder.skywire.skycoin.net/",
"table": {
"type": "boltdb",
"location": "./local/nodeA/routing.db"
}
"route_finder": "https://routefinder.skywire.skycoin.net/"
},
"apps": [
{
Expand Down
6 changes: 1 addition & 5 deletions integration/proxy/nodeC.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@
"setup_nodes": [
"0324579f003e6b4048bae2def4365e634d8e0e3054a20fc7af49daf2a179658557"
],
"route_finder": "https://routefinder.skywire.skycoin.net/",
"table": {
"type": "boltdb",
"location": "./local/nodeC/routing.db"
}
"route_finder": "https://routefinder.skywire.skycoin.net/"
},
"apps": [
{
Expand Down
6 changes: 1 addition & 5 deletions integration/ssh/nodeA.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@
"setup_nodes": [
"0324579f003e6b4048bae2def4365e634d8e0e3054a20fc7af49daf2a179658557"
],
"route_finder": "https://routefinder.skywire.skycoin.net/",
"table": {
"type": "boltdb",
"location": "./local/nodeA/routing.db"
}
"route_finder": "https://routefinder.skywire.skycoin.net/"
},
"apps": [
{
Expand Down
6 changes: 1 addition & 5 deletions integration/ssh/nodeC.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@
"setup_nodes": [
"0324579f003e6b4048bae2def4365e634d8e0e3054a20fc7af49daf2a179658557"
],
"route_finder": "https://routefinder.skywire.skycoin.net/",
"table": {
"type": "boltdb",
"location": "./local/nodeC/routing.db"
}
"route_finder": "https://routefinder.skywire.skycoin.net/"
},
"apps": [
{
Expand Down
165 changes: 0 additions & 165 deletions pkg/routing/boltdb_routing_table.go

This file was deleted.

26 changes: 0 additions & 26 deletions pkg/routing/boltdb_routing_table_test.go

This file was deleted.

8 changes: 0 additions & 8 deletions pkg/visor/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ type Config struct {
SetupNodes []cipher.PubKey `json:"setup_nodes"`
RouteFinder string `json:"route_finder"`
RouteFinderTimeout Duration `json:"route_finder_timeout"`
Table struct {
Type string `json:"type"`
Location string `json:"location"`
} `json:"table"`
} `json:"routing"`

Uptime struct {
Expand Down Expand Up @@ -108,10 +104,6 @@ func (c *Config) TransportLogStore() (transport.LogStore, error) {

// RoutingTable returns configure routing.Table.
func (c *Config) RoutingTable() (routing.Table, error) {
if c.Routing.Table.Type == "boltdb" {
return routing.BoltDBRoutingTable(c.Routing.Table.Location)
}

return routing.InMemoryRoutingTable(), nil
}

Expand Down
7 changes: 0 additions & 7 deletions pkg/visor/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,6 @@ func TestRoutingTable(t *testing.T) {
}()

conf := Config{}
conf.Routing.Table.Type = "boltdb"
conf.Routing.Table.Location = tmpfile.Name()
_, err = conf.RoutingTable()
require.NoError(t, err)

conf.Routing.Table.Type = "memory"
conf.Routing.Table.Location = ""
_, err = conf.RoutingTable()
require.NoError(t, err)
}
Expand Down

0 comments on commit b249fa6

Please sign in to comment.