Skip to content

Commit be7a0f6

Browse files
feat: self-hosted deployment guide (#83) (#101)
Co-authored-by: poaspergillus <poaspergillus@users.noreply.github.com>
1 parent 23d0a1f commit be7a0f6

2 files changed

Lines changed: 146 additions & 21 deletions

File tree

docs.json

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -112,29 +112,14 @@
112112
{
113113
"group": "Guides",
114114
"pages": [
115-
"guides/stellar-quickstart",
116-
"guides/stellar-quickstart.es",
117115
"guides/stealth-payments",
118116
"guides/single-chain-agent",
119117
"guides/multichain-agent",
120118
"guides/bring-your-own-model",
121119
"guides/privacy-best-practices",
122120
"guides/stellar-fees",
123121
"guides/stellar-troubleshooting",
124-
"guides/spectre-stellar-cookbook",
125-
"guides/integrations/react-native"
126-
]
127-
},
128-
{
129-
"group": "Stellar",
130-
"pages": [
131-
"guides/stellar/stellar-quickstart"
132-
]
133-
},
134-
{
135-
"group": "Integrations",
136-
"pages": [
137-
"guides/integrations/soroswap"
122+
"guides/spectre-stellar-cookbook"
138123
]
139124
},
140125
{
@@ -148,12 +133,9 @@
148133
"guides/stellar-explorer-recipes",
149134
"guides/stellar-federation",
150135
"guides/stellar-custom-assets",
151-
"guides/wraith-names-stellar"
136+
"guides/wraith-names-stellar",
137+
"guides/ops/self-hosted-deployment"
152138
]
153-
},
154-
{
155-
"group": "Integrations",
156-
"pages": ["guides/integrations/reflector"]
157139
}
158140
]
159141
},
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
---
2+
title: 'Self‑Hosted Deployment'
3+
sidebarTitle: 'Self‑Hosted Deployment'
4+
description: 'Deploy the Wraith protocol on your own Stellar network (Futurenet)'
5+
---
6+
7+
This guide walks you through a full self‑hosted deployment of the Wraith
8+
protocol on **Futurenet**. By the end, you’ll have all four core contracts
9+
deployed, wired, and verified — ready for your own applications.
10+
11+
## Prerequisites
12+
13+
- **Rust** ≥ 1.78 (`rustc --version`)
14+
- **wasm32 target** installed (`rustup target list --installed | grep wasm32-unknown-unknown`)
15+
- **stellar‑cli** ≥ 22.0.1 (`stellar --version`)
16+
- **Funded Stellar keypair** on Futurenet (`stellar account show <address> --network futurenet`)
17+
18+
Install the wasm target if missing:
19+
```bash
20+
rustup target add wasm32-unknown-unknown
21+
```
22+
23+
## 1. Set Up a Futurenet Identity
24+
25+
Generate a new keypair and fund it via friendbot:
26+
27+
```bash
28+
stellar keys generate wraith-deployer --network futurenet
29+
30+
curl "https://friendbot-futurenet.stellar.org/?addr=$(stellar keys address wraith-deployer)"
31+
```
32+
33+
Verify the balance:
34+
```bash
35+
stellar account show $(stellar keys address wraith-deployer) --network futurenet
36+
```
37+
You should see at least 10 XLM to cover deployment costs.
38+
39+
## 2. Dry‑Run Walkthrough
40+
41+
A dry‑run prints every command that *would* be executed without spending funds.
42+
Use it to audit the sequence.
43+
44+
Clone the contracts repo and enter the Stellar directory:
45+
46+
```bash
47+
git clone https://github.com/wraith-protocol/contracts.git
48+
cd contracts/stellar
49+
```
50+
51+
Run the dry‑run:
52+
53+
```bash
54+
./deploy.sh futurenet wraith-deployer --dry-run
55+
```
56+
57+
Expected output:
58+
```
59+
🚀 Deploying Wraith Protocol to futurenet using wraith-deployer...
60+
[DRY-RUN] Will execute: cargo build --target wasm32-unknown-unknown --release
61+
[DRY-RUN] Will execute: stellar contract optimize on all contracts
62+
[DRY-RUN] Will deploy: stealth-announcer
63+
[DRY-RUN] Will deploy: stealth-registry
64+
[DRY-RUN] Will deploy: stealth-sender
65+
[DRY-RUN] Will invoke: stealth-sender init
66+
[DRY-RUN] Will deploy: wraith-names
67+
[DRY-RUN] Will write manifest to deployments/futurenet.json
68+
```
69+
70+
If this exits cleanly, the deployment plan is valid.
71+
72+
## 3. Full Futurenet Deployment
73+
74+
From the `contracts/stellar` directory, run the same command **without** `--dry-run`:
75+
76+
```bash
77+
./deploy.sh futurenet wraith-deployer
78+
```
79+
80+
The script will:
81+
- Build all contracts (`cargo build --target wasm32-unknown-unknown --release`)
82+
- Optimize WASM files with `stellar contract optimize`
83+
- Deploy each contract in dependency order
84+
- **Wire contracts** by calling `init` on `stealth-sender` with the announcer ID
85+
- Write a deployment manifest to `stellar/deployments/futurenet.json`
86+
- Verify each deployed contract responds to a read call
87+
88+
You’ll see output ending with:
89+
```
90+
🎉 Deployment Complete!
91+
--------------------------------------
92+
Announcer: CAAA...
93+
Registry: CBBB...
94+
Sender: CCCC...
95+
Names: CDDD...
96+
--------------------------------------
97+
```
98+
99+
## 4. Wiring Contracts (Already Done)
100+
101+
The deploy script automatically wires the contracts. Specifically, it calls:
102+
103+
```bash
104+
soroban contract invoke \
105+
--id <SENDER_ID> \
106+
--source wraith-deployer \
107+
--network futurenet \
108+
-- init --admin <DEPLOYER_ADDRESS> --announcer <ANNOUNCER_ID>
109+
```
110+
111+
No additional wiring steps are required for a self‑hosted instance.
112+
113+
## 5. Publishing Contract IDs
114+
115+
The deployment manifest at `stellar/deployments/futurenet.json` contains all
116+
contract IDs and is the canonical record of your deployment.
117+
118+
Share this file with any consumer application. Its structure:
119+
120+
```json
121+
{
122+
"network": "futurenet",
123+
"contracts": {
124+
"stealthAnnouncer": "CAAA...",
125+
"stealthRegistry": "CBBB...",
126+
"stealthSender": "CCCC...",
127+
"wraithNames": "CDDD..."
128+
}
129+
```
130+
131+
## Verification
132+
133+
Open each contract on Stellar Expert:
134+
135+
```
136+
https://futurenet.stellar.expert/explorer/futurenet/contract/<CONTRACT_ID>
137+
```
138+
139+
You should see ledger entries confirming the deployment.
140+
141+
142+
**Your self‑hosted Wraith instance is now live.** You can register names,
143+
announce stealth meta‑addresses, and send private payments against these contracts.

0 commit comments

Comments
 (0)