-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: env vars for explorer, branch based pull (#6)
* add: env vars for explorer, branch based pull
- Loading branch information
1 parent
3b23597
commit 2dd4694
Showing
10 changed files
with
62 additions
and
51 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,6 +1,38 @@ | ||
use bollard::models::{HostConfig, PortBinding}; | ||
use rand::distributions::Alphanumeric; | ||
use rand::Rng; | ||
|
||
use std::collections::HashMap; | ||
|
||
use crate::utils::docker::run_docker_image; | ||
|
||
pub fn explorer() { | ||
let env_vars = vec!["RPC_API_HOST=\"http://127.0.0.1:9944\""]; | ||
run_docker_image("ghcr.io/lambdaclass/stark_compass_explorer:v0.2.34.2", "madara-explorer", env_vars); | ||
let random_string: String = (0..64).map(|_| rand::thread_rng().sample(Alphanumeric).to_string()).collect(); | ||
let secret_key_base = format!("SECRET_KEY_BASE={}", random_string); | ||
|
||
let env = vec![ | ||
"RPC_API_HOST=http://host.docker.internal:9944", | ||
"DB_TYPE=sqlite", | ||
"DISABLE_MAINNET_SYNC=false", | ||
"DISABLE_TESTNET_SYNC=true", | ||
"TESTNET_RPC_API_HOST=http://host.docker.internal:9944", | ||
"DATABASE_PATH=/use/exp.db", | ||
"PHX_HOST=localhost", | ||
&secret_key_base, | ||
]; | ||
|
||
let mut port_bindings = HashMap::new(); | ||
port_bindings.insert( | ||
"4000/tcp".to_string(), | ||
Some(vec![PortBinding { host_ip: Some("0.0.0.0".to_string()), host_port: Some("4000".to_string()) }]), | ||
); | ||
|
||
let host_config = HostConfig { port_bindings: Some(port_bindings), ..Default::default() }; | ||
|
||
run_docker_image( | ||
"ghcr.io/lambdaclass/stark_compass_explorer:v0.2.34.2", | ||
"madara-explorer", | ||
Some(env), | ||
Some(host_config), | ||
); | ||
} |
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 |
---|---|---|
@@ -1,6 +1,10 @@ | ||
pub const MADARA_REPO_ORG: &str = "keep-starknet-strange"; | ||
pub const MADARA_REPO_NAME: &str = "madara"; | ||
|
||
pub const KARNOT_REPO_ORG: &str = "karnotxyz"; | ||
|
||
pub const BRANCH_NAME: &str = "custom_events_page"; | ||
|
||
pub const APP_CONFIG_NAME: &str = "config.toml"; | ||
pub const APP_DA_CONFIG_NAME: &str = "da-config.json"; | ||
pub const APP_SECRET_PHRASE: &str = "secret-phrase.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