From d5716316e56194864a7d851580a57547c94be605 Mon Sep 17 00:00:00 2001 From: Connor Barr Date: Mon, 2 Dec 2024 11:38:34 +0000 Subject: [PATCH] feat: added devnet configs to deployment script --- packages/deploy/src/chains/devnets.rs | 40 +++++++++++++++++++ packages/deploy/src/chains/mod.rs | 15 +++++++ .../src/{chains.rs => chains/testnets.rs} | 10 +---- 3 files changed, 56 insertions(+), 9 deletions(-) create mode 100644 packages/deploy/src/chains/devnets.rs create mode 100644 packages/deploy/src/chains/mod.rs rename packages/deploy/src/{chains.rs => chains/testnets.rs} (79%) diff --git a/packages/deploy/src/chains/devnets.rs b/packages/deploy/src/chains/devnets.rs new file mode 100644 index 000000000..ce378289a --- /dev/null +++ b/packages/deploy/src/chains/devnets.rs @@ -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]; diff --git a/packages/deploy/src/chains/mod.rs b/packages/deploy/src/chains/mod.rs new file mode 100644 index 000000000..69f26a28c --- /dev/null +++ b/packages/deploy/src/chains/mod.rs @@ -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() +} diff --git a/packages/deploy/src/chains.rs b/packages/deploy/src/chains/testnets.rs similarity index 79% rename from packages/deploy/src/chains.rs rename to packages/deploy/src/chains/testnets.rs index 528ac1cee..9cd5b3d99 100644 --- a/packages/deploy/src/chains.rs +++ b/packages/deploy/src/chains/testnets.rs @@ -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];