Skip to content

Commit d6a2dee

Browse files
committed
Add docs
1 parent 45cc34a commit d6a2dee

8 files changed

Lines changed: 215 additions & 5 deletions

File tree

crates/stellar-registry-cli/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,5 +167,5 @@ Publishing and deploying are exactly the same as other networks, except now you
167167

168168
## See Also
169169

170-
- [Registry Guide](../../docs/registry.md) - Detailed guide on using the registry system
171-
- [Environment Configuration](../../docs/environments.md) - Configuration details for different networks
170+
- [Registry Guide](../../website/docs/registry.md) - Detailed guide on using the registry system
171+
- [Environment Configuration](../../website/docs/environments.md) - Configuration details for different networks

docs/deploy.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/cli.md renamed to website/docs/cli.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
sidebar_position: 3
3+
---
4+
15
# CLI Commands
26

37
Scaffold Stellar provides several CLI commands to help manage your Stellar smart contract development.

website/docs/deploy.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
sidebar_position: 6
3+
---
4+
5+
# Deployment
6+
7+
Coming soon...
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
sidebar_position: 4
3+
---
4+
15
# Environment Configuration
26

37
Scaffold Stellar uses an `environments.toml` file to manage different deployment environments and contract configurations.

website/docs/intro.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,31 @@ sidebar_position: 1
44

55
# Welcome to Scaffold Stellar!
66

