diff --git a/CHANGELOG.md b/CHANGELOG.md index 8468209147..936e5024cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ ## DFX +### feat!: Removed dfx replica and dfx bootstrap commands + +Use `dfx start` instead. If you have a good reason why we should keep these commands, please contribute to the discussion at https://github.com/dfinity/sdk/discussions/3163 + ### fix: Wait for new module hash when installing wallet A previous change made dfx wait after installing a canister until the replica updated its reported module hash, but this change did not affect wallets. Now dfx waits for wallets too, to eliminate a class of wallet installation errors. diff --git a/docs/cli-reference/dfx-bootstrap.md b/docs/cli-reference/dfx-bootstrap.md index 6c9f9139d4..94967fc1d7 100644 --- a/docs/cli-reference/dfx-bootstrap.md +++ b/docs/cli-reference/dfx-bootstrap.md @@ -1,50 +1,4 @@ # dfx bootstrap {#_dfx_bootstrap} -> **NOTE**: The bootstrap command is deprecated. Please use the [dfx start](./dfx-start.md) command instead. If you have a good reason to use the bootstrap command, please contribute to the [discussion](https://github.com/dfinity/sdk/discussions/3163). +> **NOTE**: The bootstrap command has been removed. Please use the [dfx start](./dfx-start.md) command instead. If you have a good reason to use the bootstrap command, please contribute to the [discussion](https://github.com/dfinity/sdk/discussions/3163). -Use the `dfx bootstrap` command to start the bootstrap web server defined in the `dfx.json` configuration file or specified using command-line options. - -The bootstrap web server you specify is used to serve the front-end static assets for your project. - -## Basic usage {#_basic_usage} - -``` bash -dfx bootstrap [option] -``` - -## Options {#_options} - -You can specify the following options for the `dfx bootstrap` command. - -| Option | Description | ------------------------|-----------------| -| `ip` | Specifies the IP address that the bootstrap server listens on. If you don't specify an IP address, the `address` setting you have configured in the `dfx.json` configuration file is used. By default, the server address is 127.0.0.1. | -| \--network | Specifies the network to connect to if you want to override the default local network endpoint (`http://127.0.0.1:8080/api`).| -| \--port | Specifies the port number that the bootstrap server listens on. By default, port number 8081 is used. | -| \--timeout | Specifies the maximum amount of time, in seconds, the bootstrap server will wait for upstream requests to complete. By default, the bootstrap server waits for a maximum of 30 seconds. | - -## Examples {#_examples} - -You can use the `dfx bootstrap` command to start a web server for your application using custom settings, including a specific server address, port number, and static asset location. - -For example, to start the bootstrap server using a specific IP address and port number, you would run a command similar to the following: - -``` bash -dfx bootstrap --ip 192.168.47.1 --port 5353 -``` - -The command displays output similar to the following: - -``` bash -binding to: V4(192.168.47.1:5353) -replica(s): \http://127.0.0.1:8080/api -Webserver started... -``` - -To use the default server address and port number but specify a custom location for static assets and longer timeout period, you might run a command similar to the following: - -``` bash -dfx bootstrap --root $HOME/ic-projects/assets --timeout 60 -``` - -You can use CTRL-C to stop the bootstrap server. diff --git a/docs/cli-reference/dfx-replica.md b/docs/cli-reference/dfx-replica.md index 7646f65a57..05fd408f0b 100644 --- a/docs/cli-reference/dfx-replica.md +++ b/docs/cli-reference/dfx-replica.md @@ -1,41 +1,4 @@ # dfx replica -> **NOTE**: The replica command is deprecated. Please use the [dfx start](./dfx-start.md) command instead. If you have a good reason to use the replica command, please contribute to the [discussion](https://github.com/dfinity/sdk/discussions/3163). +> **NOTE**: The replica command has been removed. Please use the [dfx start](./dfx-start.md) command instead. If you have a good reason to use the replica command, please contribute to the [discussion](https://github.com/dfinity/sdk/discussions/3163). -Use the `dfx replica` command to start a local canister execution environment (without a web server). This command enables you to deploy canisters locally and to test your dapps during development. - -By default, all local dfx projects will use a single shared local canister execution environment, and you can run `dfx replica` from any directory. See [Local Server Configuration](#local-server-configuration) and [Project-Specific Local Networks](dfx-start.md#project-specific-local-networks) for exceptions. - -## Basic usage - -``` bash -dfx replica [option] [flag] -``` - -## Flags - -You can use the following optional flags with the `dfx replica` command. - -| Flag | Description | -|-------------------|-----------------------------------------------------------------------------------------------| -| `--emulator` | Starts the [IC reference emulator](https://github.com/dfinity/ic-hs) rather than the replica. | -| `--enable-bitcoin`| Enables bitcoin integration. | -| `--enable-canister-http` | Enables canister HTTP requests. (deprecated: now enabled by default) | - -## Options - -You can use the following option with the `dfx replica` command. - -| Option | Description | -|---------------------------|-------------------------------------------------------------------------------| -| `--port port` | Specifies the port the local canister execution environment should listen to. | -| `--bitcoin-node host:port` | Specifies the address of a bitcoind node. Implies `--enable-bitcoin`. | -| `--artificial-delay milliseconds` | Specifies the delay that an update call should incur. Default: 600ms | - -## Examples - -You can start the local canister execution environment by running the following command: - -``` bash -dfx replica -``` diff --git a/e2e/tests-dfx/bitcoin.bash b/e2e/tests-dfx/bitcoin.bash index 4fa7a452bf..08048c2da5 100644 --- a/e2e/tests-dfx/bitcoin.bash +++ b/e2e/tests-dfx/bitcoin.bash @@ -16,8 +16,8 @@ teardown() { bitcoin-cli -regtest stop dfx_stop - stop_dfx_replica - stop_dfx_bootstrap + # stop_dfx_replica + # stop_dfx_bootstrap standard_teardown } @@ -90,6 +90,7 @@ set_local_network_bitcoin_enabled() { } @test "dfx restarts replica when ic-btc-adapter restarts - replica and bootstrap" { + skip "dfx replica and bootstrap are deprecated" dfx_new hello dfx_replica --enable-bitcoin dfx_bootstrap @@ -145,6 +146,8 @@ set_local_network_bitcoin_enabled() { } @test "dfx replica --bitcoin-node implies --enable-bitcoin" { + skip "dfx replica and bootstrap are deprecated" + dfx_new hello dfx_replica "--bitcoin-node" "127.0.0.1:18444" dfx_bootstrap @@ -172,6 +175,7 @@ set_local_network_bitcoin_enabled() { } @test "dfx replica --enable-bitcoin with no other configuration succeeds" { + skip "dfx replica and bootstrap are deprecated" dfx_new hello dfx_replica --enable-bitcoin @@ -208,6 +212,7 @@ set_local_network_bitcoin_enabled() { } @test "can enable bitcoin through default configuration - dfx replica" { + skip "dfx replica and bootstrap are deprecated" dfx_new hello define_project_network set_project_default_bitcoin_enabled @@ -218,6 +223,7 @@ set_local_network_bitcoin_enabled() { } @test "can enable bitcoin through shared local network - dfx replica" { + skip "dfx replica and bootstrap are deprecated" dfx_new hello set_shared_local_network_bitcoin_enabled @@ -241,6 +247,8 @@ set_local_network_bitcoin_enabled() { } @test "dfx replica+bootstrap with both bitcoin and canister http enabled" { + skip "dfx replica and bootstrap are deprecated" + dfx_new hello dfx_replica --enable-bitcoin --enable-canister-http diff --git a/e2e/tests-dfx/bootstrap.bash b/e2e/tests-dfx/bootstrap.bash index 48522b08a4..180673974c 100644 --- a/e2e/tests-dfx/bootstrap.bash +++ b/e2e/tests-dfx/bootstrap.bash @@ -9,13 +9,15 @@ setup() { } teardown() { - stop_dfx_replica - stop_dfx_bootstrap + # stop_dfx_replica + # stop_dfx_bootstrap standard_teardown } @test "forbid starting webserver with a forwarded port" { + skip "dfx replica and bootstrap are deprecated" + [ "$USE_IC_REF" ] && skip "skipped for ic-ref" assert_command_fail dfx bootstrap --port 4943 @@ -23,6 +25,8 @@ teardown() { } @test "bootstrap supports http requests" { + skip "dfx replica and bootstrap are deprecated" + dfx_replica dfx_bootstrap diff --git a/e2e/tests-dfx/canister_http.bash b/e2e/tests-dfx/canister_http.bash index 88b1e4a085..6e1bd2eb1f 100644 --- a/e2e/tests-dfx/canister_http.bash +++ b/e2e/tests-dfx/canister_http.bash @@ -10,8 +10,8 @@ setup() { teardown() { dfx_stop - stop_dfx_replica - stop_dfx_bootstrap + # stop_dfx_replica + # stop_dfx_bootstrap standard_teardown } @@ -100,6 +100,7 @@ set_shared_local_network_canister_http_empty() { } @test "dfx restarts replica when ic-https-outcalls-adapter restarts - replica and bootstrap" { + skip "dfx replica and bootstrap are deprecated" dfx_new hello dfx_replica dfx_bootstrap @@ -155,6 +156,7 @@ set_shared_local_network_canister_http_empty() { } @test "dfx replica --enable-canister-http with no other configuration succeeds" { + skip "dfx replica and bootstrap are deprecated" dfx_new hello dfx_replica --enable-canister-http @@ -222,6 +224,7 @@ set_shared_local_network_canister_http_empty() { @test "can enable http through project default configuration - dfx replica" { + skip "dfx replica and bootstrap are deprecated" dfx_new hello define_project_network set_project_default_canister_http_enabled @@ -232,6 +235,7 @@ set_shared_local_network_canister_http_empty() { } @test "can disable http through project default configuration - dfx replica" { + skip "dfx replica and bootstrap are deprecated" dfx_new hello define_project_network set_project_default_canister_http_enabled false @@ -242,6 +246,7 @@ set_shared_local_network_canister_http_empty() { } @test "can enable http through project local network - dfx replica" { + skip "dfx replica and bootstrap are deprecated" dfx_new hello define_project_network set_project_local_network_canister_http_enabled @@ -252,6 +257,7 @@ set_shared_local_network_canister_http_empty() { } @test "can disable http through project local network - dfx replica" { + skip "dfx replica and bootstrap are deprecated" dfx_new hello define_project_network set_project_local_network_canister_http_enabled false @@ -262,6 +268,7 @@ set_shared_local_network_canister_http_empty() { } @test "can enable http through shared local network - dfx replica" { + skip "dfx replica and bootstrap are deprecated" dfx_new hello set_shared_local_network_canister_http_enabled @@ -271,6 +278,7 @@ set_shared_local_network_canister_http_empty() { } @test "can disable http through shared local network - dfx replica" { + skip "dfx replica and bootstrap are deprecated" dfx_new hello set_shared_local_network_canister_http_enabled false diff --git a/e2e/tests-dfx/inter.bash b/e2e/tests-dfx/inter.bash index 97cac52fb5..29934134a6 100644 --- a/e2e/tests-dfx/inter.bash +++ b/e2e/tests-dfx/inter.bash @@ -8,8 +8,8 @@ setup() { teardown() { dfx_stop - stop_dfx_replica - stop_dfx_bootstrap + # stop_dfx_replica + # stop_dfx_bootstrap standard_teardown } diff --git a/e2e/tests-dfx/signals.bash b/e2e/tests-dfx/signals.bash index ac511b7dca..14514c1f64 100644 --- a/e2e/tests-dfx/signals.bash +++ b/e2e/tests-dfx/signals.bash @@ -26,6 +26,7 @@ teardown() { } dfx_replica_kills_replica() { + skip "dfx replica and bootstrap are deprecated" signal=$1 dfx_patchelf diff --git a/src/dfx/src/commands/mod.rs b/src/dfx/src/commands/mod.rs index f1d34fe559..67a714ba71 100644 --- a/src/dfx/src/commands/mod.rs +++ b/src/dfx/src/commands/mod.rs @@ -7,7 +7,6 @@ use anyhow::bail; use clap::Subcommand; mod beta; -mod bootstrap; mod build; mod cache; mod canister; @@ -26,7 +25,6 @@ mod nns; mod ping; mod quickstart; mod remote; -mod replica; mod schema; mod sns; mod start; @@ -39,7 +37,6 @@ mod wallet; pub enum Command { #[command(hide = true)] Beta(beta::BetaOpts), - Bootstrap(bootstrap::BootstrapOpts), Build(build::CanisterBuildOpts), Cache(cache::CacheOpts), Canister(canister::CanisterOpts), @@ -63,7 +60,6 @@ pub enum Command { Ping(ping::PingOpts), Quickstart(quickstart::QuickstartOpts), Remote(remote::RemoteOpts), - Replica(replica::ReplicaOpts), Schema(schema::SchemaOpts), Sns(sns::SnsOpts), Start(start::StartOpts), @@ -76,7 +72,6 @@ pub enum Command { pub fn exec(env: &dyn Environment, cmd: Command) -> DfxResult { match cmd { Command::Beta(v) => beta::exec(env, v), - Command::Bootstrap(v) => bootstrap::exec(env, v), Command::Build(v) => build::exec(env, v), Command::Cache(v) => cache::exec(env, v), Command::Canister(v) => canister::exec(env, v), @@ -96,7 +91,6 @@ pub fn exec(env: &dyn Environment, cmd: Command) -> DfxResult { Command::Ping(v) => ping::exec(env, v), Command::Quickstart(v) => quickstart::exec(env, v), Command::Remote(v) => remote::exec(env, v), - Command::Replica(v) => replica::exec(env, v), Command::Schema(v) => schema::exec(v), Command::Sns(v) => sns::exec(env, v), Command::Start(v) => start::exec(env, v),