-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from RTradeLtd/delegator
TEM-155: network routing scheme
- Loading branch information
Showing
50 changed files
with
2,312 additions
and
318 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# editors | ||
.vscode | ||
|
||
# dependencies | ||
vendor | ||
|
||
|
@@ -11,3 +14,4 @@ vendor | |
# test | ||
tmp | ||
test | ||
temp.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/RTradeLtd/Nexus/config" | ||
tcfg "github.com/RTradeLtd/config" | ||
"github.com/RTradeLtd/database" | ||
"github.com/RTradeLtd/database/models" | ||
) | ||
|
||
func initTestNetwork(configPath, networkName string) { | ||
// load configuration | ||
cfg, err := config.LoadConfig(configPath) | ||
if err != nil { | ||
fatal(err.Error()) | ||
} | ||
|
||
println("setting up database entry for a test network") | ||
|
||
dbm, err := database.Initialize(&tcfg.TemporalConfig{ | ||
Database: cfg.Database, | ||
}, database.Options{ | ||
SSLModeDisable: true, | ||
RunMigrations: true, | ||
}) | ||
if err != nil { | ||
fatal(err.Error()) | ||
} | ||
|
||
var nm = models.NewHostedIPFSNetworkManager(dbm.DB) | ||
if _, err := nm.CreateHostedPrivateNetwork(networkName, "", nil, models.NetworkAccessOptions{ | ||
Users: []string{"testuser"}, | ||
PublicGateway: true, | ||
}); err != nil { | ||
fatal(err.Error()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.