Skip to content

Commit

Permalink
[Soroban Merge] Dapps Challenge (#497)
Browse files Browse the repository at this point in the history
* Add dapps challenge (#487)

* Add Dapps Challenge to Docs

Todo: user dashboard visibility

* add hide unless dapps

* update user card

* update checkpoints

* add user dashboard to dapps challenges

* Update Dapp Challenge Description

* Update tsconfig.json

* fix tsconfig.json

* small grammar fixes

* small grammar fixes

* small grammar fixes

* small grammar fixes

* small grammar fixes

* update challenge 0 and 1 ; add images for challenge 2

* Capitalize Futurenet; lowercase Dapp when needed

* disclaimer; nit crowdfunding -> crowdfund

* Update challenge-0-crowdfund.mdx

* update layout and guides

* Update smart-contracts.mdx

* update content

* add links

* nit update soroban quickstart

* Update react.mdx

* Update challenge-0-crowdfund.mdx

* update start course redirect

* we -> you

* update wrangler endpoint to stellar cloudflare

* update wrangler endpoint

* add module resolution and jsx

* add wrong network page; remove unused code; add vercel.app checking

* update wallets conclusion

* nit Update wallets.mdx

* nit update broken link

* Freighter -> WalletData Component

* update crowdfund dapps challenge for P10

* Fix Setup

* update docker workflow; add better notes

* nit standalone docker requirement

* re-enable .vercel.app check; move ParentChallengeForm

* move Login function

* fixed automatic log in problem

* comment out connection check

* comment out auto connect hook; nit Login -> Connect

* removed unused setLoading() changed order of operations

* update to checkout challenge branch

* completed challenge message = clickable url

* remember user is logged in

* setup `BrowserOnly`

* Update yarn.lock

* Update yarn.lock

* merge main into dapps challenge

* Update yarn.lock

* nit: refresh message

* add disconnect button comment; better connection insight

* update contract initialization to use strings

* auto populate url; add resubmit; fix broken invoke

* add setSavedUrl; improve url auto populate

* improve local storage for pubkey

---------

Co-authored-by: Bri <92327786+briwylde08@users.noreply.github.com>

* Update initialization.mdx (#518)

* editorial nits for dapps challenge (#544)

* editorial nits on crowdfund dapp

* editorial nits in payment dapp challenge

* Add scaffold soroban (#545)

* Create scaffold-soroban.mdx

* add video embed

* reformat code call outs; add conclusion

* Update scaffold-soroban.mdx

* nit: link sc

* nit add rpc link

* add definition to soroban RPC

* update deep dive section

* dApp -> dapp

* remove atomic swap description

* update simulate txn section; copy edits

* update intro to dapps

* nit:fix link

* update links; edit copy

* nit:typo

* SDC UI upgrades (#542)

* Update index.tsx

* update kv:worker endpoint

* Update index.tsx

* Add Root component, finish-step-button, update styles

* Add library for toast notifications, show milestone notification

* Add class for HttpClient, functions for requests

* Changed backend model, finalize user progress on course

* Add confetti effect on complete button click, refactor

* Remove mocks, use endpoint, fix issues

* Merge Development into main (#2)

* update kv:worker endpoint

* Update index.tsx

* Add Root component, finish-step-button, update styles

* Add library for toast notifications, show milestone notification

* Add class for HttpClient, functions for requests

* Changed backend model, finalize user progress on course

* Add confetti effect on complete button click, refactor

* Remove mocks, use endpoint, fix issues

---------

Co-authored-by: Iryna Telesheva <iryna.telesheva@intellecteu.com>
Co-authored-by: Iryna Telesheva <131377033+itelesheva@users.noreply.github.com>

* Add Dashboard for Dapps challenges (#3)

* Added dashboard component, styled cards

* Added DashboardHeader, Leaderboard component, tabs, styles

* Added ChallengesList component, updated login logic, tabs

* Refactor existing approach, update models, add filtering

* Add UI folder, add id for switcher and random avatar generating

* Remove old dashboard components, rename util file

* Add dashboard link to dapps sidebar instead of navbar

* Add TODOs, rename component

* Fix issues

* Add Dashboard for Dapps challenges (#3) (#4)

* Added dashboard component, styled cards

* Added DashboardHeader, Leaderboard component, tabs, styles

* Added ChallengesList component, updated login logic, tabs

* Refactor existing approach, update models, add filtering

* Add UI folder, add id for switcher and random avatar generating

* Remove old dashboard components, rename util file

* Add dashboard link to dapps sidebar instead of navbar

* Add TODOs, rename component

* Fix issues

Co-authored-by: Iryna Telesheva <131377033+itelesheva@users.noreply.github.com>

* Merge SDC from julian-dev28:main to Stellar:SSDC23 (#541)

* Update index.tsx

* update kv:worker endpoint

* Update index.tsx

* Add Root component, finish-step-button, update styles

* Add library for toast notifications, show milestone notification

* Add class for HttpClient, functions for requests

* Changed backend model, finalize user progress on course

* Add confetti effect on complete button click, refactor

* Remove mocks, use endpoint, fix issues

* Merge Development into main (#2)

* update kv:worker endpoint

* Update index.tsx

* Add Root component, finish-step-button, update styles

* Add library for toast notifications, show milestone notification

* Add class for HttpClient, functions for requests

* Changed backend model, finalize user progress on course

* Add confetti effect on complete button click, refactor

* Remove mocks, use endpoint, fix issues

---------

Co-authored-by: Iryna Telesheva <iryna.telesheva@intellecteu.com>
Co-authored-by: Iryna Telesheva <131377033+itelesheva@users.noreply.github.com>

* Add Dashboard for Dapps challenges (#3) (#4)

* Added dashboard component, styled cards

* Added DashboardHeader, Leaderboard component, tabs, styles

* Added ChallengesList component, updated login logic, tabs

* Refactor existing approach, update models, add filtering

* Add UI folder, add id for switcher and random avatar generating

* Remove old dashboard components, rename util file

* Add dashboard link to dapps sidebar instead of navbar

* Add TODOs, rename component

* Fix issues

Co-authored-by: Iryna Telesheva <131377033+itelesheva@users.noreply.github.com>

---------

Co-authored-by: Iryna Telesheva <iryna.telesheva@intellecteu.com>
Co-authored-by: Iryna Telesheva <131377033+itelesheva@users.noreply.github.com>

* Update the user workflow for the challenges with CI/CD (#5)

* Update the Crowdfund challenge with pull request validation step info

* Refactor

* Add isPullRequestRequired field handling

* Update text for Crowdfund checkpoint 8

* Make isPullRequestRequired required

* Fix issue with dates

* Merge branch 'main' into SSDC23

* Update challenge-0-crowdfund.mdx

---------

Co-authored-by: Iryna Telesheva <iryna.telesheva@intellecteu.com>
Co-authored-by: Iryna Telesheva <131377033+itelesheva@users.noreply.github.com>

* Updated mdx files on dapps (#525)

* Fixed typos in dapps section
* Fixed typos in fundamentals-and-concepts section

* Add lp dapp challenge (#543)

* Create challenge-2-liquidity-pool

* update lp dapp challenge

* complete lp-dapp challenge

* nit spelling

* Update challenge-2-liquidity-pool.mdx

* nit spelling

* nit add steps to workflow

* nit update workflow

* update workflow again

* add diff

* edit diff

* more diff editing

* editorial edits

* Update dapps/dapp-challenges/challenge-2-liquidity-pool.mdx

Co-authored-by: Elliot Voris <elliot@stellar.org>

* Update dapps/dapp-challenges/challenge-2-liquidity-pool.mdx

Co-authored-by: Elliot Voris <elliot@stellar.org>

* Update dapps/dapp-challenges/challenge-2-liquidity-pool.mdx

Co-authored-by: Elliot Voris <elliot@stellar.org>

* Update dapps/dapp-challenges/challenge-2-liquidity-pool.mdx

Co-authored-by: Elliot Voris <elliot@stellar.org>

* Update dapps/dapp-challenges/challenge-2-liquidity-pool.mdx

Co-authored-by: Elliot Voris <elliot@stellar.org>

* add reference to earlier step; fix conflict in crowdfund dapp page

* update quickstart version

* small wording change

---------

Co-authored-by: Bri Wylde <92327786+briwylde08@users.noreply.github.com>
Co-authored-by: Elliot Voris <elliot@stellar.org>

* Update Futurenet to Testnet Across Documentation (#577)

* Futurenet -> Testnet

* fix broken links

* update-rpc-page

* Update testnet.mdx

* Pass 1

* format

* update table in testnet.mdx

* update state expiration example script to use testnet

* replacing futurenet with testnet in contract deployment example

* revert SDC contnet

* include testnet network passphrase on releases page

* update freighter to include testnet alongside futurenet

* revert SDC to Use Futurenet for the time being

* style: fix up markdown syntax and style in `rpc.mdx`

Also adds some small linguistic and grammer changes, as well as more
updates from Futurenet to Testnet

* docs: include Testnet when describing what RPC servers SDF maintains

* style: changing a single ellipsis character with three periods

* docs: include gh repo links to the software that runs in quickstart

* add the Testnet network to the example `initialize.sh` script

* change contract-invoking transaction example code to use Testnet

* change to valid futurenet URLs in dapp challenges

* Apply suggestions from code review

minor tweaks that slipped through the cracks

---------

Co-authored-by: Elliot Voris <elliot@stellar.org>

* Soroban Dapps Challenge: Update Sidebar and Remove Local Deployment (#597)

* remove challenges top level dropdown; remove local deployment

* update Soroban version

* Prevent Popup for Testnet

* Leaderboard and Freighter API integration (#598)

* Add leaderboard with wallet integration feature

* Update index.tsx

* Add total value locked logic with reseting user data

* Refactor reset logic

* Refactor sorting

* Revert TVL for payment

* Update resubmit contract id logic

* Fix resubmiting contractId

* Add pagination and wallet address to leaderboard

* Change columns order

* Allow payment be completed

* User submit ContractID

* use GH token

* use npm instead of yarn

* Update main.yml

* revert back to yarn

* use https for wallets kit

* try access token

* use new github token

* set up to use git https

* last random try

* Update main.yml

* use default settings

* set origin for wallets-kit

* trying npm again

* nit: use npm for scripts

* Remove stellar wallets kit; add support for users w no progredd

* nit: phrasing

* Use Original GH Action

* Show user address

* nit: phrasing

* nit: connect message

* add missing cd

---------

Co-authored-by: Julian Martinez <73849597+Julian-dev28@users.noreply.github.com>
Co-authored-by: Julian Martinez <julian_martinez28@outlook.com>

* update leaderboard ranking toggle (#609)

* Corrected calculation of total pages so that 'Prev' and 'Next' buttons are disabled when table contains less than 10 rows. (#611)

* Add tabs to dapps challenge checkpoints (#610)

* Update challenge-0-crowdfund.mdx

* Add tabs to interaction step

* add tabs to checkpoints

* feat: provide a means of receiving simple feedback from users (#587)

* feat: provide a means of receiving simple feedback from users

Here, we have swizzled (ejected) the `DocItem/Footer` component
from docusaurus, and are inserting our own `ReaderFeedback`
component into it before the rest of the doc footer content.
Also, the `custom.scss` file has been used to style this element
in a consistent manner with the rest of the site.

This is the first step to resolve #586: The user interaction can
now take place. From here, we will work on integrating the custom
events into Google analytics. Ultimately, we will like to implment
this feature into the `stellar-docs` repository, as well.

Refs: #586

* Moving some React state things around

* Including an `alt` tag for the like/dislike buttons

* use the `pageId` for `eventLabel` in the send event

* style: Linting the code

* style: changing inline svg tag to be on newlines, changine filename to `jsx`

* feat: Inserting the `DocItem/Footer` components on `dapps` and `api` pages

* feat: migrating to the GA4 plugin in docusaurus

* Testing with a new ga4 tracking id for preview domain

* add some console statements to test what's happening

* add configuration for test gtag container for this pr preview

* feat: use `gtag` over the deprecated `ga` function

* adding my own test gtag?

* Remove the `gtag` function call, and just register state

* removing the old-style google analytics tag for good

* remove staging tag manager containers in preparation for production

* replace staging ga4 tracking id with production tracking id

* use `@site/static` for feedback button imports, rename file extension

* Remove docker image hashes (#628)

* remove mentions of specific image hashes in docker commands

* update docker image hash to most recent version on releases page

* Update Soroban Dapps Challenge copy (#631)

* update redeployment section

* add description for deployment

* update links

* add note about building `target`

* Update challenge-0-crowdfund.mdx

* Update challenge-2-liquidity-pool.mdx

* Sdc mental models: payment dapp upgrades (#641)

* bringing sdc-mental-models branch up to date (#632)

* feat: provide a means of receiving simple feedback from users (#587)

* feat: provide a means of receiving simple feedback from users

Here, we have swizzled (ejected) the `DocItem/Footer` component
from docusaurus, and are inserting our own `ReaderFeedback`
component into it before the rest of the doc footer content.
Also, the `custom.scss` file has been used to style this element
in a consistent manner with the rest of the site.

This is the first step to resolve #586: The user interaction can
now take place. From here, we will work on integrating the custom
events into Google analytics. Ultimately, we will like to implment
this feature into the `stellar-docs` repository, as well.

Refs: #586

* Moving some React state things around

* Including an `alt` tag for the like/dislike buttons

* use the `pageId` for `eventLabel` in the send event

* style: Linting the code

* style: changing inline svg tag to be on newlines, changine filename to `jsx`

* feat: Inserting the `DocItem/Footer` components on `dapps` and `api` pages

* feat: migrating to the GA4 plugin in docusaurus

* Testing with a new ga4 tracking id for preview domain

* add some console statements to test what's happening

* add configuration for test gtag container for this pr preview

* feat: use `gtag` over the deprecated `ga` function

* adding my own test gtag?

* Remove the `gtag` function call, and just register state

* removing the old-style google analytics tag for good

* remove staging tag manager containers in preparation for production

* replace staging ga4 tracking id with production tracking id

* use `@site/static` for feedback button imports, rename file extension

* rpc: rename expirationLedgerSeq to liveUntilLedgerSeq (#625)

* rpc: rename expirationLedgerSeq to liveUntilLedgerSeq

* rpc: rename expiration ledger in openrpc file

---------

Co-authored-by: Elliot Voris <elliot@stellar.org>

* Remove docker image hashes (#628)

* remove mentions of specific image hashes in docker commands

* update docker image hash to most recent version on releases page

* Update WASM retrieval tutorial (#627)

* docs: explain the diagnostic events that are emitted in sandbox (#593)

* docs: explain the diagnostic events that are emitted in sandbox

Perhaps this approach is too verbose? I think having the explanation
of what is being seen right there in the tutorial is useful at this
early step in the "getting started" section. A new developer is more
likely to understand what they see, and remember what it is in the
future if we don't try to interrupt their flow at this point by
sending them to another page for some (possibly irrelevant) info.

I may be incorrect there, and I'm happy to hear opinions from others.

Refs: #521

* docs: add a space between two words

* editorial in Update hello-world.mdx

---------

Co-authored-by: Bri Wylde <92327786+briwylde08@users.noreply.github.com>

* Fix a couple typos in rust-dialect.mdx (#630)

---------

Co-authored-by: Elliot Voris <elliot@stellar.org>
Co-authored-by: Alfonso Acosta <fons@syntacticsugar.consulting>
Co-authored-by: George <Shaptic@users.noreply.github.com>
Co-authored-by: Bri Wylde <92327786+briwylde08@users.noreply.github.com>
Co-authored-by: Sapo-Dorado <nobrown@sbcglobal.net>

* Crowdfund dapp copy updates v1

Added in some (minimal) context throughout.
Tidied up a few grammatical/spelling inconsistencies.

* add description and update "ship it" workflow

* update soroban-cli install

* Update challenge-0-crowdfund.mdx

* remove extra vercel link

* Merge branch 'main' into sdc-mental-models

* Add intro to dapps

* nit formatting

* Payment dapp copy updates

Updates to Checkpoints 0-4 of the Payment dapp challenge, including added copy and a few very minor grammatical upgrades.

* add more context

* Merge Payment dapp fix (#643)

* Update latest testnet-compatible JavaScript release versions (#634)

* Update latest testnet-compatible JavaScript release versions

* Add links to release notes for each version

* Upgrade `getLedgerEntries` examples to latest pre-stable releases of the SDKs (#635)

Co-authored-by: Elliot Voris <elliot@stellar.org>

* Switch Ubuntu base image to 22.04 from 20.04 (#638)

Signed-off-by: Satyam Zode <satyamz@users.noreply.github.com>
Co-authored-by: Satyam Zode <satyamz@users.noreply.github.com>

* Update getting-started for 20.0.0-rc.4.1 cli (#636)

* Updates to setup.mdx

* Add CLI for testnet configuration to Setup

* Updates to hello-world.mdx

Reorder some code snippets to be after the description

* Small edits in storing-data.mdx

* Add high_expiration_watermark argument to bump in incrementor

* Move deploy-to-testnet after hello-world to allow the user to interact with their contract on testnet

* Add Optimizing Builds to hello-world

* Update storing-data to remove sandbox interation

* Add a deploy-incrementor-to-testnet step

* Update position of Create an App

* Apply suggestions from code review

Co-authored-by: Chad Ostrowski <221614+chadoh@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Chad Ostrowski <221614+chadoh@users.noreply.github.com>

* Update create-an-app.mdx

* Fix typo

* Add a mv command for .soroban dir when reorganizing to a multi-contract project

* Apply mdx prettier updates

* Update astro port in create-an-app.mdx

* Apply suggestions from code review

Co-authored-by: Elliot Voris <elliot@voris.me>

* Add .mdx to end of internal markdown links for docusaurus magic

* Make sure there are new lines before and after ::: tags

* Some additional edits/improvements

* Mention that Freighter is available as a firefox add-on

* Update the deploy-incrementor url

* Apply prettier updates

---------

Co-authored-by: Chad Ostrowski <221614+chadoh@users.noreply.github.com>
Co-authored-by: Elliot Voris <elliot@voris.me>

* docs: change preflight wording to simulate transaction (#585)

* docs: change preflight wording to simulate transaction

A first attempt to resolve #478, there may be more work to be done.
I've used a few different phrases, depending on how the sentence
structure works, perhaps taking some liberties in the process.

I've also left alone the `releases` page for preview releases
older than 11. It seems unnecessary to rewrite the development
history too far into the past.

Refs: #478

* editorial on Update interacting-with-contracts.mdx

* added a couple "the"s Update state-expiration.mdx

* fix wording about ledger entries to be less confusing

* clearing up some other language surrounding footprints

---------

Co-authored-by: Bri Wylde <92327786+briwylde08@users.noreply.github.com>

* Create data-providers.mdx (#629)

* Create data-providers.mdx

Adding new page for data providers to cover indexers and block explorers

* Update data-providers.mdx

updated explanation text

* style: fixing some markdown styles and formatting

* Adding some more verbose descriptions and links

---------

Co-authored-by: Elliot Voris <elliot@stellar.org>

* docs: change sitewide wording from "preview release" to "release candidate" (#639)

* docs: update welcome page "preview release" > "release candidate"

* docs: change "preview release" > "release candidate" on releases page

* update payment challenge; add styles

* add clickable object to localhost:9000 example

* Update challenge-1-payment.mdx

* Squashed commit of the following:

commit 76c48ccd8049bca6bb11f131cefb35253dad86b2
Author: Julian Martinez <julian_martinez28@outlook.com>
Date:   Wed Nov 8 10:10:12 2023 -0800

    add more context

---------

Signed-off-by: Satyam Zode <satyamz@users.noreply.github.com>
Co-authored-by: George <Shaptic@users.noreply.github.com>
Co-authored-by: Elliot Voris <elliot@stellar.org>
Co-authored-by: Satyam Zode <5508956+satyamz@users.noreply.github.com>
Co-authored-by: Satyam Zode <satyamz@users.noreply.github.com>
Co-authored-by: Elizabeth <emengelman@gmail.com>
Co-authored-by: Chad Ostrowski <221614+chadoh@users.noreply.github.com>
Co-authored-by: Elliot Voris <elliot@voris.me>
Co-authored-by: Bri Wylde <92327786+briwylde08@users.noreply.github.com>
Co-authored-by: jcx120 <91218921+jcx120@users.noreply.github.com>

* format image

* Squashed commit of the following:

commit 308444d93d4f7133107ca499a6d255fe5ae302d4
Author: Julian Martinez <julian_martinez28@outlook.com>
Date:   Wed Nov 8 14:55:06 2023 -0800

    update copy

commit ec062702a5a900ff890bf5cc99dfd9b6dbe1915a
Author: Julian Martinez <julian_martinez28@outlook.com>
Date:   Wed Nov 8 12:34:07 2023 -0800

    add styles for lp

commit f7bbf2e61a262aa6dd76bed2f43cd26aafce075b
Author: Julian Martinez <julian_martinez28@outlook.com>
Date:   Wed Nov 8 12:13:49 2023 -0800

    add image styles

* update copy for production deployment

* caution -> tip

* add commas, add soroban-cli install to payment dapp

* fix broken link

* Squashed commit of the following:

commit 7de8a99ec32065376ea4fd2f42a14194cdda6e49
Author: Elliot Voris <elliot@stellar.org>
Date:   Thu Nov 9 15:47:49 2023 -0600

    docs: move data providers page out of sdks directory (#645)

commit 55e0a866c6dbbe2b4dd38f38816915d59c962584
Author: Elliot Voris <elliot@stellar.org>
Date:   Tue Nov 7 11:40:20 2023 -0600

    docs: change sitewide wording from "preview release" to "release candidate" (#639)

    * docs: update welcome page "preview release" > "release candidate"

    * docs: change "preview release" > "release candidate" on releases page

commit 2ae107280eb4bfee7192e7bdabf704c80ffab43c
Author: jcx120 <91218921+jcx120@users.noreply.github.com>
Date:   Tue Nov 7 08:48:50 2023 -0800

    Create data-providers.mdx (#629)

    * Create data-providers.mdx

    Adding new page for data providers to cover indexers and block explorers

    * Update data-providers.mdx

    updated explanation text

    * style: fixing some markdown styles and formatting

    * Adding some more verbose descriptions and links

    ---------

    Co-authored-by: Elliot Voris <elliot@stellar.org>

commit 0054011876a8273788a5bf6de16623683c9159d2
Author: Elliot Voris <elliot@stellar.org>
Date:   Mon Nov 6 11:00:02 2023 -0600

    docs: change preflight wording to simulate transaction (#585)

    * docs: change preflight wording to simulate transaction

    A first attempt to resolve #478, there may be more work to be done.
    I've used a few different phrases, depending on how the sentence
    structure works, perhaps taking some liberties in the process.

    I've also left alone the `releases` page for preview releases
    older than 11. It seems unnecessary to rewrite the development
    history too far into the past.

    Refs: #478

    * editorial on Update interacting-with-contracts.mdx

    * added a couple "the"s Update state-expiration.mdx

    * fix wording about ledger entries to be less confusing

    * clearing up some other language surrounding footprints

    ---------

    Co-authored-by: Bri Wylde <92327786+briwylde08@users.noreply.github.com>

commit b9710ea0ea6c4652aea2019504534197195a2b3a
Author: Elizabeth <emengelman@gmail.com>
Date:   Mon Nov 6 11:59:21 2023 -0500

    Update getting-started for 20.0.0-rc.4.1 cli (#636)

    * Updates to setup.mdx

    * Add CLI for testnet configuration to Setup

    * Updates to hello-world.mdx

    Reorder some code snippets to be after the description

    * Small edits in storing-data.mdx

    * Add high_expiration_watermark argument to bump in incrementor

    * Move deploy-to-testnet after hello-world to allow the user to interact with their contract on testnet

    * Add Optimizing Builds to hello-world

    * Update storing-data to remove sandbox interation

    * Add a deploy-incrementor-to-testnet step

    * Update position of Create an App

    * Apply suggestions from code review

    Co-authored-by: Chad Ostrowski <221614+chadoh@users.noreply.github.com>

    * Apply suggestions from code review

    Co-authored-by: Chad Ostrowski <221614+chadoh@users.noreply.github.com>

    * Update create-an-app.mdx

    * Fix typo

    * Add a mv command for .soroban dir when reorganizing to a multi-contract project

    * Apply mdx prettier updates

    * Update astro port in create-an-app.mdx

    * Apply suggestions from code review

    Co-authored-by: Elliot Voris <elliot@voris.me>

    * Add .mdx to end of internal markdown links for docusaurus magic

    * Make sure there are new lines before and after ::: tags

    * Some additional edits/improvements

    * Mention that Freighter is available as a firefox add-on

    * Update the deploy-incrementor url

    * Apply prettier updates

    ---------

    Co-authored-by: Chad Ostrowski <221614+chadoh@users.noreply.github.com>
    Co-authored-by: Elliot Voris <elliot@voris.me>

commit 61054dcad82dbf77c28aa1819ad08b6fa132ad70
Author: Satyam Zode <5508956+satyamz@users.noreply.github.com>
Date:   Fri Nov 3 20:26:27 2023 +0530

    Switch Ubuntu base image to 22.04 from 20.04 (#638)

    Signed-off-by: Satyam Zode <satyamz@users.noreply.github.com>
    Co-authored-by: Satyam Zode <satyamz@users.noreply.github.com>

commit d6091131996ab81e42dff57f4bccaad3f5d56b3e
Author: George <Shaptic@users.noreply.github.com>
Date:   Thu Nov 2 12:53:52 2023 -0700

    Upgrade `getLedgerEntries` examples to latest pre-stable releases of the SDKs (#635)

    Co-authored-by: Elliot Voris <elliot@stellar.org>

commit 228e4bfed691effa58a07b664abfd78b04e6dcd4
Author: George <Shaptic@users.noreply.github.com>
Date:   Thu Nov 2 09:18:50 2023 -0700

    Update latest testnet-compatible JavaScript release versions (#634)

    * Update latest testnet-compatible JavaScript release versions

    * Add links to release notes for each version

* add SEO logic

---------

Signed-off-by: Satyam Zode <satyamz@users.noreply.github.com>
Co-authored-by: Elliot Voris <elliot@stellar.org>
Co-authored-by: Alfonso Acosta <fons@syntacticsugar.consulting>
Co-authored-by: George <Shaptic@users.noreply.github.com>
Co-authored-by: Bri Wylde <92327786+briwylde08@users.noreply.github.com>
Co-authored-by: Sapo-Dorado <nobrown@sbcglobal.net>
Co-authored-by: Julian Martinez <julian_martinez28@outlook.com>
Co-authored-by: Julian Martinez <73849597+Julian-dev28@users.noreply.github.com>
Co-authored-by: Satyam Zode <5508956+satyamz@users.noreply.github.com>
Co-authored-by: Satyam Zode <satyamz@users.noreply.github.com>
Co-authored-by: Elizabeth <emengelman@gmail.com>
Co-authored-by: Chad Ostrowski <221614+chadoh@users.noreply.github.com>
Co-authored-by: Elliot Voris <elliot@voris.me>
Co-authored-by: jcx120 <91218921+jcx120@users.noreply.github.com>

* Add oracle dapp challenge (#664)

* add oracle dapp

* update endpoint

* add images

* Update http-client.ts

* update challenge list

* add last checkpoint to oracle dapp

* Update http-client.ts

* update meta tag

* update title (#665)

* Liquidity Pool Dapp copy updates v2 (#651)

* Update challenge-2-liquidity-pool.mdx

* Update challenge-2-liquidity-pool.mdx

* Squashed commit of the following:

commit 1864016f07b4f91a0cd9656ca55c2d8c568a0d02
Author: Dmytro Kozhevin <dmytro@stellar.org>
Date:   Tue Dec 5 12:09:24 2023 -0500

    Remove some outdated cautions from the docs, now that Soroban should be stable. (#672)

commit 816e2a0e1f4e0f1e30c909b92b74b75081d3d3d7
Author: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com>
Date:   Tue Dec 5 08:48:10 2023 -0800

    Remove git init from hello world steps (#666)

commit 19b10a8f4c24e495f9dc04f10c694449e4f5a333
Author: Anuxhya <36203801+achallagundla@users.noreply.github.com>
Date:   Tue Dec 5 11:43:19 2023 -0500

    Update fees-and-metering.mdx (#654)

    * Update fees-and-metering.mdx

    Cleaning up the docs challenge 1 of the word s o r o b e r r y.

    * Update fees-and-metering.mdx

    Syntax error

commit 36cc17fca85efc1471e3aadfb29b0ca1687e536b
Author: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com>
Date:   Sat Dec 2 21:01:14 2023 -0800

    Update soroban-sdk to v20.0.0-rc2.2 (#667)

commit c5b01369ede0b78c2626013f2b43683f69db2905
Author: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com>
Date:   Fri Dec 1 09:41:37 2023 -0800

    Remove step adding target dir to gitignore (#660)

commit 214a207
Author: Julian Martinez <73849597+Julian-dev28@users.noreply.github.com>
Date:   Fri Dec 1 09:07:49 2023 -0800

    update title (#665)

commit 4b91088
Author: Julian Martinez <73849597+Julian-dev28@users.noreply.github.com>
Date:   Fri Dec 1 08:36:59 2023 -0800

    Add oracle dapp challenge (#664)

    * add oracle dapp

    * update endpoint

    * add images

    * Update http-client.ts

    * update challenge list

    * add last checkpoint to oracle dapp

    * Update http-client.ts

    * update meta tag

commit 595d591e97b946a971a51f73520deb3341be6476
Author: Bri Wylde <92327786+briwylde08@users.noreply.github.com>
Date:   Thu Nov 30 11:53:53 2023 -0700

    clearer Soroban favicon (#662)

commit dc14811ded524a6f2d0026b5d1cce19ad4df7827
Author: Elliot Voris <elliot@stellar.org>
Date:   Wed Nov 29 16:11:19 2023 -0600

    synchronize api example tabs across pages (#661)

commit 4f1198cfde2df402c0e74f1145828423c39e29ea
Author: Elliot Voris <elliot@stellar.org>
Date:   Wed Nov 29 13:01:38 2023 -0600

    Revert "Update getting started tutorial to use an Astro template (#642)" (#658)

    This reverts commit 512b1f46506b7edc788bc6e93a0e1f6d101d22ae.

commit 81cac0d3524a1a80ce2fadd88e93aa40ffde791b
Author: Elliot Voris <elliot@stellar.org>
Date:   Mon Nov 27 16:29:57 2023 -0600

    build: a couple small fixes to get the build to work (#657)

    * build: a couple small fixes to get the build to work

    * style: changing the way a couple codefences work

commit 512b1f46506b7edc788bc6e93a0e1f6d101d22ae
Author: Elizabeth Engelman <4752801+elizabethengelman@users.noreply.github.com>
Date:   Mon Nov 27 13:00:32 2023 -0500

    Update getting started tutorial to use an Astro template (#642)

    * Update create-an-app.mdx to use an Astro template

    * Apply prettier formatting

    * Add some additional gotchas to the troubleshooting section

    * Reworks hello-world.mdx using the Astro template

    * Rework deploy-to-testnet.mdx to interact with the contarct via the frontend

    * Update storing-data.mdx

    * Update deploy-incrementor.mdx

    * Change create-an-app.mdx to wrapping-up.mdx

    * Apply prettier updates

    * Apply suggestions from code review

    Co-authored-by: Chad Ostrowski <221614+chadoh@users.noreply.github.com>

    * Address PR feedback

    - move "???" bummer to "taking it further"
    - add command expansion note to deploy-to-testnet
    - remove mention of incrementor in deploy-to-testnet

    * Small cleanup

    * Address PR feedback

    * Remove release-with-logs section

    * Update code snippets to match updated tutorial code

    * Apply suggestions from code review

    Co-authored-by: Elliot Voris <elliot@voris.me>

    * Address PR feedback

    * Check in prettier updates

    * update getting started links on the landing page

    * redirect the old create an app page to the hello world page

    ---------

    Co-authored-by: Chad Ostrowski <221614+chadoh@users.noreply.github.com>
    Co-authored-by: Elliot Voris <elliot@voris.me>
    Co-authored-by: Elliot Voris <elliot@stellar.org>

commit f04a865b519d05495932fbaaf5bd075c8438c4ef
Author: jcx120 <91218921+jcx120@users.noreply.github.com>
Date:   Mon Nov 27 09:23:53 2023 -0800

    Update rpc-list.mdx (#653)

    * Update rpc-list.mdx

    Added Gateway FM (and removed BlockEden since they are in the Data providers list)

    * style: linting mdx file

    ---------

    Co-authored-by: Elliot Voris <elliot@stellar.org>

commit a9e0d34f61080bf456219e68c018432370bf3bf0
Author: Elliot Voris <elliot@stellar.org>
Date:   Mon Nov 27 11:22:58 2023 -0600

    undo some changes from the docs scavenger hunt (#656)

* Revert "Squashed commit of the following:"

This reverts commit ada22fee5da3073cc3e4daee60a2c4f3ffc3e378.

* Update challenge-2-liquidity-pool.mdx

* add context to price setting

* Add v20.0.0 (#668)

* add P12 Release

* formatting

* Update releases.mdx

* formatting

* update horizon,stellar-base,cli

* add stellar sdk + base, soroban-client, Quickstart, changelog

* remove http from quickstart endpoint

* v20.0.0-rc2 -> v20.0.0

* Preview 12 -> Stable v20.0.0

* update CLI, RPC, Core Versions

* update stellar cor version

* Content updates to go along with the preview 12 version updates (#682)

* update the token interface to reflect the Rust SDK

* feat: get Getting Started ready for v20.0.x

I don't know what the exact version of the CLI will be out by next
Monday. In the source here, I've guessed that maybe it will be `20.0.3`.

* update `openrpc.json` file to reflect new updates

* Update static/openrpc.json

Co-authored-by: Alfonso Acosta <fons@syntacticsugar.consulting>

---------

Co-authored-by: Chad Ostrowski <221614+chadoh@users.noreply.github.com>
Co-authored-by: Molly Karcher <mdarkar@gmail.com>
Co-authored-by: Alfonso Acosta <fons@syntacticsugar.consulting>

* Update token-interface.mdx

* nit:formatting

---------

Co-authored-by: Elliot Voris <elliot@stellar.org>
Co-authored-by: Chad Ostrowski <221614+chadoh@users.noreply.github.com>
Co-authored-by: Molly Karcher <mdarkar@gmail.com>
Co-authored-by: Alfonso Acosta <fons@syntacticsugar.consulting>

* Update JavaScript SDK references to use the `@stellar/stellar-sdk` package (#687)

* Upgrade js sdk dependencies to latest

* Track down references to soroban-client and move them

* Ran linter

* Pre mainnet restructure (#644)

* docs: rename "fundamentals and concepts" to "soroban internals"

* docs: remove old "under the hood" section

* docs: add tags to the various tutorials

* docs: move tutorials into one main directory

* fix broken links to old pages

* docs: renaming soroban internals in category file

* docs: remove old "command line reference" category

* docs: add tokens directory, rearrange sidebars

* docs: rearrange migration from evm guide

* docs: remove unused reference/interfaces category

* docs: move "reference" section to "resources"

* docs: move "releases" page up a level

* docs: move FAQ page up one level

* docs: move dev tools into resources directory

* docs: move testnet.mdx to networks.mdx

* docs: rearrange items in resources directory

* docs: collapse various SDK pages into two pages

* docs: move data-providers up one level

* docs: remove some empty categories, move the tutorial template

* docs: add a new getting-started page, reorganize that section

* docs: change sidebar position integers in soroban-internals

* docs: shuffling contract interaction around in soroban-internals

* style: fixing a couple small markdown nits in dapps directory

* docs: fix a broken link

* feat: start to the "guides" page(s)

* style(lint): fixing a small linting error

* remove guides placeholder

* fixing broken links

* work on guides listing. might revert this

* formatting mdx

* docs: fixing a broken link to tutorials

* style: crack at making the tutorials filterable and hidden in the sidebar

* customizing some components for the `/guides` pages and layouts

* rename index page for guides to README

* remove commented configuration option

* remove some console logging in components

* change name of index page in guides sidebar

* remove commented sidebar generation code

* remove comments and add description to sidebar generator

* rename sidebar generator file

* more work on how the 'guides' pages might look.

* docs: adjusting sidebar positions of new getting started pages

* fix some broken links in the getting-started section

* prefer "README.mdx" files where possible

* some more guides placeholder stubs

* docs(guides): More placeholder stubs for guides and categories

* feat: don't display "guides in category" page on `/guides`

* build: check/fix MDX formatting in more directories than just docs

* style: add a larger margin before more category guides

* style: more selectively increase that top margin

* docs(guides): a quick stab at a "publishing" events guide

* docs(guides): first stab at the "publish events" guide

* docs: updating tutorial descriptions

* fix a few broken links

* docs: add note about a tuple with one element

* style: couple link changes and reformats

* move fuzzing tutorial back

* change to README file in contract interactions category

* docs(guides): give a better title for the wasm metadata guide

* fixing some broken markdown links

* fix (another!) broken link

* move the guides back into the main layout of the docs directory

* add placeholder for testnet reset automation stuff

* some initial content for some guides

* markdown formatting and fixing broken links

* moving "resources" back to "reference" to fit the definition better

More like "technical reference" rather than a "reference encyclopedia"

* change some styles of the tutorial list

* removing most category pages

* some more first-drafts of guides

* fixing some category links

* include a period at the end of each tutorial description

* simplify tutorial search box placeholder text

* better description for the tutorials page

* making the pre-commit script executable

* flesh out some of the state archival guides

* first effort for some rpc ledger key guides

* fix some broken links

* add a guide on ingesting events into a db

* first effort at storage type guides

* Some more stubs, marking drafts, and a couple additions

* make not a draft to fix a broken link

* guides category descriptions in README.mdx files

* marking incomplete chain migration docs as drafts

* change some tutorial difficulty levels

* fine-tune the tutorials component styling a bit

* improving some guides organization

* fix linting errors and broken links

* include wrap instructions for native lumens

* fix broken link in contract metadata guide

* final changes to existing guides

* moving developer tools into the main sidebar

* create real redirects instead of just notes

* fix broken links in a dapps challenge page

* fix a redirect syntax error

* fix a tutorials redirect

* update SDC leaderboard (#712)

* update leaderboard style

* update font color

* Refactor wrap/deploy of SAC (#718)

Co-authored-by: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com>
Co-authored-by: Elliot Voris <elliot@stellar.org>

* Refactor deprecated calls to `soroban config` (#731)

* Update the community RPC list (#744)

* Update RPC list with network info

* Add run your own RPC

* Fix urls for soroban cli

* Fix path to cli

* Fix relative link

* Add formatted mdx

---------

Co-authored-by: Jane Wang <janewang@Janes-MacBook-Pro.local>

* move dapps challenge directory into place

* install new packages for dapps-challenge

* delete mispelled constants file

* fix relative imports

* move challenges to pages directory, and use README files

* correct markdown link

* fix broken links in dapps challenge docs

* fix link routes in dapps challenge dashboard

* add /src/pages dir to markdown formatting checks; format markdown

* fix relative imports on dapps challenge dashboard

* move the dashboard location into the dapps URLs

* add dapps challenge dashboard to the sidebar

using a customized sidebar generator for this.

* remove soroban events provider component from challenge forms

* fix dashboard links on dapp challenge pages

* change some frontmater and remove head items from dapps challenges

* move the docker guide from dapps challenge to guides

* move the rest of the dapps challenge guides

* update and move around the dapps guides

* lint and format markdown

* redirect /dapps requests, just in case

* remove link to guide content that no longer exists

* add link to dapps challenge in footer

* add link to freighter guide on dapps challenge intro page

* Update Dapps Challenge name in sidebar

---------

Signed-off-by: Satyam Zode <satyamz@users.noreply.github.com>
Co-authored-by: Julian Martinez <73849597+Julian-dev28@users.noreply.github.com>
Co-authored-by: Bri <92327786+briwylde08@users.noreply.github.com>
Co-authored-by: Iryna Telesheva <iryna.telesheva@intellecteu.com>
Co-authored-by: Iryna Telesheva <131377033+itelesheva@users.noreply.github.com>
Co-authored-by: Alejandro Criado-Pérez <alejandro@criadoperez.com>
Co-authored-by: illiassmalashchuk <145133100+illiassmalashchuk@users.noreply.github.com>
Co-authored-by: Julian Martinez <julian_martinez28@outlook.com>
Co-authored-by: MazurakIhor <131388095+MazurakIhor@users.noreply.github.com>
Co-authored-by: nmadadair <109177652+nmadadair@users.noreply.github.com>
Co-authored-by: Alfonso Acosta <fons@syntacticsugar.consulting>
Co-authored-by: George <Shaptic@users.noreply.github.com>
Co-authored-by: Sapo-Dorado <nobrown@sbcglobal.net>
Co-authored-by: Satyam Zode <5508956+satyamz@users.noreply.github.com>
Co-authored-by: Satyam Zode <satyamz@users.noreply.github.com>
Co-authored-by: Elizabeth <emengelman@gmail.com>
Co-authored-by: Chad Ostrowski <221614+chadoh@users.noreply.github.com>
Co-authored-by: jcx120 <91218921+jcx120@users.noreply.github.com>
Co-authored-by: Molly Karcher <mdarkar@gmail.com>
Co-authored-by: Pamphile Roy <roy.pamphile@gmail.com>
Co-authored-by: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com>
Co-authored-by: Jane Wang <janelwang2008@gmail.com>
Co-authored-by: Jane Wang <janewang@Janes-MacBook-Pro.local>
  • Loading branch information
23 people committed Apr 24, 2024
1 parent 50e2602 commit d5684d3
Show file tree
Hide file tree
Showing 79 changed files with 5,959 additions and 11 deletions.
10 changes: 10 additions & 0 deletions docs/learn/interactive/dapps/README.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Dapps Challenge
sidebar_position: 60
---

import DocCardList from "@theme/DocCardList";

The Soroban Dapps Challenge is a dynamic course designed for developers eager to explore the potential of building decentralized applications (Dapps) on the Soroban smart contracts platform.

<DocCardList />
31 changes: 31 additions & 0 deletions docs/learn/interactive/dapps/introduction.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
sidebar_position: 10
title: Dapps on Soroban
sidebar_label: Introduction
---

Decentralized applications, or "dapps," mark a significant shift in our digital interactions, running on a blockchain or peer-to-peer network instead of centralized servers. This shift enhances transparency, security, and user control, as data and smart contracts are stored on a public ledger, open for audit by anyone. Soroban facilitates building and deploying dapps on the Stellar blockchain, offering tools and frameworks that simplify the development process for even those with minimal coding experience. The Soroban Dapps Challenge highlights this, enabling you to create a variety of dapp use cases on a single page in just 20 minutes, with minimal coding, guiding you from smart contract deployment to user interaction through a web frontend.

The Soroban Dapps Challenge is a dynamic course designed for developers eager to explore the potential of building decentralized applications (Dapps) on the Soroban smart contracts platform. This course is part challenge, part educational journey that sets the stage for practical and creative blockchain development.

While the course specifically focuses on the Soroban platform, the knowledge you gain can be applied to other transaction processors such as different blockchains, L2s, and permissioned ledgers. The skills you acquire here are meant to be transferable and versatile.

Through The Soroban Dapps Challenge, you'll have hands-on experience using Soroban's initial versions of the smart contracts environment, a Rust SDK, a CLI, and an RPC server. You'll learn how to write, test, and deploy smart contracts, and you'll get to see your code in action on Futurenet.

## What This Course Entails

We've designed this course as a learning adventure. It's a way for developers from the Stellar ecosystem and other blockchain communities to experiment, provide feedback, and contribute to the Soroban development process.

As you progress through The Soroban Dapps Challenge, anticipate your code to break and updates to shift things. We invite you to experiment and build but also remind you that changes are afoot as we prepare for the production release.

## Getting Started

To get started, simply head over to the [Dashboard](/docs/learn/interactive/dapps/dashboard), [connect your wallet](../../../smart-contracts/guides/freighter/connect-testnet.mdx), and see what challenges await you!

## Giving Your Feedback

We value your input. Feel free to file issues in the Soroban repos or raise them in the soroban channel in the Stellar Developer [Discord](https://discord.gg/3qrBhbwE).

Join us in this exciting course and start building for the future of blockchain technology.

> Disclaimer: The Soroban Dapps Challenge is for educational purposes only and is designed to teach developers how to write code using Soroban by experimenting in a Sandbox environment. None of the materials provided as part of the Soroban Dapps Challenge shall be construed as financial, legal, or investment advice. Any developers that wish to subsequently launch any Soroban Dapps live on mainnet acknowledge that they do so independently, outside of the Soroban Dapps Challenge program. All such developers should ensure they have considered any applicable legal and compliance obligations in force in their jurisdiction.
82 changes: 82 additions & 0 deletions docs/learn/interactive/dapps/scaffold-soroban.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
sidebar_position: 30
title: Scaffold Soroban
description: Dive into the simple implementations of Soroban dapps to understand and learn the Soroban ecosystem.
---

## Demonstrative Soroban Dapps

import ReactPlayer from "react-player";

The **Soroban** team has invested considerable effort into contract implementation. They’ve built CLI’s and libraries, enabling contract builders to create and invoke using Rust, which forms the “backend” of Soroban. However, the “frontend”, which involves JS client libraries, required attention.

## Background

During the Soroban Hackathon, we recognized that while the frontend libraries were functional, their user experience was far from ideal. Furthermore, the lack of clear examples made it harder for dapp creators to design and understand Soroban's UX.

To tackle this, the **Wallet Engineering** team, in collaboration with the Soroban team, has decided to launch “Scaffold Soroban”, a collection of demo dapps. These dapps demonstrate basic functionalities in a structured, easy-to-follow manner, primarily focusing on how to construct/deploy Soroban contract invocations.

## Dapp Demos

For easy accessibility, we have compiled the dapps into a [single repository](https://github.com/stellar/scaffold-soroban), which contains the following dapps:

### [1. Payment Dapp](https://github.com/stellar/soroban-react-payment)

This dapp mirrors the Soroban payment flow in Freighter by using the wallet’s Soroban token balances to invoke the `xfer` method on the token’s contract.

See the [demo](https://github.com/stellar/soroban-react-payment/releases/tag/v1.0.0)

<ReactPlayer
controls
url="https://user-images.githubusercontent.com/6789586/244450707-2ca53a9c-7493-47a1-aee6-cb126d6e32f8.mp4"
/>

### [2. Mint Token Dapp](https://github.com/stellar/soroban-react-mint-token)

This dapp allows a token admin to mint tokens by using the admin account to invoke the `mint` method on the token’s contract.

See the [demo](https://github.com/stellar/soroban-react-mint-token/releases/tag/v1.0.0)

<ReactPlayer
controls
url="https://user-images.githubusercontent.com/6886006/246495488-1b02da2c-5119-47c6-ab38-fbaa73a26f12.mov"
/>

### [3. Atomic Swap Dapp](https://github.com/stellar/soroban-react-atomic-swap)

This dapp demonstrates a simplified swap between two tokens by using the wallet’s Soroban token balances to invoke the `swap` method on the atomic swap contract.

See the [demo](https://github.com/stellar/soroban-react-atomic-swap/releases/tag/v1.0.0)

<ReactPlayer
controls
url="https://user-images.githubusercontent.com/6886006/258894451-19f4363b-e6e3-4d32-973a-6d99fd0d9847.mov"
/>

## How To Explore the Dapps on Scaffold-Soroban

To begin using these examples, navigate to [Scaffold-Soroban](https://scaffold-soroban.stellar.org/) and choose the name of the dapp you're interested in from the "select demo" dropdown:

- **Payment**: Choose "payment".
- **Token Minter**: Select "mint-token".
- **Atomic Swap**: Opt for "atomic-swap".

Dive in and discover the power of Soroban!

## Functionality Behind the Dapps

With the introduction of these dapps, let's delve deeper into some of their [standout features](https://github.com/stellar/soroban-react-atomic-swap/blob/main/src/helpers/soroban.ts) that showcase the power and innovation behind the dapps:

Functionality behind the dapps is extensive and diverse, leveraging the `@stellar/stellar-sdk` library to integrate with the Soroban RPC and facilitating direct communication with Soroban using a JSON RPC interface on the Stellar network. They are equipped to communicate across different network setups, as they incorporate the `RPC_URLS` and `getServer` functionalities, providing adaptability that is crucial for various development and deployment scenarios. Users can retrieve user-friendly token information without engaging with complex blockchain operations, by utilizing functions like `getTokenSymbol`, `getTokenName`, and `getTokenDecimals`.

A significant feature is the `simulateTx` function, which allows users to preview the outcome of a transaction before actually executing it. `simulateTx` allows users to submit a trial contract invocation by first running a simulation of the contract invocation as defined on the incoming transaction. The results are then applied to a new copy of the transaction, which is returned with the ledger footprint and authorization set, making it ready for signing and sending. The returned transaction will also have an updated fee, the sum of the fee set on the incoming transaction with the contract resource fees estimated from the simulation. It is advisable to check the fee on the returned transaction and validate or take appropriate measures for interaction with the user to confirm it is acceptable.

Other utilities such as `accountToScVal` and `numberToI128` are also provided to simplify transaction creation by converting user-friendly inputs into the formats expected by the Soroban RPC on the Stellar network. Furthermore, the dapps are built with premade helper functions such as the `makePayment` function which facilitates streamlined "transfer" operations and also includes memos for supplementary transaction-related information.

The code referenced showcases various functionalities including sending transactions, retrieving token information, simulating transactions, building swaps, and authorizing contract calls, all of which are ready to be cloned, customized, and expanded upon to suit your unique needs and ideas.

## Conclusion

We hope these dapps will help you understand the Soroban ecosystem better and inspire you to build your own dapps using tools like [stellar-sdk](https://www.npmjs.com/package/@stellar/stellar-sdk) and [freighter-api](https://www.npmjs.com/package/@stellar/freighter-api). We look forward to seeing what you create!

For any queries or discussions, don't hesitate to join us on [Discord!](https://discord.com/channels/897514728459468821/1037073682599780494).
5 changes: 5 additions & 0 deletions docs/smart-contracts/guides/dapps/README.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Dapp Development
---

We've written some helpful guides on some of the most useful tools available to you, the dapp developer.
136 changes: 136 additions & 0 deletions docs/smart-contracts/guides/dapps/docker.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
---
title: Use Docker to build and run dapps
---

## What is Docker?

Welcome to the world of [Docker](https://www.docker.com/), an essential tool for software development. Docker packages software into units known as containers, ensuring consistency, isolation, portability, and scalability.

Docker is particularly useful in dapp development. It helps manage microservices, maintain consistent environments throughout development stages, and simulate a decentralized network during testing.

Understanding Docker begins with understanding Docker images and containers. A Docker image, created from a Dockerfile, is a package that contains everything needed to run the software. A Docker container is a running instance of this image.

## Building and Running a Docker Image

You can create a Docker image using the docker build command with a Dockerfile. Once the image is created, you can run a Docker container using the docker run command.

In the context of the example Soroban dapps, understanding how to build Docker images is crucial. The Docker images serve as the basis for our container, which provides the environment for our dapp to run.

Here's an example from our example

To illustrate the process, let's take an example from our [example crowdfund dapp]. In order to build the Docker image, you utilize a command that is encapsulated within our Makefile:

```bash
make build-docker
```

This command simplifies the Docker build process and ensures it's consistently executed each time. When you run `make build-docker`, Docker executes the following instructions:

```bash
docker build . \
--tag soroban-preview:11 \
--force-rm \
--rm
```

### Makefile Overview

```bash
docker build .
```

Instructs Docker to build an image using the Dockerfile in the current directory (denoted by the ".").

```bash
--tag soroban-preview:11
```

Gives a name and tag to our image, in this case, soroban-preview with the tag 9.

```bash
--force-rm
```

Ensures Docker removes any intermediate containers after the build process completes. This keeps our environment clean.

```bash
--rm
```

Guarantees the removal of the intermediate container, even if the build fails. By using `make build-docker`, you're harnessing the power of Docker to create a consistent, reliable environment for our dapp.

## Container Deployment

You can streamline the deployment process by using a script to run the Docker container. The following script is a wrapper for the [`stellar/quickstart` Docker image], which provides a quick way to run a Stellar network. You can find an example of the `quickstart.sh` script located in the root directory of the [example crowdfund dapp].

```bash title="quickstart.sh"
#!/bin/bash

set -e

case "$1" in
standalone)
echo "Using standalone network"
ARGS="--standalone"
;;
futurenet)
echo "Using Futurenet network"
ARGS="--futurenet"
;;
*)
echo "Usage: $0 standalone|futurenet"
exit 1
;;
esac

shift

# Run the soroban-preview container
# Remember to do:
# make build-docker

echo "Creating docker soroban network"
(docker network inspect soroban-network -f '{{.Id}}' 2>/dev/null) \
|| docker network create soroban-network

echo "Searching for a previous soroban-preview docker container"
containerID=$(docker ps --filter="name=soroban-preview" --all --quiet)
if [[ ${containerID} ]]; then
echo "Start removing soroban-preview container."
docker rm --force soroban-preview
echo "Finished removing soroban-preview container."
else
echo "No previous soroban-preview container was found"
fi

currentDir=$(pwd)
docker run -dti \
--volume ${currentDir}:/workspace \
--name soroban-preview \
-p 8001:8000 \
--ipc=host \
--network soroban-network \
soroban-preview:11

# Run the stellar quickstart image

docker run --rm -ti \
--name stellar \
--network soroban-network \
-p 8000:8000 \
stellar/quickstart:testing \
$ARGS \
--enable-soroban-rpc \
"$@" # Pass through args from the CLI
```

The `quickstart.sh` script sets up the Docker environment for running the dapp. It allows you to choose between a standalone network or the Futurenet network. The script performs the following steps:

- Determines the network based on the provided argument (`standalone` or `futurenet`).
- Creates the Docker network named `soroban-network` if it doesn't exist.
- Removes any existing `soroban-preview` Docker container.
- Runs the `soroban-preview` container, which provides the Soroban Preview environment for development.
- Runs the `stellar/quickstart` Docker image, which sets up the Stellar network using the chosen network type and enables Soroban RPC.

[`stellar/quickstart` Docker image]: https://hub.docker.com/r/stellar/quickstart
[example crowdfund dapp]: https://github.com/stellar/soroban-example-dapp

0 comments on commit d5684d3

Please sign in to comment.