7+
**Scaffold Stellar** is a developer toolkit for building decentralized applications (dApps) and smart contracts on the [**Stellar** blockchain](https://stellar.org).
8+
9+
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.
10+
11+
---
12+
13+
## Why Use Scaffold Stellar?
14+
15+
- Simplifies blockchain dApp development
16+
- Generates smart contract projects and React UIs
17+
- Deploys smart contracts and manages versions
18+
- Easy to learn for newcomers; powerful for pros
19+
20+
---
21+
22+
## What Is Stellar?
23+
24+
[**Stellar**](https://www.stellar.org/) is a blockchain designed for fast, low-cost financial transactions and smart contracts written in **Rust** and compiled to **WebAssembly (Wasm)**.
25+
26+
With Scaffold Stellar, you write smart contracts in Rust and interact with them using modern TypeScript + React tooling.
27+
28+
---
29+
30+
## Additional Developer Resources
31+
- Video: [Intro to Scaffold Stellar](https://www.youtube.com/watch?v=559ht4K4pkM)
32+
- Video: [Which Frontend?](https://www.youtube.com/watch?v=pz7O54Oia_w)
33+
- Video: [Get Started Building](https://www.youtube.com/watch?v=H-M962aPuTk)
34+
- Video: [Live Demo of Scaffold Stellar](https://www.youtube.com/watch?v=0syGaIn3ULk) 👈 Start Here

website/docs/quick-start.mdx

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
5+
# Quickstart
6+
7+
This section walks you through setting up Scaffold Stellar from scratch.
8+
9+
## Prerequisites
10+
11+
Before you begin, make sure you have the following installed:
12+
13+
| Tool | Description | Install Link |
14+
|---------------------------------------------------------|---------------------------------------------------------------|---------------------------------------------------------------|
15+
| [Rust & Cargo](https://www.rust-lang.org/tools/install) | For writing and compiling smart contracts | `curl https://sh.rustup.rs -sSf \| sh` |
16+
| [Node.js & npm](https://nodejs.org/) | For frontend development | Download from official site |
17+
| [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) |
18+
| [Docker](https://docs.docker.com/get-started/) | For running a Stellar node locally | Download from official site |
19+
20+
### 1. Install the Scaffold Stellar CLI
21+
22+
```
23+
cargo install stellar-scaffold-cli
24+
```
25+
26+
The Scaffold Stellar CLI is installed as a plugin under the `stellar` CLI.
27+
28+
> We recommend the use of [cargo-binstall](https://github.com/cargo-bins/cargo-binstall) to install pre-compiled binaries.
29+
30+
### 2. Create a New Project
31+
```
32+
stellar scaffold init my-project
33+
cd my-project
34+
```
35+
36+
### 3. Configure Your Frontend Environment
37+
```
38+
# Copy and configure environment variables for the frontend
39+
cp .env.example .env
40+
```
41+
42+
Edit `.env` with your preferred network, and other settings.
43+
44+
### 4. Install Frontend Dependencies
45+
```
46+
# Install Frontend dependencies
47+
npm install
48+
```
49+
### 5. Start Development
50+
```
51+
npm run dev
52+
```
53+
You should see your React frontend at http://localhost:5173.
54+
55+
### 6. For testnet/mainnet deployment:
56+
```
57+
# First publish your contract to the registry
58+
stellar registry publish --wasm path/to/contract.wasm --wasm-name my-contract
59+
60+
# Then deploy an instance with constructor parameters
61+
stellar registry deploy \
62+
--contract-name my-contract-instance \
63+
--wasm-name my-contract \
64+
-- \
65+
--param1 value1
66+
67+
# Can access the help docs for constructor parameters
68+
stellar registry deploy \
69+
--contract-name my-contract-instance \
70+
--wasm-name my-contract \
71+
-- \
72+
--help
73+
74+
# Install the deployed contract locally for use with stellar-cli
75+
stellar registry install my-contract-instance
76+
```
77+
78+
## Project Layout
79+
After scaffolding a project, your folder structure will look like this:
80+
81+
```
82+
my-project/
83+
├── contracts/ # Rust smart contracts (compiled to WASM)
84+
├── packages/ # Auto-generated TypeScript contract clients
85+
├── src/ # React frontend code
86+
│ ├── components/ # Reusable UI pieces
87+
│ ├── contracts/ # Contract interaction logic
88+
│ ├── App.tsx # Main app component
89+
│ └── main.tsx # Entry point
90+
├── environments.toml # Configuration per environment (dev/test/prod)
91+
├── .env # Local environment variables
92+
├── package.json # Frontend packages
93+
├── target/ # Build outputs
94+
```
95+
96+
This template provides a ready-to-use frontend application with example smart contracts and their TypeScript clients. You can use these as reference while building your own contracts and UI. The frontend is set up with `Vite`, `React`, and includes basic components for interacting with the contracts.
97+
98+
See the [CLI Documentation](./cli.md) for detailed command information and the [Environments Guide](./environments.md) for configuration details.
99+
100+
---
101+
102+
## CLI Tools
103+
Scaffold Stellar provides two main CLI tools:
104+
105+
**stellar-scaffold**
106+
Initialize and manage dApp projects:
107+
```
108+
stellar scaffold init my-project
109+
stellar scaffold build
110+
```
111+
112+
**stellar-registry**
113+
Manage contract deployment and versions:
114+
```
115+
stellar registry publish --wasm contract.wasm --wasm-name my-contract # Publish contract to the registry
116+
stellar registry deploy --contract-name instance --wasm-name my-contract # Deploy a contract instance
117+
stellar registry install my-contract-instance # Install deployed contracts locally
118+
```
119+
> Use `--help` on any command for usage instructions.
120+
121+
---
122+
## Smart Contract Deployment
123+
124+
### 1. Publish Your Contract
125+
```bash
126+
# Publish with automatic metadata extraction
127+
stellar registry publish --wasm target/stellar/my_contract.wasm
128+
129+
# Or specify details manually
130+
stellar registry publish \
131+
--wasm target/stellar/my_contract.wasm \
132+
--wasm-name my-contract \
133+
--binver "1.0.0"
134+
```
135+
136+
### 2. Deploy the Contract
137+
```bash
138+
# Deploy without initialization
139+
stellar registry deploy \
140+
--contract-name my-contract-instance \
141+
--wasm-name my-contract
142+
143+
# Deploy with constructor parameters
144+
stellar registry deploy \
145+
--contract-name my-token \
146+
--wasm-name token \
147+
--version "1.0.0" \
148+
-- \
149+
--name "My Token" \
150+
--symbol "MTK" \
151+
--decimals 7
152+
```
153+
154+
### 3. Install the Deployed Contract
155+
```bash
156+
stellar registry install my-contract-instance
157+
```
158+
159+
After installation, you can interact with the contract using `stellar-cli`:
160+
```bash
161+
stellar contract invoke --id my-contract-instance -- --help
162+
```
163+
164+
> You can deploy to testnet or mainnet depending on your `.env` and `environments.toml`.
165+
166+
Happy hacking!
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
sidebar_position: 5
3+
---
4+
15
# Registry Guide
26

37
The Stellar Registry is a system for publishing, deploying, and managing smart contracts on the Stellar network. This guide explains how to use the registry CLI tools to manage your contracts.

0 commit comments

Comments
 (0)