Skip to content
This repository was archived by the owner on Jan 8, 2026. It is now read-only.

Commit 01dd3e9

Browse files
committed
fix: allow using standalone
Everything looks correct, but when running the app it fails with: Error: Cannot connect to insecure soroban-rpc server
1 parent 248aed5 commit 01dd3e9

4 files changed

Lines changed: 12 additions & 10 deletions

File tree

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ ENV PATH="$PATH:/root/.cargo/bin"
1212
RUN rustup target add wasm32-unknown-unknown
1313

1414
RUN apt install -y build-essential
15-
RUN cargo install --locked --version 0.8.0 soroban-cli
1615
# WORKDIR /
1716
RUN mkdir /workspace
1817
WORKDIR /workspace

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Getting Started
1212
Install Dependencies
1313
--------------------
1414

15-
1. `soroban-cli v0.8.0`. See https://soroban.stellar.org/docs/getting-started/setup#install-the-soroban-cli
15+
1. `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.
1616
2. If you want to run everything locally: `docker` (you can run both Standalone and Futurenet backends with it)
1717
3. Node.js v18
1818
4. [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).
@@ -33,9 +33,9 @@ You have three options: 1. Deploy on [Futurenet](https://soroban.stellar.org/doc
3333

3434
1. Deploy the contracts and initialize them
3535

36-
./initialize.sh futurenet
36+
npm run setup
3737

38-
This will create a `token-admin` identity for you (`soroban config identity create token-admin`) and deploy a Fungible Token contract as well as the [crowdfund contract](./contracts/crowdfund), with this account as admin.
38+
This runs `./initialize.sh futurenet` behind the scenes, which will create a `token-admin` identity for you (`soroban config identity create token-admin`) and deploy a Fungible Token contract as well as the [crowdfund contract](./contracts/crowdfund), with this account as admin.
3939

4040
2. Select the Futurenet network in your Freighter browser extension
4141

@@ -91,7 +91,7 @@ You have three options: 1. Deploy on [Futurenet](https://soroban.stellar.org/doc
9191

9292
You can use your own local soroban-cli:
9393

94-
./initialize.sh standalone
94+
NETWORK=standalone npm run setup
9595

9696
Or run it inside the soroban-preview docker container:
9797

initialize.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,10 @@ SOROBAN_RPC_URL="$SOROBAN_RPC_HOST/soroban/rpc"
3636

3737
case "$1" in
3838
standalone)
39-
echo "Using standalone network with RPC URL: $SOROBAN_RPC_URL"
4039
SOROBAN_NETWORK_PASSPHRASE="Standalone Network ; February 2017"
4140
FRIENDBOT_URL="$SOROBAN_RPC_HOST/friendbot"
4241
;;
4342
futurenet)
44-
echo "Using Futurenet network with RPC URL: $SOROBAN_RPC_URL"
4543
SOROBAN_NETWORK_PASSPHRASE="Test SDF Future Network ; October 2022"
4644
FRIENDBOT_URL="https://friendbot-futurenet.stellar.org/"
4745
;;
@@ -51,12 +49,18 @@ futurenet)
5149
;;
5250
esac
5351

52+
echo "Using $NETWORK network"
53+
echo " RPC URL: $SOROBAN_RPC_URL"
54+
echo " Friendbot URL: $FRIENDBOT_URL"
5455

5556
echo Add the $NETWORK network to cli client
5657
soroban config network add \
5758
--rpc-url "$SOROBAN_RPC_URL" \
5859
--network-passphrase "$SOROBAN_NETWORK_PASSPHRASE" "$NETWORK"
5960

61+
echo Add $NETWORK to .soroban-example-dapp for use with npm scripts
62+
mkdir -p .soroban-example-dapp
63+
echo $NETWORK > ./.soroban-example-dapp/network
6064

6165
if !(soroban config identity ls | grep token-admin 2>&1 >/dev/null); then
6266
echo Create the token-admin identity
@@ -79,7 +83,6 @@ ABUNDANCE_ID="$(
7983
--wasm target/wasm32-unknown-unknown/release/abundance_token.wasm
8084
)"
8185
echo "Contract deployed succesfully with ID: $ABUNDANCE_ID"
82-
mkdir -p .soroban-example-dapp
8386
echo -n "$ABUNDANCE_ID" > .soroban-example-dapp/abundance_token_id
8487

8588
echo Deploy the crowdfund contract

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
6-
"setup": "./initialize.sh futurenet && npm install",
6+
"setup": "./initialize.sh ${NETWORK:-futurenet} && npm install",
77
"reset": "rm -rf .soroban-example-dapp && rm -rf .next && rm -rf node_modules/crowdfund-contract && rm -rf node_modules/abundance-token && npm run setup",
88
"dev": "next dev",
99
"build": "next build",
1010
"start": "next start",
1111
"lint": "next lint",
12-
"postinstall": "./target/bin/soroban contract bindings typescript --wasm ./target/wasm32-unknown-unknown/release/soroban_crowdfund_contract.wasm --id $(cat ./.soroban-example-dapp/crowdfund_id) --root-dir ./node_modules/crowdfund-contract --network futurenet --contract-name crowdfund-contract && ./target/bin/soroban contract bindings typescript --wasm ./target/wasm32-unknown-unknown/release/abundance_token.wasm --id $(cat ./.soroban-example-dapp/abundance_token_id) --root-dir ./node_modules/abundance-token --network futurenet --contract-name abundance-token"
12+
"postinstall": "./target/bin/soroban contract bindings typescript --wasm ./target/wasm32-unknown-unknown/release/soroban_crowdfund_contract.wasm --id $(cat ./.soroban-example-dapp/crowdfund_id) --root-dir ./node_modules/crowdfund-contract --network $(cat ./.soroban-example-dapp/network) --contract-name crowdfund-contract && ./target/bin/soroban contract bindings typescript --wasm ./target/wasm32-unknown-unknown/release/abundance_token.wasm --id $(cat ./.soroban-example-dapp/abundance_token_id) --root-dir ./node_modules/abundance-token --network $(cat ./.soroban-example-dapp/network) --contract-name abundance-token"
1313
},
1414
"dependencies": {
1515
"@radix-ui/react-dialog": "1.0.2",

0 commit comments

Comments
 (0)