From 09180b794c66905f1c2d7c68261ff1b5f6ba931b Mon Sep 17 00:00:00 2001 From: Severin Siffert Date: Mon, 25 Nov 2024 11:44:56 +0100 Subject: [PATCH] feat: support --replica for dfx start (#4014) --- CHANGELOG.md | 6 ++++++ docs/cli-reference/dfx-start.mdx | 1 + src/dfx/src/commands/start.rs | 7 +++++++ 3 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ecc8f39df..5396853a28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,12 @@ Users can surpress this error by setting `export DFX_WARNING=-mainnet_plaintext_ The warning won't display when executing commands like `dfx deploy --playground`. +### feat: support `--replica` in `dfx start` + +Added a flag `--replica` to `dfx start`. This flag currently has no effect. +Once PocketIC becomes the default for `dfx start` this flag will start the replica instead. +You can use the `--replica` flag already to write scripts that anticipate that change. + # 0.24.3 ### feat: Bitcoin support in PocketIC diff --git a/docs/cli-reference/dfx-start.mdx b/docs/cli-reference/dfx-start.mdx index 515400c796..87f6afae8e 100644 --- a/docs/cli-reference/dfx-start.mdx +++ b/docs/cli-reference/dfx-start.mdx @@ -25,6 +25,7 @@ You can use the following optional flags with the `dfx start` command. | `--enable-bitcoin` | Enables bitcoin integration. | | `--enable-canister-http` | Enables canister HTTP requests. (deprecated: now enabled by default) | | `--pocketic` | Runs [PocketIC](https://github.com/dfinity/pocketic) instead of the replica. | +| `--replica` | Runs the replica instead of [PocketIC](https://github.com/dfinity/pocketic). | ## Options diff --git a/src/dfx/src/commands/start.rs b/src/dfx/src/commands/start.rs index ea9270e9b3..768f6d286b 100644 --- a/src/dfx/src/commands/start.rs +++ b/src/dfx/src/commands/start.rs @@ -85,6 +85,12 @@ pub struct StartOpts { /// Runs PocketIC instead of the replica #[clap(long, alias = "emulator")] pocketic: bool, + + /// Runs the replica instead of pocketic. + /// Currently this has no effect. + #[clap(long, conflicts_with = "pocketic")] + #[allow(unused)] + replica: bool, } // The frontend webserver is brought up by the bg process; thus, the fg process @@ -152,6 +158,7 @@ pub fn exec( artificial_delay, domain, pocketic, + replica: _, }: StartOpts, ) -> DfxResult { if !background {