From 18e071e00a75e034cd02adc39d24d2f10fa0f267 Mon Sep 17 00:00:00 2001 From: Dylan Hunt Date: Thu, 11 Apr 2024 15:45:46 +0800 Subject: [PATCH 1/8] refactor!: Change DEFAULT_HOST_NICKNAME to "testnet" - from "local" - Suggested by Tyler --- crates/cli/src/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/cli/src/config.rs b/crates/cli/src/config.rs index b2fd38cce33..157d611ec6a 100644 --- a/crates/cli/src/config.rs +++ b/crates/cli/src/config.rs @@ -107,7 +107,7 @@ pub struct RawConfig { const DEFAULT_HOST: &str = "127.0.0.1:3000"; const DEFAULT_PROTOCOL: &str = "http"; -const DEFAULT_HOST_NICKNAME: &str = "local"; +const DEFAULT_HOST_NICKNAME: &str = "testnet"; #[derive(Clone)] pub struct Config { From 124ca39c1012acb31d6cb39b783c5c1e996b5c74 Mon Sep 17 00:00:00 2001 From: Dylan Hunt Date: Fri, 19 Apr 2024 16:56:53 +0800 Subject: [PATCH 2/8] refactor!: Change more const to default testnet srv --- crates/cli/src/config.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/cli/src/config.rs b/crates/cli/src/config.rs index 157d611ec6a..5e2380c1ca6 100644 --- a/crates/cli/src/config.rs +++ b/crates/cli/src/config.rs @@ -105,8 +105,8 @@ pub struct RawConfig { server_configs: Vec, } -const DEFAULT_HOST: &str = "127.0.0.1:3000"; -const DEFAULT_PROTOCOL: &str = "http"; +const DEFAULT_HOST: &str = "testnet.spacetimedb.com"; +const DEFAULT_PROTOCOL: &str = "https"; const DEFAULT_HOST_NICKNAME: &str = "testnet"; #[derive(Clone)] From e6491531af6ba25498ef5990e59f65a056d0ac7b Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Wed, 24 Apr 2024 12:36:12 -0700 Subject: [PATCH 3/8] [bfops/tests-use-explicit-server]: fix? --- crates/testing/src/sdk.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/testing/src/sdk.rs b/crates/testing/src/sdk.rs index ac4c6d9d1a4..54c0ad259a9 100644 --- a/crates/testing/src/sdk.rs +++ b/crates/testing/src/sdk.rs @@ -147,6 +147,8 @@ fn publish_module(wasm_file: &str) -> String { let name = random_module_name(); invoke_cli(&[ "publish", + "--server", + "local", "--debug", "--project-path", wasm_file, From c8afa146f499ee69fef6552bd706cc08d2dd99eb Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Wed, 24 Apr 2024 12:36:15 -0700 Subject: [PATCH 4/8] [bfops/tests-use-explicit-server]: empty From 152b764cbefe39911091b293ad7f3dea764e6b57 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Wed, 24 Apr 2024 13:10:13 -0700 Subject: [PATCH 5/8] [dylan/refactor/set-default-server-to-testnet]: fix? --- crates/cli/src/config.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/crates/cli/src/config.rs b/crates/cli/src/config.rs index 5e2380c1ca6..ebcc0be86b8 100644 --- a/crates/cli/src/config.rs +++ b/crates/cli/src/config.rs @@ -105,10 +105,6 @@ pub struct RawConfig { server_configs: Vec, } -const DEFAULT_HOST: &str = "testnet.spacetimedb.com"; -const DEFAULT_PROTOCOL: &str = "https"; -const DEFAULT_HOST_NICKNAME: &str = "testnet"; - #[derive(Clone)] pub struct Config { proj: RawConfig, @@ -141,14 +137,14 @@ fn hanging_default_server_context(server: &str) -> String { impl RawConfig { fn new_with_localhost() -> Self { RawConfig { - default_server: Some(DEFAULT_HOST_NICKNAME.to_string()), + default_server: Some("testnet".to_string()), identity_configs: Vec::new(), server_configs: vec![ ServerConfig { default_identity: None, - host: DEFAULT_HOST.to_string(), - protocol: DEFAULT_PROTOCOL.to_string(), - nickname: Some(DEFAULT_HOST_NICKNAME.to_string()), + host: "127.0.0.1:3000".to_string(), + protocol: "http".to_string(), + nickname: Some("local".to_string()), ecdsa_public_key: None, }, ServerConfig { From 878a6eb82707d1f8ef3d5091b0fb7228f2f18939 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Wed, 24 Apr 2024 13:19:26 -0700 Subject: [PATCH 6/8] [bfops/default-server-inline]: do thing --- crates/cli/src/config.rs | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/crates/cli/src/config.rs b/crates/cli/src/config.rs index b2fd38cce33..eebda3d9ac6 100644 --- a/crates/cli/src/config.rs +++ b/crates/cli/src/config.rs @@ -105,10 +105,6 @@ pub struct RawConfig { server_configs: Vec, } -const DEFAULT_HOST: &str = "127.0.0.1:3000"; -const DEFAULT_PROTOCOL: &str = "http"; -const DEFAULT_HOST_NICKNAME: &str = "local"; - #[derive(Clone)] pub struct Config { proj: RawConfig, @@ -140,25 +136,24 @@ fn hanging_default_server_context(server: &str) -> String { impl RawConfig { fn new_with_localhost() -> Self { + let local = ServerConfig { + default_identity: None, + host: "127.0.0.1:3000".to_string(), + protocol: "http".to_string(), + nickname: Some("local".to_string()), + ecdsa_public_key: None, + }; + let testnet = ServerConfig { + default_identity: None, + host: "testnet.spacetimedb.com".to_string(), + protocol: "https".to_string(), + nickname: Some("testnet".to_string()), + ecdsa_public_key: None, + }; RawConfig { - default_server: Some(DEFAULT_HOST_NICKNAME.to_string()), + default_server: testnet.nickname.clone(), identity_configs: Vec::new(), - server_configs: vec![ - ServerConfig { - default_identity: None, - host: DEFAULT_HOST.to_string(), - protocol: DEFAULT_PROTOCOL.to_string(), - nickname: Some(DEFAULT_HOST_NICKNAME.to_string()), - ecdsa_public_key: None, - }, - ServerConfig { - default_identity: None, - host: "testnet.spacetimedb.com".to_string(), - protocol: "https".to_string(), - nickname: Some("testnet".to_string()), - ecdsa_public_key: None, - }, - ], + server_configs: vec![local, testnet], } } From 49741df2a5ab2a3b26f6e4b195259525fb535e24 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Wed, 24 Apr 2024 13:20:36 -0700 Subject: [PATCH 7/8] [bfops/default-server-inline]: fix --- crates/cli/src/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/cli/src/config.rs b/crates/cli/src/config.rs index eebda3d9ac6..ca6eb840ca7 100644 --- a/crates/cli/src/config.rs +++ b/crates/cli/src/config.rs @@ -151,7 +151,7 @@ impl RawConfig { ecdsa_public_key: None, }; RawConfig { - default_server: testnet.nickname.clone(), + default_server: local.nickname.clone(), identity_configs: Vec::new(), server_configs: vec![local, testnet], } From f92238275c14fa15a04ce1cd04dec94cac50db4a Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Wed, 24 Apr 2024 13:31:33 -0700 Subject: [PATCH 8/8] [dylan/refactor/set-default-server-to-testnet]: fix --- crates/cli/src/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/cli/src/config.rs b/crates/cli/src/config.rs index 77681441941..eebda3d9ac6 100644 --- a/crates/cli/src/config.rs +++ b/crates/cli/src/config.rs @@ -151,7 +151,7 @@ impl RawConfig { ecdsa_public_key: None, }; RawConfig { - default_server: Some(testnet.nickname.clone()), + default_server: testnet.nickname.clone(), identity_configs: Vec::new(), server_configs: vec![local, testnet], }