diff --git a/.cargo/config.toml b/.cargo/config.toml index a1a83b0..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_stellar = "install --locked stellar-cli --version 21.0.0 --force --root ./target stellar-cli --debug" b = "build --target wasm32-unknown-unknown --release" # c = "check" # t = "test" diff --git a/Dockerfile b/Dockerfile index 2c34ece..2e65825 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,20 @@ # 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 -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 + +WORKDIR /workspace/target/bin + +CMD ["./soroban", "--version"] 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.