Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion FULL_HELP_DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1692,7 +1692,7 @@ Start a container running a Stellar node, RPC, API, and friendbot (faucet).

By default, when starting a testnet container, without any optional arguments, it will run the equivalent of the following docker command:

`docker run --rm -p 8000:8000 --name stellar stellar/quickstart:testing --testnet --enable rpc,horizon`
`docker run --rm -p 8000:8000 --name stellar stellar/quickstart:latest --testnet --enable rpc,horizon`

**Usage:** `stellar container start [OPTIONS] [NETWORK]`

Expand Down
31 changes: 30 additions & 1 deletion cmd/crates/soroban-test/tests/it/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,44 @@ fn start_defaults_to_docker_and_passes_expected_args() {

let log = s.invocations();
// Pulled and ran via docker (not the apple `image pull` form).
assert!(line_for(&log, "pull").starts_with("docker pull "));
let pull = line_for(&log, "pull");
assert!(pull.starts_with("docker pull "));
// Local defaults to the published `latest` tag, not the unpublished `testing` tag.
assert!(
pull.contains("docker.io/stellar/quickstart:latest"),
"pull line: {pull}"
);
let run = line_for(&log, " run ");
assert!(run.starts_with("docker "), "expected docker binary: {run}");
assert!(
run.contains("docker.io/stellar/quickstart:latest"),
"run line: {run}"
);
assert!(run.contains("--name stellar-local"), "run line: {run}");
assert!(run.contains("-p 8000:8000"), "run line: {run}");
// No host override unless requested.
assert!(!run.contains("-H "), "unexpected -H: {run}");
}

#[test]
fn start_testnet_defaults_to_latest_image_tag() {
let s = EngineSandbox::new();
s.install_engine("docker");

s.cmd("ok").args(["start", "testnet"]).assert().success();

let log = s.invocations();
// Testnet, like local, now defaults to the published `latest` tag.
assert!(
line_for(&log, "pull").contains("docker.io/stellar/quickstart:latest"),
"pull line: {log}"
);
assert!(
line_for(&log, " run ").contains("docker.io/stellar/quickstart:latest"),
"run line: {log}"
);
}

#[test]
fn start_passes_cpu_and_memory_limits_to_run() {
let s = EngineSandbox::new();
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/commands/container/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub enum Cmd {
///
/// By default, when starting a testnet container, without any optional arguments, it will run the equivalent of the following docker command:
///
/// `docker run --rm -p 8000:8000 --name stellar stellar/quickstart:testing --testnet --enable rpc,horizon`
/// `docker run --rm -p 8000:8000 --name stellar stellar/quickstart:latest --testnet --enable rpc,horizon`
Start(start::Cmd),
/// Stop a network container started with `stellar container start`.
Stop(stop::Cmd),
Expand Down
5 changes: 2 additions & 3 deletions cmd/soroban-cli/src/commands/container/start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,10 @@ impl Runner {
}

fn get_image_name(&self) -> String {
// this can be overriden with the `-t` flag
let mut image_tag = match &self.network {
Network::Pubnet => "latest",
Network::Futurenet => "future",
_ => "testing", // default to testing for local and testnet
// pubnet, local, and testnet all default to latest
_ => "latest",
};

if let Some(image_override) = &self.args.image_tag_override {
Expand Down
Loading