diff --git a/docs/src/concepts/channels.md b/docs/src/concepts/channels.md index d5357f64..8cb24fc5 100644 --- a/docs/src/concepts/channels.md +++ b/docs/src/concepts/channels.md @@ -2,16 +2,14 @@ -`fuelup` adopts a simplified version of `rustup` [channels](https://rust-lang.github.io/rustup/concepts/channels.html). Currently, the `latest`, `nightly`, `testnet`, and `beta` channels are published and serve as a source of distribution of Fuel toolchain binaries. +`fuelup` adopts a simplified version of `rustup` [channels](https://rust-lang.github.io/rustup/concepts/channels.html). Currently, the `latest`, `nightly`, `testnet`, and `mainnet` channels are published and serve as a source of distribution of Fuel toolchain binaries. | Channel | Source | Integration Tested | Update Frequency | Available | | ------------- | --------------- | -------------------- | ------------------------ | --------- | | **[latest]** | published bins | ✔️ | only when necessary | ✔️ | | **[nightly]** | `master` branch | ➖ | nightly (1:00 AM UTC) | ✔️ | -| **[testnet]** | published bins | ➖ | only when necessary | ✔️ | -| **[beta-5]** | published bins | ➖ | only when necessary | ✔️ | -| **[beta-4]** | published bins | ➖ | only when necessary | ✔️ | -| **[beta-3]** | published bins | ➖ | only when necessary | ✔️ | +| **[mainnet]** | published bins | ➖ | only when necessary | ✔️ | +| **[testnet]** | published bins | ➖ | only when necessary | ✔️ | ## The `latest` channel @@ -39,21 +37,13 @@ You should use `nightly` if you want the latest changes to `master` that have no Keep in mind that compatibility between `forc` and `fuel-core` is not guaranteed here, and you should expect unstable features to break. -## The `testnet` channel - -The `testnet` channel is a published TOML file describing the toolchain that is compatible with our final public [testnet](https://fuel.mirror.xyz/fztu8P_NJz6k7qLXhaGHX3ArctlQpxsUp87pgRpJ4bE) on the Sepolia network. This toolchain should be used to interact with and build on the testnet. The components to be installed can be found [here](https://github.com/FuelLabs/fuelup/blob/gh-pages/channel-fuel-testnet.toml). - -## The `beta-5` channel +## The `mainnet` channel -The `beta-5` channel is a published TOML file describing the toolchain that is compatible with our [beta-5 testnet](https://fuel.mirror.xyz/5JCTjM3jSG84QYLKqQ4idHf6X_zVtwTInQvg7kWhaMA). The components to be installed can be found [here](https://github.com/FuelLabs/fuelup/blob/gh-pages/channel-fuel-beta-5.toml). +The `mainnet` channel is a published TOML file describing the toolchain that is compatible with our final public [mainnet](https://fuel.mirror.xyz/U2xqey0oZFCrIBf7bO3yYyFplJKiJ0sfzAyYmhrPjag) on the Ignition network. This toolchain should be used to interact with and build on the mainnet. The components to be installed can be found [here](https://github.com/FuelLabs/fuelup/blob/gh-pages/channel-fuel-mainnet.toml). -## The `beta-4` channel - -The `beta-4` channel is a published TOML file describing the toolchain that is compatible with our [beta-4 testnet](https://fuel-labs.ghost.io/announcing-beta-4-testnet/). The components to be installed can be found [here](https://github.com/FuelLabs/fuelup/blob/gh-pages/channel-fuel-beta-4.toml). - -## The `beta-3` channel +## The `testnet` channel -The `beta-3` channel is a published TOML file describing the toolchain that is compatible with our [beta-3 testnet](https://fuel-labs.ghost.io/announcing-beta-3-testnet/). The components to be installed can be found [here](https://github.com/FuelLabs/fuelup/blob/gh-pages/channel-fuel-beta-3.toml). +The `testnet` channel is a published TOML file describing the toolchain that is compatible with our final public [testnet](https://fuel.mirror.xyz/fztu8P_NJz6k7qLXhaGHX3ArctlQpxsUp87pgRpJ4bE) on the Sepolia network. This toolchain should be used to interact with and build on the testnet. The components to be installed can be found [here](https://github.com/FuelLabs/fuelup/blob/gh-pages/channel-fuel-testnet.toml). ## Developer Guide @@ -93,6 +83,3 @@ You may also use [`nektos/act`](https://github.com/nektos/act) to run the workfl [latest]: #the-latest-channel [nightly]: #the-nightly-channel [testnet]: #the-testnet-channel -[beta-5]: #the-beta-5-channel -[beta-4]: #the-beta-4-channel -[beta-3]: #the-beta-3-channel diff --git a/docs/src/developer_guide/building_a_channel.md b/docs/src/developer_guide/building_a_channel.md index 76504283..ed325861 100644 --- a/docs/src/developer_guide/building_a_channel.md +++ b/docs/src/developer_guide/building_a_channel.md @@ -32,14 +32,14 @@ There may be times when we need a channel for a one-off event e.g. testnets. Dur require a routine update, and can essentially publish once and be done. This is when manual publishing is done. -For example, building a `beta-3` toolchain is done like so: +For example, building a `testnet` toolchain is done like so: ```sh # from fuelup project root -cd ci/build-channel && cargo run -- channel-fuel-beta-3.toml 2023-02-13 forc=0.35.0 fuel-core=0.17.1 +cd ci/build-channel && cargo run -- channel-fuel-testnet.toml 2023-02-13 forc=0.35.0 fuel-core=0.17.1 ``` -The above command means that we're building a channel named `channel-fuel-beta-3.toml` with the date `2023-02-13` (`YYYY-MM-DD`) +The above command means that we're building a channel named `channel-fuel-testnet.toml` with the date `2023-02-13` (`YYYY-MM-DD`) and `forc` and `fuel-core` versions `0.35.0` and `0.17.1` respectively, and the latest versions for the other unlisted components. Other than for these one-off events, manually running `build-channel` locally is a good sanity check when working diff --git a/docs/src/overrides.md b/docs/src/overrides.md index 93f8fe2e..a9586a06 100644 --- a/docs/src/overrides.md +++ b/docs/src/overrides.md @@ -38,23 +38,23 @@ $ tree -L 1 # 'tree -L 1' shows the project structure up to the depth of 1 ### Examples -An application using the [`beta-3`] toolchain: +An application using the [`testnet`] toolchain: ```toml [toolchain] -channel = "beta-3" +channel = "testnet" ``` -Let's say we have a project on the `beta-3` testnet, and we want to try using a different version forc to develop on it: +Let's say we have a project on the Fuel testnet network, and we want to try using a different version forc to develop on it: ```toml [toolchain] -channel = "beta-3" +channel = "testnet" [components] -forc = "0.36.0" # in beta-3, forc is pinned to v0.37.3 +forc = "0.65.0" # in testnet, forc is pinned to v0.66.1 ``` [toolchain]: concepts/toolchains.md [distributed toolchains]: concepts/toolchains.md#toolchains -[`beta-3`]: concepts/channels.md#the-beta-3-channel +[`testnet`]: concepts/channels.md#the-testnet-channel diff --git a/src/channel.rs b/src/channel.rs index a0cfe7ba..080fd4f8 100644 --- a/src/channel.rs +++ b/src/channel.rs @@ -1,9 +1,7 @@ use crate::{ constants::{ - CHANNEL_BETA_1_FILE_NAME, CHANNEL_BETA_2_FILE_NAME, CHANNEL_BETA_3_FILE_NAME, - CHANNEL_BETA_4_FILE_NAME, CHANNEL_BETA_5_FILE_NAME, CHANNEL_DEVNET_FILE_NAME, - CHANNEL_LATEST_FILE_NAME, CHANNEL_NIGHTLY_FILE_NAME, CHANNEL_TESTNET_FILE_NAME, - DATE_FORMAT_URL_FRIENDLY, FUELUP_GH_PAGES, + CHANNEL_LATEST_FILE_NAME, CHANNEL_MAINNET_FILE_NAME, CHANNEL_NIGHTLY_FILE_NAME, + CHANNEL_TESTNET_FILE_NAME, DATE_FORMAT_URL_FRIENDLY, FUELUP_GH_PAGES, }, download::{download, DownloadCfg}, toolchain::{DistToolchainDescription, DistToolchainName}, @@ -19,18 +17,12 @@ use tracing::warn; pub const LATEST: &str = "latest"; pub const STABLE: &str = "stable"; -pub const BETA_1: &str = "beta-1"; -pub const BETA_2: &str = "beta-2"; -pub const BETA_3: &str = "beta-3"; -pub const BETA_4: &str = "beta-4"; -pub const BETA_5: &str = "beta-5"; -pub const DEVNET: &str = "devnet"; +pub const IGNITION: &str = "ignition"; pub const TESTNET: &str = "testnet"; +pub const MAINNET: &str = "mainnet"; pub const NIGHTLY: &str = "nightly"; -pub const CHANNELS: [&str; 9] = [ - LATEST, NIGHTLY, BETA_1, BETA_2, BETA_3, BETA_4, BETA_5, DEVNET, TESTNET, -]; +pub const CHANNELS: [&str; 4] = [LATEST, NIGHTLY, TESTNET, MAINNET]; #[derive(Debug, Deserialize, Serialize)] pub struct HashedBinary { @@ -50,14 +42,8 @@ pub struct Package { pub fuels_version: Option, } -pub fn is_beta_toolchain(name: &str) -> bool { - name == BETA_1 - || name == BETA_2 - || name == BETA_3 - || name == BETA_4 - || name == BETA_5 - || name == DEVNET - || name == TESTNET +pub fn is_dateless_distributed_toolchain(name: &str) -> bool { + name == TESTNET || name == MAINNET } fn format_nightly_url(date: &Date) -> Result { @@ -85,13 +71,8 @@ fn construct_channel_url(desc: &DistToolchainDescription) -> Result { } url.push_str(CHANNEL_NIGHTLY_FILE_NAME); } - DistToolchainName::Beta1 => url.push_str(CHANNEL_BETA_1_FILE_NAME), - DistToolchainName::Beta2 => url.push_str(CHANNEL_BETA_2_FILE_NAME), - DistToolchainName::Beta3 => url.push_str(CHANNEL_BETA_3_FILE_NAME), - DistToolchainName::Beta4 => url.push_str(CHANNEL_BETA_4_FILE_NAME), - DistToolchainName::Beta5 => url.push_str(CHANNEL_BETA_5_FILE_NAME), - DistToolchainName::Devnet => url.push_str(CHANNEL_DEVNET_FILE_NAME), DistToolchainName::Testnet => url.push_str(CHANNEL_TESTNET_FILE_NAME), + DistToolchainName::Mainnet => url.push_str(CHANNEL_MAINNET_FILE_NAME), }; Ok(url) diff --git a/src/commands/toolchain.rs b/src/commands/toolchain.rs index 035fad7e..f4f1c934 100644 --- a/src/commands/toolchain.rs +++ b/src/commands/toolchain.rs @@ -16,7 +16,7 @@ pub enum ToolchainCommand { #[derive(Debug, Parser)] pub struct InstallCommand { - /// Toolchain name [possible values: latest, nightly, testnet, beta-1, beta-2, beta-3, beta-4, beta-5] + /// Toolchain name [possible values: latest, nightly, testnet, mainnet] pub name: String, } diff --git a/src/constants.rs b/src/constants.rs index bff4e86c..76e020a6 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -6,15 +6,10 @@ pub const FUELS_VERSION_FILE: &str = "fuels_version"; pub const CHANNEL_LATEST_URL: &str = "https://raw.githubusercontent.com/FuelLabs/fuelup/gh-pages/channel-fuel-testnet.toml"; -pub const CHANNEL_LATEST_FILE_NAME: &str = "channel-fuel-testnet.toml"; pub const CHANNEL_NIGHTLY_FILE_NAME: &str = "channel-fuel-nightly.toml"; -pub const CHANNEL_BETA_1_FILE_NAME: &str = "channel-fuel-beta-1.toml"; -pub const CHANNEL_BETA_2_FILE_NAME: &str = "channel-fuel-beta-2.toml"; -pub const CHANNEL_BETA_3_FILE_NAME: &str = "channel-fuel-beta-3.toml"; -pub const CHANNEL_BETA_4_FILE_NAME: &str = "channel-fuel-beta-4.toml"; -pub const CHANNEL_BETA_5_FILE_NAME: &str = "channel-fuel-beta-5.toml"; -pub const CHANNEL_DEVNET_FILE_NAME: &str = "channel-fuel-devnet.toml"; pub const CHANNEL_TESTNET_FILE_NAME: &str = "channel-fuel-testnet.toml"; +pub const CHANNEL_MAINNET_FILE_NAME: &str = "channel-fuel-mainnet.toml"; +pub const CHANNEL_LATEST_FILE_NAME: &str = CHANNEL_MAINNET_FILE_NAME; pub const DATE_FORMAT: &[FormatItem] = format_description!("[year]-[month]-[day]"); pub const DATE_FORMAT_URL_FRIENDLY: &[FormatItem] = format_description!("[year]/[month]/[day]"); diff --git a/src/download.rs b/src/download.rs index 4d562311..58b7b9de 100644 --- a/src/download.rs +++ b/src/download.rs @@ -562,7 +562,7 @@ mod tests { fn test_agent() -> anyhow::Result<()> { // this test case is used to illustrate the bug of ureq that sometimes doesn't return "Content-Length" header let handle = build_agent()?; - let response = handle.get("https://raw.githubusercontent.com/FuelLabs/fuelup/gh-pages/channel-fuel-beta-4.toml").call()?; + let response = handle.get("https://raw.githubusercontent.com/FuelLabs/fuelup/gh-pages/channel-fuel-testnet.toml").call()?; assert!(response.header("Content-Length").is_none()); Ok(()) } diff --git a/src/toolchain.rs b/src/toolchain.rs index 30cc4767..bfe1563d 100644 --- a/src/toolchain.rs +++ b/src/toolchain.rs @@ -26,28 +26,19 @@ use tracing::{error, info}; pub const RESERVED_TOOLCHAIN_NAMES: &[&str] = &[ channel::LATEST, - channel::BETA_1, - channel::BETA_2, - channel::BETA_3, - channel::BETA_4, - channel::BETA_5, channel::NIGHTLY, - channel::DEVNET, // Stable is reserved, although currently unused. channel::STABLE, + // Ignition is reserved, although currently unused. + channel::IGNITION, ]; #[derive(Debug, Eq, PartialEq)] pub enum DistToolchainName { - Beta1, - Beta2, - Beta3, - Beta4, - Beta5, Latest, Nightly, - Devnet, Testnet, + Mainnet, } impl fmt::Display for DistToolchainName { @@ -55,13 +46,8 @@ impl fmt::Display for DistToolchainName { match self { DistToolchainName::Latest => write!(f, "{}", channel::LATEST), DistToolchainName::Nightly => write!(f, "{}", channel::NIGHTLY), - DistToolchainName::Beta1 => write!(f, "{}", channel::BETA_1), - DistToolchainName::Beta2 => write!(f, "{}", channel::BETA_2), - DistToolchainName::Beta3 => write!(f, "{}", channel::BETA_3), - DistToolchainName::Beta4 => write!(f, "{}", channel::BETA_4), - DistToolchainName::Beta5 => write!(f, "{}", channel::BETA_5), - DistToolchainName::Devnet => write!(f, "{}", channel::DEVNET), DistToolchainName::Testnet => write!(f, "{}", channel::TESTNET), + DistToolchainName::Mainnet => write!(f, "{}", channel::MAINNET), } } } @@ -72,13 +58,8 @@ impl FromStr for DistToolchainName { match s { channel::LATEST => Ok(Self::Latest), channel::NIGHTLY => Ok(Self::Nightly), - channel::BETA_1 => Ok(Self::Beta1), - channel::BETA_2 => Ok(Self::Beta2), - channel::BETA_3 => Ok(Self::Beta3), - channel::BETA_4 => Ok(Self::Beta4), - channel::BETA_5 => Ok(Self::Beta5), - channel::DEVNET => Ok(Self::Devnet), channel::TESTNET => Ok(Self::Testnet), + channel::MAINNET => Ok(Self::Mainnet), _ => bail!("Unknown name for toolchain: {}", s), } } diff --git a/src/toolchain_override.rs b/src/toolchain_override.rs index 5fdbc3f8..3c392b9c 100644 --- a/src/toolchain_override.rs +++ b/src/toolchain_override.rs @@ -1,5 +1,5 @@ use crate::{ - channel::{is_beta_toolchain, LATEST, NIGHTLY}, + channel::{is_dateless_distributed_toolchain, LATEST, NIGHTLY}, constants::{DATE_FORMAT, FUEL_TOOLCHAIN_TOML_FILE}, download::DownloadCfg, file, @@ -69,7 +69,7 @@ where |_| { Err(Error::invalid_value( serde::de::Unexpected::Str(&channel_str), - &"one of ", + &"one of ", )) }, Result::Ok, @@ -88,7 +88,7 @@ impl fmt::Display for Channel { impl FromStr for Channel { type Err = anyhow::Error; fn from_str(s: &str) -> Result { - if is_beta_toolchain(s) { + if is_dateless_distributed_toolchain(s) { return Ok(Self { name: s.to_string(), date: None, @@ -213,7 +213,7 @@ impl OverrideCfg { #[cfg(test)] mod tests { use super::*; - use crate::channel::{BETA_1, BETA_2, BETA_3, NIGHTLY}; + use crate::channel::{MAINNET, NIGHTLY, TESTNET}; use indoc::indoc; #[test] @@ -262,7 +262,7 @@ mod tests { let e = result.unwrap_err(); assert_eq!(e .to_string(), - "invalid value: string \"latest\", expected one of for key `toolchain.channel`".to_string()); + "invalid value: string \"latest\", expected one of for key `toolchain.channel`".to_string()); let result = OverrideCfg::from_toml(NIGHTLY); assert!(result.is_err()); @@ -270,7 +270,7 @@ mod tests { assert_eq!(e .to_string(), - "invalid value: string \"nightly\", expected one of for key `toolchain.channel`".to_string()); + "invalid value: string \"nightly\", expected one of for key `toolchain.channel`".to_string()); } #[test] @@ -285,7 +285,7 @@ mod tests { "#}; const EMPTY_COMPONENTS: &str = indoc! {r#" [toolchain] - channel = "beta-2" + channel = "testnet" [components] "#}; @@ -302,9 +302,8 @@ mod tests { #[test] fn channel_from_str() { - assert!(Channel::from_str(BETA_1).is_ok()); - assert!(Channel::from_str(BETA_2).is_ok()); - assert!(Channel::from_str(BETA_3).is_ok()); + assert!(Channel::from_str(TESTNET).is_ok()); + assert!(Channel::from_str(MAINNET).is_ok()); assert!(Channel::from_str(NIGHTLY).is_err()); assert!(Channel::from_str(LATEST).is_err()); } diff --git a/tests/check.rs b/tests/check.rs index fcbbe826..6370f31c 100644 --- a/tests/check.rs +++ b/tests/check.rs @@ -5,9 +5,8 @@ use fuelup::target_triple::TargetTriple; use testcfg::FuelupState; #[test] -fn fuelup_check() -> Result<()> { +fn test_fuelup_check() -> Result<()> { let latest = format!("latest-{}", TargetTriple::from_host().unwrap()); - let beta_1 = format!("beta-1-{}", TargetTriple::from_host().unwrap()); let forc = "forc -"; let fuel_core = "fuel-core -"; let fuel_indexer = "fuel-indexer -"; @@ -31,16 +30,5 @@ fn fuelup_check() -> Result<()> { assert!(stdout.contains(fuel_core)); })?; - // Test that toolchain names with '-' inside are parsed correctly. - testcfg::setup(FuelupState::Beta1Installed, &|cfg| { - let output = cfg.fuelup(&["check", "--verbose"]); - let stripped = strip_ansi_escapes::strip(output.stdout); - let stdout = String::from_utf8_lossy(&stripped); - assert!(stdout.contains(&beta_1)); - assert!(stdout.contains(forc)); - assert!(stdout.contains(fuel_core)); - assert!(!stdout.contains(fuel_indexer)); - })?; - Ok(()) } diff --git a/tests/default.rs b/tests/default.rs index 88930954..e43afa73 100644 --- a/tests/default.rs +++ b/tests/default.rs @@ -101,10 +101,10 @@ fn fuelup_default_nightly_and_nightly_date() -> Result<()> { #[test] fn fuelup_default_override() -> Result<()> { - testcfg::setup(FuelupState::LatestWithBetaOverride, &|cfg| { + testcfg::setup(FuelupState::LatestWithTestnetOverride, &|cfg| { let output = cfg.fuelup(&["default"]); let triple = TargetTriple::from_host().unwrap(); - let expected_stdout = format!("beta-1-{triple} (override), latest-{triple} (default)\n"); + let expected_stdout = format!("testnet-{triple} (override), latest-{triple} (default)\n"); assert_eq!(output.stdout, expected_stdout); })?; Ok(()) diff --git a/tests/show.rs b/tests/show.rs index 6a557f7f..057ec166 100644 --- a/tests/show.rs +++ b/tests/show.rs @@ -172,7 +172,7 @@ fn fuelup_show_custom() -> Result<()> { #[test] fn fuelup_show_override() -> Result<()> { - testcfg::setup(FuelupState::LatestWithBetaOverride, &|cfg| { + testcfg::setup(FuelupState::LatestWithTestnetOverride, &|cfg| { let stripped = strip_ansi_escapes::strip(cfg.fuelup(&["show"]).stdout); let stdout = String::from_utf8_lossy(&stripped); let target = TargetTriple::from_host().unwrap(); @@ -188,7 +188,7 @@ fn fuelup_show_override() -> Result<()> { active toolchain ---------------- - beta-1-{target} (override), path: {} + testnet-{target} (override), path: {} forc : not found - forc-client - forc-deploy : not found diff --git a/tests/testcfg/mod.rs b/tests/testcfg/mod.rs index 6083f0aa..a4a196c3 100644 --- a/tests/testcfg/mod.rs +++ b/tests/testcfg/mod.rs @@ -1,5 +1,5 @@ use anyhow::Result; -use fuelup::channel::{BETA_1, LATEST, NIGHTLY}; +use fuelup::channel::{LATEST, NIGHTLY, TESTNET}; use fuelup::constants::FUEL_TOOLCHAIN_TOML_FILE; use fuelup::file::hard_or_symlink_file; use fuelup::settings::SettingsFile; @@ -34,11 +34,9 @@ pub enum FuelupState { FuelupUpdateConflict, /// Inits a state with the `nightly` and `nightly-2022-08-30` toolchains. NightlyAndNightlyDateInstalled, - /// Inits a state with only the `beta-1` toolchain. - Beta1Installed, - /// Inits a state with the `latest` toolchain, with `beta-1` declared within + /// Inits a state with the `latest` toolchain, with `testnet` declared within /// fuel-toolchain.toml. - LatestWithBetaOverride, + LatestWithTestnetOverride, } #[derive(Debug)] @@ -256,7 +254,7 @@ pub fn setup(state: FuelupState, f: &dyn Fn(&mut TestCfg)) -> Result<()> { let target = TargetTriple::from_host().unwrap(); let latest = format!("{LATEST}-{target}"); let nightly = format!("{NIGHTLY}-{target}"); - let beta_1 = format!("{BETA_1}-{target}"); + let testnet = format!("{TESTNET}-{target}"); match state { FuelupState::Empty => {} @@ -310,18 +308,13 @@ pub fn setup(state: FuelupState, f: &dyn Fn(&mut TestCfg)) -> Result<()> { setup_toolchain(&tmp_fuelup_root_path, &format!("nightly-{DATE}-{target}"))?; setup_settings_file(&tmp_fuelup_root_path, &nightly)?; } - FuelupState::Beta1Installed => { - setup_toolchain(&tmp_fuelup_root_path, &beta_1)?; - setup_toolchain(&tmp_fuelup_root_path, &format!("beta-1-{DATE}-{target}"))?; - setup_settings_file(&tmp_fuelup_root_path, &beta_1)?; - } - FuelupState::LatestWithBetaOverride => { + FuelupState::LatestWithTestnetOverride => { setup_toolchain(&tmp_fuelup_root_path, &latest)?; setup_settings_file(&tmp_fuelup_root_path, &latest)?; setup_override_file(ToolchainOverride { cfg: OverrideCfg::new( ToolchainCfg { - channel: toolchain_override::Channel::from_str("beta-1").unwrap(), + channel: toolchain_override::Channel::from_str(&testnet).unwrap(), }, None, ),