Skip to content

Commit 89d3939

Browse files
committed
Merge remote-tracking branch 'origin/main' into karthik/ttp-docs
2 parents 439c3c4 + 7e676b0 commit 89d3939

69 files changed

Lines changed: 3305 additions & 380 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ npm run check:mdx # this will search for problems in the MDX files
8989
npm run format:mdx # this will fix any problems that were found
9090
```
9191

92+
After that you need to build the `routes.txt` file, to do that run the next command
93+
94+
```bash
95+
yarn build
96+
```
97+
9298
## Repository Structure
9399

94100
- `/docs/` Contains all the documentation content. If you're contributing to the

docs/networks/software-versions.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ Release candidates are software releases that are also released to the [Testnet]
3030
| Stellar JS Stellar Base | `v14.0.0-rc.2` | `NPM: 14.0.0-rc.2` |
3131
| Stellar JS Stellar SDK | `v14.0.0-rc.3` | `NPM: 14.0.0-rc.3` |
3232
| Freighter | `n/a` | `n/a` |
33+
| Laboratory | `n/a` | `n/a` |
34+
| Futurenet Network Passphrase | `n/a` | `Test SDF Future Network ; October 2022` |
35+
| Testnet Network Passphrase | `n/a` | `Test SDF Network ; September 2015` |
36+
| Mainnet Network Passphrase | `n/a` | `Public Global Stellar Network ; September 2015` |
3337

3438
### Release notes
3539

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
title: Scaffold Stellar
3+
description: Convention-over-configuration toolkit for Stellar smart contract development
4+
sidebar_label: Scaffold Stellar
5+
sidebar_position: 110
6+
---
7+
8+
**Scaffold Stellar** is a developer toolkit for building decentralized applications (dApps) and smart contracts on the Stellar blockchain. It helps you go from idea to working full-stack dApp faster — by providing CLI tools, reusable contract templates, a smart contract registry, and a modern frontend.
9+
10+
## Prerequisites
11+
12+
Before you begin, make sure you have the following installed:
13+
14+
| Tool | Description | Install Link |
15+
| --- | --- | --- |
16+
| [Rust & Cargo](https://www.rust-lang.org/tools/install) | For writing and compiling smart contracts | `curl https://sh.rustup.rs -sSf \| sh` |
17+
| [Node.js & npm](https://nodejs.org/) | For frontend development | Download from official site |
18+
| [Stellar CLI](https://github.com/stellar/stellar-cli) | For building, deploying, and interacting with smart contracts | [`Link for the repo`](https://github.com/stellar/stellar-cli) |
19+
20+
## Getting Started
21+
22+
### Installation
23+
24+
Install the required CLI tools:
25+
26+
```bash
27+
# Install stellar-scaffold CLI
28+
cargo install stellar-scaffold-cli
29+
30+
# Install registry CLI (to easily deploy your contract to the registry)
31+
cargo install stellar-registry-cli
32+
```
33+
34+
### Creating a New Project
35+
36+
1. Initialize a new project:
37+
38+
```bash
39+
stellar scaffold init my-project
40+
cd my-project
41+
```
42+
43+
You will have a few sample contracts already in the project, or you can start from the [OpenZeppelin Wizard](./openzepplin-contracts) to customize your contract and start a Scaffold Stellar project from there.
44+
45+
2. Set up your development environment:
46+
47+
```bash
48+
# Copy and configure environment variables
49+
cp .env.example .env
50+
51+
# Install frontend dependencies
52+
npm install
53+
```
54+
55+
3. Start development environment:
56+
57+
```bash
58+
npm run dev
59+
```
60+
61+
You'll have a running dApp, with a couple of contracts to start with, ready to start building!
62+
63+
Explore the `environments.toml` file to customize your development environment(s).
64+
65+
## Project Structure
66+
67+
When you run `stellar scaffold init`, it creates a full-stack project structure with example contracts and a modern frontend:
68+
69+
```
70+
my-project/
71+
├── contracts/ # Rust smart contracts (compiled to WASM)
72+
├── packages/ # Auto-generated TypeScript contract clients
73+
├── src/ # React frontend code
74+
│ ├── components/ # Reusable UI components
75+
│ ├── contracts/ # Contract interaction logic
76+
│ ├── App.tsx # Main app component
77+
│ └── main.tsx # Entry point
78+
├── environments.toml # Configuration per environment (dev/test/prod)
79+
├── .env # Local environment variables
80+
├── package.json # Frontend packages
81+
└── target/ # Build outputs
82+
```
83+
84+
This template provides a ready-to-use frontend application with example smart contracts and their TypeScript clients. The frontend is set up with `Vite`, `React`, and includes basic components for interacting with the contracts.
85+
86+
## Features
87+
88+
- **CLI Plugins for Stellar**
89+
90+
- `stellar scaffold init`: Initialize new Stellar smart contract projects
91+
- `stellar scaffold upgrade`: Transform existing Stellar contract workspaces into Scaffold projects
92+
- `stellar scaffold build`: Build contracts and generate TypeScript clients
93+
- `stellar scaffold watch`: Development mode with hot reloading
94+
- `stellar registry`: Publish, deploy, and manage smart contracts
95+
96+
- **Environment Management**
97+
98+
- Environment-specific builds (development, testing, staging, production)
99+
- Seamless integration with both local and deployed contracts
100+
- Network configuration via `environments.toml`
101+
- Support for multiple deployment environments
102+
103+
- **Smart Contract Registry**
104+
- On-chain publishing platform for Wasm binaries
105+
- Version management and contract naming
106+
- Contract verification and dependency management
107+
- Secure deployment workflow for testnet and mainnet
108+
109+
### More Resources
110+
111+
For more information, check out the [project on GitHub](https://github.com/AhaLabs/scaffold-stellar)!

docs/tools/lab/account.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ sidebar_position: 10
1010

1111
![Lab: Create Account](/assets/lab/lab-account-create.png)
1212

13-
From the Lab’s top navigation, click on the "Account" link. You will land on the "Create Account Keypair" page, where you can generate a [keypair](../../learn/glossary.mdx#keypair) by following these steps:
13+
From the Lab’s main navigation, click on the "Account" link to expand sub-navigation. Click the "Create Account Keypair" page. Here you can generate a [keypair](../../learn/glossary.mdx#keypair) by following these steps:
1414

1515
1. Make sure you are on the Stellar network for which you want to generate the keypair. You can see the current network in the upper right corner of the page. Click on dropdown to change the network (don’t forget to provide any necessary information). We will use Testnet network for this example.
1616
2. Click the "Generate keypair" button to create public and secret keys for an account. Save them someplace safe, even if they are used only for testing.
@@ -29,13 +29,13 @@ The Friendbot can be used for new account or accounts with balance under a start
2929

3030
:::
3131

32-
4. Optionally, to save the generated keypair, click the "Save Keypair" button. Enter the name in the pop-up and click the "Save" button to save the keypair in the browser's local storage. Click the "Saved Keypairs" link on the left-side menu to view saved keypairs. The save feature is available only on Testnet and Futurenet networks.
32+
4. Optionally, to save the generated keypair, click the "Save Keypair" button. Enter the name in the pop-up and click the "Save" button to save the keypair in the browser's local storage. Click the "Saved" link on the main menu to expand the submenu, then click on the "Keypairs" link to view saved keypairs. The save feature is available only on Testnet and Futurenet networks.
3333

3434
## [Fund Account](https://lab.stellar.org/account/fund)
3535

3636
![Lab: Fund Account](/assets/lab/lab-account-fund.png)
3737

38-
If you already have a keypair you want to fund, go to the "Fund Account" page.
38+
If you already have a keypair you want to fund, go to the "Fund Account" page (under the "Account" item in the main menu).
3939

4040
1. If you have generated a keypair on the "Create Account Keypair" page, you can use its public key by clicking the "Fill in the generated key" button. The button will be disabled if there is no keypair.
4141
2. You can always manually input a public key.

docs/tools/lab/api-explorer/horizon-endpoint.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ On August 1, 2024, the publicly accessible SDF-hosted Horizon had its historical
1010

1111
Data on the Stellar ledger is organized into [resources](../../../data/apis/horizon/api-reference/resources): **Accounts, Assets, Claimable Balances, Effects, Ledgers, Liquidity Pools, Offers, Operations, Trades**, and **Transactions**. Each resource has multiple endpoints. Endpoints that aggregate ledger data (also known as [aggregations](../../../data/apis/horizon/api-reference/aggregations)) include resources like **Order Books, Paths, Trade Aggregations**, and **Fee Stats**.
1212

13-
Stellar Lab's Horizon Endpoints lists each resource type in the side menu, allowing developers to interact with its respective endpoints.
13+
Stellar Lab's Horizon Endpoints lists each resource type in the menu, allowing developers to interact with its respective endpoints.
1414

1515
![Lab: Horizon Page](/assets/lab/horizon-endpoints.png)
1616

@@ -353,7 +353,7 @@ Clicking the icon opens a modal. We recommend providing an identifiable name to
353353

354354
![Lab: Horizon - Modal](/assets/lab/horizon-save-modal.png)
355355

356-
Saved endpoints are located at the top left of the side menu. They include requests for both the **RPC Methods** and **Horizon Endpoints**.
356+
Saved endpoints are located in the main menu under the "Saved" menu, "Requests" submenu. They include requests for both the **RPC Methods** and **Horizon Endpoints**.
357357

358358
![Lab: Horizon - Saved Requests Page](/assets/lab/horizon-saved-requests.png)
359359

docs/tools/lab/api-explorer/rpc-methods.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# RPC Methods
22

3-
RPC methods are a set of functions that allow developers to interact directly with the Stellar network. You can learn more about all the RPC methods [here](../../../data/apis/rpc/api-reference/methods). The Lab provides an easy way to use these methods from the UI. To access the "RPC Methods" section, click on the "API Explorer" link in the main navigation, which will open a new page listing all RPC methods by name.
3+
RPC methods are a set of functions that allow developers to interact directly with the Stellar network. You can learn more about all the RPC methods [here](../../../data/apis/rpc/api-reference/methods). The Lab provides an easy way to use these methods from the UI. To access the "RPC Methods" items, click on the "API Explorer" link in the main navigation, then click the "RPC Methods" submenu link, which will open another submenu listing all RPC methods by name. Click on the method name to open that page.
44

55
:::warning
66

7-
RPC URL is required to submit these methods. You can update or set the RPC URL in the network selector in the main navigation bar.
7+
RPC URL is required to submit these methods. You can update or set the RPC URL in the network selector in the top right corner.
88

99
:::
1010

@@ -30,7 +30,7 @@ The Stellar Lab allows you to share RPC methods with filled data. Simply click o
3030

3131
## Saved Requests
3232

33-
You can save methods in the browser’s local storage by clicking the Save button (next to the Share button). Once you click that button, a modal will pop up, where you will need to enter the name and click save. To view your saved RPC methods in the Lab, click the "Saved Requests" link in the menu, then click the "RPC Methods" tab in the top right.
33+
You can save methods in the browser’s local storage by clicking the Save button (next to the Share button). Once you click that button, a modal will pop up, where you will need to enter the name and click save. To view your saved RPC methods in the Lab, click the "Saved" link in the main menu, then click the "Requests" submenu link. Then click the "RPC Methods" tab in the top right.
3434

3535
:::info
3636

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: Smart Contracts
3+
sidebar_position: 20
4+
---
5+
6+
import DocCardList from "@theme/DocCardList";
7+
8+
# Smart Contracts
9+
10+
In this section, you can explore Stellar smart contracts by ID and view a list of smart contracts on the selected Stellar network.
11+
12+
:::tip
13+
14+
If you don't know any Stellar smart contract ID, view the list and click on any of the items. This will direct you to the "Contract Explorer" page, where the selected ID is pre-filled. Load the contract and check it out!
15+
16+
:::
17+
18+
<DocCardList />
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Contract Explorer
2+
3+
On the "Contract Explorer" page, you can take a deep dive into Stellar smart contracts. Here, you can view high-level contract information, invoke contract methods directly from the browser, explore the contract specification, source code, contract storage, build information, and version history.
4+
5+
:::warning
6+
7+
RPC URL is required to view the contract information. You can update or set the RPC URL in the network selector in the top right corner.
8+
9+
:::
10+
11+
![Lab: Contract Explorer](/assets/lab/lab-contract-explorer.png)
12+
13+
Let's load `CAJJZSGMMM3PD7N33TAPHGBUGTB43OC73HVIK2L2G6BNGGGYOSSYBXBD` contract ID on the Mainnet network, and see what we can learn about it.
14+
15+
## Contract Info
16+
17+
In the "Contract Info" section, we can view the date when the contract was created and the creator's Stellar address. It also displays the Wasm hash and GitHub repository, along with a link to the source code of this contract. Also, you can see how many contract storage entries this contract has.
18+
19+
![Lab: Contract Explorer: Contract Info](/assets/lab/lab-contract-explorer-info.png)
20+
21+
## Invoke Contract
22+
23+
This feature allows you to directly interact with and execute methods of a Stellar smart contract from the Lab UI in your browser.
24+
25+
:::warning
26+
27+
A connected wallet is required to invoke the contract.
28+
29+
:::
30+
31+
![Lab: Contract Explorer: Invoke Contract](/assets/lab/lab-contract-explorer-invoke.png)
32+
33+
## Contract Spec
34+
35+
In this section, you can view [Contract Meta](../../../learn/fundamentals/contract-development/overview#contract-meta), [Contract Env Meta](../../../learn/fundamentals/contract-development/overview#environment-meta), and [Contract Spec](../../../learn/fundamentals/contract-development/overview#contract-spec) from the Wasm file. You can view each section in JSON or XDR formats, by selecting the type from the dropdown in the top-right corner of the editor view. You can also download each section individually in the chosen format (the download button is located next to the type dropdown), or download the entire Wasm file by clicking the "Download Wasm" button at the bottom of the section.
36+
37+
![Lab: Contract Explorer: Contract Spec](/assets/lab/lab-contract-explorer-spec.png)
38+
39+
## Source Code
40+
41+
In the code editor, you can view the `README.md` file of the smart contract repository. You can further explore the code by opening it in a Dev Container, Codeanywhere, or by using the GitHub link (see the dropdown in the top right corner of the editor view).
42+
43+
![Lab: Contract Explorer: Source Code](/assets/lab/lab-contract-explorer-source.png)
44+
45+
## Contract Storage
46+
47+
Here you can view stored data entries for this smart contract in human-readable format. You can filter this data by Key and Value, as well as sort it by Durability, TTL, or Updated columns. You can also export this data in XDR or JSON formats.
48+
49+
![Lab: Contract Explorer: Contract Storage](/assets/lab/lab-contract-explorer-storage.png)
50+
51+
## Build Info
52+
53+
If the smart contract has build verification configured (following the [Contract Source Validation SEP](https://github.com/orgs/stellar/discussions/1573)), this section displays information from the GitHub attestation.
54+
55+
:::info
56+
57+
"Build Verified" only means that the GitHub Action run has attested to have built the Wasm, but does not verify the source code. Always make sure you fully understand what the smart contract does before using it.
58+
59+
:::
60+
61+
![Lab: Contract Explorer: Build Info](/assets/lab/lab-contract-explorer-build.png)
62+
63+
## Version History
64+
65+
In this section, you can find the Wasm history of changes.
66+
67+
![Lab: Contract Explorer: Version History](/assets/lab/lab-contract-explorer-version.png)
68+
69+
## Bindings
70+
71+
Bindings are a feature of the [Stellar CLI](../../cli) that generate fully typed client libraries for your smart contracts, tailored to your chosen programming language, including TypeScript, JSON, Rust, Python, and Java. This makes it easy to integrate Stellar contracts into your application as if they were native modules. Each binding provides type-safe functions corresponding to your contract’s methods. To learn more about generating bindings, please see the [Stellar CLI’s bindings command](../../cli/stellar-cli#stellar-contract-bindings).
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Smart Contract List
2+
3+
This page shows a list of Stellar smart contracts on the selected network. The table displays the smart contract ID or address, along with its creation date and time. Clicking on the contract address will direct you to the "Contract Explorer" page, where the selected address is pre-filled.
4+
5+
![Lab: Smart Contract List](/assets/lab/lab-smart-contract-list.png)

docs/tools/lab/transactions.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
![Lab: Build Transaction](/assets/lab/lab-transactions-build.png)
66

7-
You can access the "Build Transaction" page by clicking the "Transactions" link in the Lab's top navigation. The transaction builder UI has helpful messages, links, and input validation to make learning how to build transactions on the Stellar network easier. There are three main sections: params, operations, and transaction validation (error or success).
7+
You can access the "Build Transaction" page by clicking the "Transactions" link in the Lab's main navigation. The transaction builder UI has helpful messages, links, and input validation to make learning how to build transactions on the Stellar network easier. There are three main sections: params, operations, and transaction validation (error or success).
88

99
### Params
1010

0 commit comments

Comments
 (0)