Skip to content

Commit

Permalink
feat: added devnet configs to deployment script
Browse files Browse the repository at this point in the history
  • Loading branch information
crnbarr93 committed Dec 2, 2024
1 parent 1f3b0d4 commit d571631
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 9 deletions.
40 changes: 40 additions & 0 deletions packages/deploy/src/chains/devnets.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
use cw_orch::{
environment::{ChainKind, NetworkInfo},
prelude::ChainInfo,
};

pub const OSMOSIS_DEVNET_NETWORK: NetworkInfo = NetworkInfo {
chain_name: "osmosis-devnet",
pub_address_prefix: "osmo",
coin_type: 118u32,
};

pub const OSMOSIS_DEVNET: ChainInfo = ChainInfo {
chain_id: "localosmosisa-1",
gas_denom: "uosmo",
fcd_url: None,
gas_price: 0.025,
grpc_urls: &["http://164.90.212.168:20321/"],
lcd_url: Some("http://164.90.212.168:20221/"),
network_info: OSMOSIS_DEVNET_NETWORK,
kind: ChainKind::Testnet,
};

pub const WASM_DEVNET_NETWORK: NetworkInfo = NetworkInfo {
chain_name: "wasm-devnet",
pub_address_prefix: "wasm",
coin_type: 118u32,
};

pub const WASM_DEVNET: ChainInfo = ChainInfo {
chain_id: "localwasma-1",
gas_denom: "ustake",
fcd_url: None,
gas_price: 0.025,
grpc_urls: &["http://164.90.212.168:20341/"],
lcd_url: Some("http://164.90.212.168:20241/"),
network_info: WASM_DEVNET_NETWORK,
kind: ChainKind::Testnet,
};

pub const DEVNET_CHAINS: &[ChainInfo] = &[OSMOSIS_DEVNET, WASM_DEVNET];
15 changes: 15 additions & 0 deletions packages/deploy/src/chains/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
pub mod devnets;
pub mod testnets;

use cw_orch::prelude::ChainInfo;
use devnets::DEVNET_CHAINS;
use testnets::TESTNET_CHAINS;

pub fn get_chain(chain: String) -> ChainInfo {
[TESTNET_CHAINS, DEVNET_CHAINS]
.concat()
.iter()
.find(|c| c.chain_id == chain || c.network_info.chain_name == chain)
.unwrap()
.clone()
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,4 @@ pub const STARGAZE_TESTNET: ChainInfo = ChainInfo {
kind: ChainKind::Testnet,
};

pub const ALL_CHAINS: &[ChainInfo] = &[ANDROMEDA_TESTNET, STARGAZE_TESTNET];

pub fn get_chain(chain: String) -> ChainInfo {
ALL_CHAINS
.iter()
.find(|c| c.chain_id == chain || c.network_info.chain_name == chain)
.unwrap()
.clone()
}
pub const TESTNET_CHAINS: &[ChainInfo] = &[ANDROMEDA_TESTNET, STARGAZE_TESTNET];

0 comments on commit d571631

Please sign in to comment.