Skip to content

Commit

Permalink
Working against standalone (#36)
Browse files Browse the repository at this point in the history
* Add standalone network

* update dependencies to proper released versions

* Point the app at the standalone quickstart network

* Update quickstart image

* Get mint & deposit working w standalone

* Load network details from the wallet

* Fix typo

* Add networks to initialize.sh

* Fund the token_admin account from friendbot in initialize.sh

* Show proper name if configured

* Actually set the token admin 🤦

* Add backend setup to the readme
  • Loading branch information
paulbellamy authored Oct 10, 2022
1 parent 6bc932b commit 966676c
Show file tree
Hide file tree
Showing 19 changed files with 212 additions and 150 deletions.
108 changes: 51 additions & 57 deletions Cargo.lock

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

22 changes: 11 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ codegen-units = 1
lto = true

[patch.crates-io]
soroban-sdk = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "864a309b" }
soroban-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "864a309b" }
soroban-auth = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "864a309b" }
soroban-sdk-macros = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "864a309b" }
soroban-env-common = { git = "https://github.com/stellar/rs-soroban-env", rev = "fb8a384e" }
soroban-env-guest = { git = "https://github.com/stellar/rs-soroban-env", rev = "fb8a384e" }
soroban-env-host = { git = "https://github.com/stellar/rs-soroban-env", rev = "fb8a384e" }
soroban-env-macros = { git = "https://github.com/stellar/rs-soroban-env", rev = "fb8a384e" }
soroban-native-sdk-macros = { git = "https://github.com/stellar/rs-soroban-env", rev = "fb8a384e" }
stellar-xdr = { git = "https://github.com/stellar/rs-stellar-xdr", rev = "88ded341" }
wasmi = { package = "soroban-wasmi", git = "https://github.com/stellar/wasmi", rev = "a61b6df" }
soroban-sdk = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "3992556b" }
soroban-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "3992556b" }
soroban-auth = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "3992556b" }
soroban-sdk-macros = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "3992556b" }
soroban-env-common = { git = "https://github.com/stellar/rs-soroban-env", rev = "91cf595" }
soroban-env-guest = { git = "https://github.com/stellar/rs-soroban-env", rev = "91cf595" }
soroban-env-host = { git = "https://github.com/stellar/rs-soroban-env", rev = "91cf595" }
soroban-env-macros = { git = "https://github.com/stellar/rs-soroban-env", rev = "91cf595" }
soroban-native-sdk-macros = { git = "https://github.com/stellar/rs-soroban-env", rev = "91cf595" }
stellar-xdr = { git = "https://github.com/stellar/rs-stellar-xdr", rev = "5cca712b" }
wasmi = { package = "soroban-wasmi", git = "https://github.com/stellar/wasmi", rev = "d1ec0036" }
35 changes: 32 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,42 @@ backed by smart contracts on Stellar.

## Getting Started

### Backend
### Backend (Local Sandbox)

1. Install the soroban-cli from https://soroban.stellar.org/docs/getting-started/setup#install-the-soroban-cli
2. Run `./initialize.sh` to load the contracts and initialize it.
2. Run the backend with `soroban-cli serve`
3. Run `./initialize.sh sandbox` to load the contracts and initialize it.
- Note: this will create a `.soroban` sub-directory, to contain the sandbox
network data.
3. Run the backend with `soroban-cli serve`
4. Configure Freighter
a. Install the custom Freighter Soroban release from https://github.com/stellar/freighter/releases/tag/v2.6.0-beta.2
b. Enable "Experimental Mode" in the settings (gear icon).
c. Add a custom network:
| Name | Sandbox |
| URL | http://localhost:8000/soroban/rpc |
| Passphrase | Local Sandbox Stellar Network ; September 2022 |
| Allow HTTP connection | Enabled |
| Switch to this network | Enabled |

### Backend (Local Standalone Network)

1. Install the soroban-cli from https://soroban.stellar.org/docs/getting-started/setup#install-the-soroban-cli
2. Run the backend docker container with `./quickstart.sh standalone`, and wait for it to start.
3. Run `./initialize.sh standalone` to load the contracts and initialize it.
- Note: this state will be lost if the quickstart docker container is removed.
4. Configure Freighter
a. Install the custom Freighter Soroban release from https://github.com/stellar/freighter/releases/tag/v2.6.0-beta.2
b. Enable "Experimental Mode" in the settings (gear icon).
c. Add a custom network:
| Name | Standalone |
| URL | http://localhost:8000/soroban/rpc |
| Passphrase | Standalone Network ; February 2017 |
| Allow HTTP connection | Enabled |
| Switch to this network | Enabled |
5. Add some standalone network lumens to your Freighter wallet.
a. Copy the address for your freighter wallet.
b. Visit `http://localhost:8000/friendbot?addr=<your address>`


### Frontend

Expand Down
2 changes: 1 addition & 1 deletion components/molecules/deposits/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface IDepositsProps {
export function Deposits(props: IDepositsProps) {
const useLoadDeposits = (): ContractValue => {
return useContractValue(
Constants.CrowndfundId,
Constants.CrowdfundId,
'balance',
accountIdentifier(
SorobanSdk.StrKey.decodeEd25519PublicKey(props.address)
Expand Down
Loading

0 comments on commit 966676c

Please sign in to comment.