From 49ef26d7ad0bbfc5484fa973c1674cc479904fa4 Mon Sep 17 00:00:00 2001 From: Esteban Date: Mon, 7 Aug 2023 09:15:41 -0400 Subject: [PATCH 01/12] add setup instructions (#128) --- README.md | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b9c85db3..114c31ab 100755 --- a/README.md +++ b/README.md @@ -11,21 +11,26 @@ Getting Started Install Dependencies -------------------- - -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. -2. If you want to run everything locally: `docker` (you can run both Standalone and Futurenet backends with it) -3. Node.js v18 -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). -5. If you want to run everything locally, build the `soroban-preview` docker image: +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, 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: `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 - Building the docker image lets you avoid installing the specific version of soroban-cli in step (1), if desired. -6. **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. + +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. Run Backend ----------- +Make sure to start from a clean setup: +``` +npm run clean +``` + You have three options: 1. Deploy on [Futurenet](https://soroban.stellar.org/docs/getting-started/deploy-to-futurenet) using a remote [RPC](https://soroban.stellar.org/docs/getting-started/run-rpc) endpoint, 2. Run your own Futerenet RPC node with Docker and deploy to it, 3. run in [localnet/standalone](https://soroban.stellar.org/docs/getting-started/deploy-to-a-local-network) mode. ### Option 1: Deploy on Futurenet From 0d20c1bf06bb6704ed2873acb89dff392d9e3e81 Mon Sep 17 00:00:00 2001 From: Tyler van der Hoeven Date: Fri, 11 Aug 2023 12:38:57 -0400 Subject: [PATCH 02/12] Build/better gen (#132) * build: directly generate js libs to node_modules Roll back https://github.com/stellar/soroban-example-dapp/pull/122, but keep `crowdfund-contract` and `abundance-token` in `optionalDependencies`. As I worked with the old version in earnest, iterating on a local copy of the CLI and generating new JS libs over and over, the two-step generate-to-.soroban, then install-to-node_modules wasn't working very well. Probably because the new library wasn't being added until the `postinstall` step, and the dependencies are optional. Generating directly to `node_modules` feels dirty, but it works consistently. At least in this version, you can still see the dependencies listed in the `optionalDependencies` section, so they're not quite as surprising/mysterious. * build: try adding back optionalDeps * build: update node; use preinstall and local deps * Update package-lock.json * work around a bug in the binding gen --------- Co-authored-by: Chad Ostrowski <221614+chadoh@users.noreply.github.com> --- .gitattributes | 1 + .github/workflows/nodejs.yml | 2 +- .nvmrc | 2 +- components/molecules/form-pledge/index.tsx | 8 +- package-lock.json | 4143 ++------------------ package.json | 14 +- 6 files changed, 413 insertions(+), 3757 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..f3c54b5f --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +package-lock.json linguist-generated=true -diff diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 0aacbff6..5e10af21 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -26,7 +26,7 @@ jobs: - run: cargo install_soroban - uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: 18.14.2 cache: 'npm' - run: | mkdir -p .soroban-example-dapp diff --git a/.nvmrc b/.nvmrc index 3c032078..bac88e32 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -18 +>=18.14.2 diff --git a/components/molecules/form-pledge/index.tsx b/components/molecules/form-pledge/index.tsx index 22addf5b..d38b3683 100644 --- a/components/molecules/form-pledge/index.tsx +++ b/components/molecules/form-pledge/index.tsx @@ -29,14 +29,14 @@ function MintButton({ account, symbol, onComplete, decimals }: { decimals: numbe const [isSubmitting, setSubmitting] = useState(false) const displayAmount = 100 - const amount = BigInt(displayAmount * 10**decimals) + const amount = BigInt(displayAmount * 10 ** decimals) return (