Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Gitpod Environment and Soroban SDK #327

Merged
merged 11 commits into from
Oct 15, 2024
Merged
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
5 changes: 2 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,9 @@ jobs:
- run: cargo version
- run: rustup target add ${{ matrix.sys.target }}
- run: rustup target add wasm32-unknown-unknown
- uses: stellar/binaries@v16
- uses: stellar/stellar-cli@d538ea9a1b5bbf1847a987ccf316d34e55465313
with:
name: soroban-cli
version: 0.8.7
version: 21.5.0
- run: make test
env:
CARGO_BUILD_TARGET: ${{ matrix.sys.target }}
30 changes: 13 additions & 17 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
FROM gitpod/workspace-full:2023-01-16-03-31-28

RUN mkdir -p ~/.local/bin
RUN curl -L https://github.com/stellar/soroban-tools/releases/download/v20.3.0/soroban-cli-20.3.0-x86_64-unknown-linux-gnu.tar.gz | tar xz -C ~/.local/bin soroban
RUN chmod +x ~/.local/bin/soroban
RUN curl -L https://github.com/mozilla/sccache/releases/download/v0.3.3/sccache-v0.3.3-x86_64-unknown-linux-musl.tar.gz | tar xz --strip-components 1 -C ~/.local/bin sccache-v0.3.3-x86_64-unknown-linux-musl/sccache
RUN chmod +x ~/.local/bin/sccache

RUN curl -L https://github.com/watchexec/cargo-watch/releases/download/v8.1.2/cargo-watch-v8.1.2-x86_64-unknown-linux-gnu.tar.xz | tar xJ --strip-components 1 -C ~/.local/bin cargo-watch-v8.1.2-x86_64-unknown-linux-gnu/cargo-watch

ENV RUSTC_WRAPPER=sccache
ENV SCCACHE_CACHE_SIZE=5G
ENV SCCACHE_DIR=/workspace/.sccache
FROM gitpod/workspace-full:latest

# Remove the existing rustup installation before updating due to:
# https://github.com/gitpod-io/workspace-images/issues/933#issuecomment-1272616892
RUN rustup self uninstall -y
RUN rm -rf .rustup
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none -y

RUN rustup install 1.69
RUN rustup target add --toolchain 1.69 wasm32-unknown-unknown
RUN rustup component add --toolchain 1.69 rust-src
RUN rustup default 1.69
RUN rustup install 1.81
RUN rustup target add --toolchain 1.81 wasm32-unknown-unknown
RUN rustup component add --toolchain 1.81 rust-src
RUN rustup default 1.81

RUN sudo apt-get update && sudo apt-get install -y binaryen

# Enable sparse registry support, which will cause cargo to download only what
# it needs from crates.io, rather than the entire registry.
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse

# Install cargo binstall
RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
RUN cargo binstall -y stellar-cli cargo-watch sccache

leighmcculloch marked this conversation as resolved.
Show resolved Hide resolved
ENV RUSTC_WRAPPER=sccache
ENV SCCACHE_CACHE_SIZE=5G
ENV SCCACHE_DIR=/workspace/.sccache
38 changes: 8 additions & 30 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,14 @@ image:
file: .gitpod.Dockerfile

tasks:
- name: Futurenet
init: |
docker pull stellar/quickstart:soroban-dev
command: |
docker run --rm -it \
--name stellar \
-p 8000:8000 \
stellar/quickstart:soroban-dev \
--futurenet \
--enable-soroban-rpc
# This "CLI - Futurenet" task opens a terminal for you to interact with the
# futurenet network.
- name: CLI - Futurenet
# We specify some required environment variables for use on the futurenet.
# This "CLI - Testnet" task opens a terminal for you to interact with the
# testnet network.
- name: CLI - Testnet
leighmcculloch marked this conversation as resolved.
Show resolved Hide resolved
# We specify some required environment variables for use on the testnet.
env:
# This can be set by the user, but this terminal is dedicated to futurenet so set for convenience.
SOROBAN_RPC_URL: "http://127.0.0.1:8000/soroban/rpc"
SOROBAN_NETWORK_PASSPHRASE: "Test SDF Future Network ; October 2022"
# This can be set by the user, but this terminal is dedicated to testnet so set for convenience.
SOROBAN_RPC_URL: "https://soroban-testnet.stellar.org"
SOROBAN_NETWORK_PASSPHRASE: "Test SDF Network ; September 2015"
# To keep things tidy, we clear the terminal from the previous output.
command: |
clear
Expand All @@ -31,25 +21,13 @@ tasks:
gp open increment/src/lib.rs
gp open increment/src/test.rs
gp open README.md
soroban contract invoke --id 1 --wasm increment/target/wasm32-unknown-unknown/release/soroban_increment_contract.wasm -- increment
stellar version
vscode:
extensions:
- rust-lang.rust-analyzer
- vadimcn.vscode-lldb

github:
leighmcculloch marked this conversation as resolved.
Show resolved Hide resolved
prebuilds:
addBadge: true
addComment: true
pullRequests: true
pullRequestsFromForks: true
ports:
# Your quickstart node has a Horizon API server and an RPC endpoint, both
# listening on port 8000. It's publicly accessible through the internet.
- name: Futurenet
port: 8000
visibility: public
onOpen: ignore
# This port is open for "Something with cargo test I think"??
- port: 4226
visibility: private
Expand Down
20 changes: 10 additions & 10 deletions account/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions account/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ crate-type = ["cdylib"]
doctest = false

[dependencies]
soroban-sdk = { version = "21.6.0" }
soroban-sdk = { version = "21.7.4" }

[dev-dependencies]
soroban-sdk = { version = "21.6.0", features = ["testutils"] }
soroban-sdk = { version = "21.7.4", features = ["testutils"] }
ed25519-dalek = { version = "1.0.1" }
rand = { version = "0.7.3" }

Expand Down
2 changes: 1 addition & 1 deletion account/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test: build
cargo test

build:
soroban contract build
stellar contract build
@ls -l target/wasm32-unknown-unknown/release/*.wasm

fmt:
Expand Down
20 changes: 10 additions & 10 deletions alloc/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions alloc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ crate-type = ["cdylib"]
doctest = false

[dependencies]
soroban-sdk = { version = "21.6.0", features = ["alloc"] }
soroban-sdk = { version = "21.7.4", features = ["alloc"] }

[dev-dependencies]
soroban-sdk = { version = "21.6.0", features = ["testutils", "alloc"] }
soroban-sdk = { version = "21.7.4", features = ["testutils", "alloc"] }

[profile.release]
opt-level = "z"
Expand Down
2 changes: 1 addition & 1 deletion alloc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test: build
cargo test

build:
soroban contract build
stellar contract build
@ls -l target/wasm32-unknown-unknown/release/*.wasm

fmt:
Expand Down
20 changes: 10 additions & 10 deletions atomic_multiswap/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions atomic_multiswap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ crate-type = ["cdylib"]
doctest = false

[dependencies]
soroban-sdk = { version = "21.6.0" }
soroban-sdk = { version = "21.7.4" }

[dev-dependencies]
soroban-sdk = { version = "21.6.0", features = ["testutils"] }
soroban-sdk = { version = "21.7.4", features = ["testutils"] }
assert_unordered = "0.3.5"

[profile.release]
Expand Down
2 changes: 1 addition & 1 deletion atomic_multiswap/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ test: build

build:
$(MAKE) -C ../atomic_swap || break;
soroban contract build
stellar contract build
@ls -l target/wasm32-unknown-unknown/release/*.wasm

fmt:
Expand Down
Loading
Loading