From 6a367e0b80f9bd48de7e3938b1e6bb860bde0df2 Mon Sep 17 00:00:00 2001 From: danielcdz Date: Sun, 4 Aug 2024 15:10:05 -0600 Subject: [PATCH 1/4] Update Dockerfile --- Dockerfile | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2c34ece..883e271 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,24 @@ # Based on Preview 7 # https://soroban.stellar.org/docs/reference/releases - FROM ubuntu:22.04 -RUN apt update && apt install -y curl +ENV PATH="/root/.cargo/bin:${PATH}" +ENV PATH="$PATH:/workspace/target/bin" +ENV IS_USING_DOCKER=true +ENV SOROBAN_CLI_REVISION="c7fb7e08ba8efa9828d9df863d991558f269e35b" +ENV GIT_REVISION=$SOROBAN_CLI_REVISION -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rust_install.sh -RUN sh rust_install.sh -y -RUN echo $PATH -ENV PATH="$PATH:/root/.cargo/bin" -RUN rustup target add wasm32-unknown-unknown +RUN apt update && \ + apt install -y curl build-essential && \ + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \ + rustup target add wasm32-unknown-unknown -RUN apt install -y build-essential -# WORKDIR / -RUN mkdir /workspace WORKDIR /workspace -ENV IS_USING_DOCKER=true + +COPY .cargo /root/.cargo + +RUN cargo install_soroban + +WORKDIR /workspace/target/bin + +CMD ["./soroban", "--version"] From 15593e026e3a58c1635478cad26c8239b059f57c Mon Sep 17 00:00:00 2001 From: danielcdz Date: Sun, 4 Aug 2024 15:10:39 -0600 Subject: [PATCH 2/4] Add cargo install_soroban --- .cargo/config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index a1a83b0..a5ec25d 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,7 +1,7 @@ # paths = ["/path/to/override"] # path dependency overrides [alias] # command aliases -install_stellar = "install --locked stellar-cli --version 21.0.0 --force --root ./target stellar-cli --debug" +install_soroban = "install --git https://github.com/AhaLabs/soroban-tools --rev c7fb7e08ba8efa9828d9df863d991558f269e35b --root ./target soroban-cli --debug" b = "build --target wasm32-unknown-unknown --release" # c = "check" # t = "test" From cbbcdf8069ff675b1a49b797c8c9ed88e4bc2a3f Mon Sep 17 00:00:00 2001 From: danielcdz Date: Sun, 4 Aug 2024 15:12:53 -0600 Subject: [PATCH 3/4] Update readme --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e38f7ed..da73162 100755 --- a/README.md +++ b/README.md @@ -8,15 +8,15 @@ backed by smart contracts on Stellar. # Getting Started ## Install Dependencies - +-------------------- 1. `rustc` >= 1.71.0 with the `wasm32-unknown-unknown` target installed. See https://soroban.stellar.org/docs/getting-started/setup#install-rust . If you have already a lower version, the easiest way to upgrade is to uninstall (`rustup self uninstall`) and install it again. -2. `soroban-cli`. See https://soroban.stellar.org/docs/getting-started/setup#install-the-soroban-cli -3. If you want to run everything locally: `docker` (you can run both Standalone and Futurenet backends with it) +2. `soroban-cli`. See https://soroban.stellar.org/docs/getting-started/setup#install-the-soroban-cli, but instead of `cargo install soroban-cli`, run `cargo install_soroban`. This is an alias set up in [.cargo/config.toml](./.cargo/config.toml), which pins the local soroban-cli to a specific version. If you add `./target/bin/` [to your PATH](https://linuxize.com/post/how-to-add-directory-to-path-in-linux/), then you'll automatically use this version of `soroban-cli` when you're in this directory. +3. If you want to run everything locally use: `make build-docker` (you can run both Standalone and Futurenet backends with it) 4. Node.js v18 5. [Freighter Wallet](https://www.freighter.app/) ≥[v5.0.2](https://github.com/stellar/freighter/releases/tag/2.9.1). Or from the Firefox / Chrome extension store. Once installed, enable "Experimental Mode" in the settings (gear icon). 6. If you want to skip step (1) and (2) and avoid installing specific `rustc` or `soroban-cli` versions, build the `soroban-preview` docker image: - make build-docker + make build-docker 7. **NOTE** - Follow the instructions below for Futurenet or Standalone and ensure that you have funded your wallet address that you intend to use from browser, otherwise the dapp display will be blank and a 'Account not found' will be printed on browser's console only. From 10d9d76741f8307a00a1075d2499285b6b7af3a3 Mon Sep 17 00:00:00 2001 From: danielcdz Date: Mon, 19 Aug 2024 12:26:00 -0600 Subject: [PATCH 4/4] Remove install-stellar command --- .cargo/config.toml | 1 - Dockerfile | 4 ---- 2 files changed, 5 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index a5ec25d..e540da5 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,7 +1,6 @@ # paths = ["/path/to/override"] # path dependency overrides [alias] # command aliases -install_soroban = "install --git https://github.com/AhaLabs/soroban-tools --rev c7fb7e08ba8efa9828d9df863d991558f269e35b --root ./target soroban-cli --debug" b = "build --target wasm32-unknown-unknown --release" # c = "check" # t = "test" diff --git a/Dockerfile b/Dockerfile index 883e271..2e65825 100755 --- a/Dockerfile +++ b/Dockerfile @@ -5,8 +5,6 @@ FROM ubuntu:22.04 ENV PATH="/root/.cargo/bin:${PATH}" ENV PATH="$PATH:/workspace/target/bin" ENV IS_USING_DOCKER=true -ENV SOROBAN_CLI_REVISION="c7fb7e08ba8efa9828d9df863d991558f269e35b" -ENV GIT_REVISION=$SOROBAN_CLI_REVISION RUN apt update && \ apt install -y curl build-essential && \ @@ -17,8 +15,6 @@ WORKDIR /workspace COPY .cargo /root/.cargo -RUN cargo install_soroban - WORKDIR /workspace/target/bin CMD ["./soroban", "--version"]