Skip to content

Commit

Permalink
add support to qa network (#1736)
Browse files Browse the repository at this point in the history
* add support to qa network

* fix modes strings

* Restore key for prod network
  • Loading branch information
muhamadazmy authored Jun 9, 2022
1 parent 01db090 commit afa9306
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 13 deletions.
20 changes: 10 additions & 10 deletions bootstrap/bootstrap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ build = false
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
retry = "0.5.1"
shlex = "0.1.1"
anyhow = "1.0.38"
reqwest = "0.9.22"
serde = "1.0.102"
serde_json = "1.0.41"
retry = "0.5"
shlex = "0.1"
anyhow = "1.0"
reqwest = "0.9"
serde = "1.0"
serde_json = "1.0"
log = "0.4"
simple_logger = "1.3.0"
nix = "0.15.0"
simple_logger = "1.3"
nix = "0.15"
openssl-sys = "*"
walkdir = "2"
clap = "2.33.0"
exec = "0.3.1"
clap = "2.33"
exec = "0.3"

[features]
# Force openssl-sys to staticly link in the openssl library. Necessary when
Expand Down
5 changes: 5 additions & 0 deletions bootstrap/bootstrap/src/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ fn boostrap_zos(cfg: &config::Config) -> Result<()> {
Version::V2 => "zos:testing:latest.flist",
Version::V3 => "zos:testing-3:latest.flist",
},
RunMode::QA => match &cfg.version {
Version::V2 => bail!("qa not supported on v2"),
Version::V3 => "zos:qa-3:latest.flist",
},
};

debug!("using flist: {}/{}", FLIST_REPO, flist);
Expand Down Expand Up @@ -139,6 +143,7 @@ fn install_packages(cfg: &config::Config) -> Result<()> {
config::RunMode::Prod => name.into(),
config::RunMode::Dev => format!("{}.dev", name),
config::RunMode::Test => format!("{}.test", name),
config::RunMode::QA => format!("{}.qanet", name),
};

let client = hub::Repo::new(&repo);
Expand Down
2 changes: 2 additions & 0 deletions bootstrap/bootstrap/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pub enum RunMode {
Prod,
Test,
Dev,
QA,
}

#[derive(Debug)]
Expand All @@ -23,6 +24,7 @@ fn runmode() -> Result<RunMode> {
"prod" => RunMode::Prod,
"dev" => RunMode::Dev,
"test" => RunMode::Test,
"qa" => RunMode::QA,
m => {
bail!("unknown runmode: {}", m);
}
Expand Down
22 changes: 19 additions & 3 deletions pkg/environment/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ func (r RunningMode) String() string {
switch r {
case RunningDev:
return "development"
case RunningQA:
return "qa"
case RunningMain:
return "production"
case RunningTest:
Expand All @@ -52,10 +54,13 @@ func (r RunningMode) String() string {

// Possible running mode of a node
const (
//RunningDev RunningMode = "dev"
// RunningDev mode
RunningDev RunningMode = "dev"
//RunningTest RunningMode = "test"
// RunningQA mode
RunningQA RunningMode = "qa"
// RunningTest mode
RunningTest RunningMode = "test"
// RunningMain mode
RunningMain RunningMode = "prod"

// Orphanage is the default farmid where nodes are registered
Expand All @@ -81,7 +86,6 @@ var (

envTest = Environment{
RunningMode: RunningTest,
// TODO: this should become a different substrate ?
SubstrateURL: []string{
"wss://tfchain.test.grid.tf/",
},
Expand All @@ -90,6 +94,16 @@ var (
BinRepo: "tf-zos-v3-bins.test",
}

envQA = Environment{
RunningMode: RunningQA,
SubstrateURL: []string{
"wss://tfchain.qa.grid.tf/",
},
ActivationURL: "https://activation.qa.grid.tf/activation/activate",
FlistURL: "redis://hub.grid.tf:9900",
BinRepo: "tf-zos-v3-bins.qanet",
}

// same as testnet for now. will be updated the day of the launch of production network
envProd = Environment{
RunningMode: RunningMain,
Expand Down Expand Up @@ -154,6 +168,8 @@ func getEnvironmentFromParams(params kernel.Params) (Environment, error) {
switch RunningMode(runmode) {
case RunningDev:
env = envDev
case RunningQA:
env = envQA
case RunningTest:
env = envTest
case RunningMain:
Expand Down

0 comments on commit afa9306

Please sign in to comment.