@@ -142,9 +142,142 @@ cargo test --workspace
142142# Check configuration
143143cargo run -p stellaraid-tools -- config check
144144
145- # Deploy contract (placeholder)
145+ # Initialize configuration (creates .env and contract ID files)
146+ cargo run -p stellaraid-tools -- config init
147+
148+ # Show network configuration
149+ cargo run -p stellaraid-tools -- network
150+
151+ # Deploy contract to testnet
152+ cargo run -p stellaraid-tools -- deploy --network testnet
153+
154+ # Deploy contract to sandbox (local)
155+ cargo run -p stellaraid-tools -- deploy --network sandbox
156+
157+ # Invoke the ping method on deployed contract
158+ cargo run -p stellaraid-tools -- invoke ping
159+
160+ # Invoke with custom network
161+ cargo run -p stellaraid-tools -- invoke ping --network testnet
162+
163+ # Show deployed contract ID
164+ cargo run -p stellaraid-tools -- contract-id
165+ cargo run -p stellaraid-tools -- contract-id --network testnet
166+ ```
167+
168+ ## 🚀 Quick Start: Deploy Your First Contract
169+
170+ This guide walks you through deploying the core contract to testnet and invoking the ` ping ` method.
171+
172+ ### Prerequisites
173+
174+ 1 . ** Install Soroban CLI** :
175+ ``` bash
176+ cargo install soroban-cli
177+ ```
178+
179+ 2 . ** Generate a keypair** (for testnet):
180+ ``` bash
181+ soroban keys generate test_account --network testnet
182+ ```
183+
184+ 3 . ** Get testnet XLM** (optional but recommended for testing):
185+ - Visit [ Stellar Testnet Faucet] ( https://laboratory.stellar.org/#account-creator?network=testnet )
186+
187+ ### Step 1: Build the Contract
188+
189+ ``` bash
190+ # Build WASM contract
191+ make wasm
192+
193+ # Or build everything including CLI tools
194+ make build
195+ ```
196+
197+ ### Step 2: Configure Environment
198+
199+ ``` bash
200+ # Copy the example environment file
201+ cp .env.example .env
202+
203+ # Edit .env and set your admin key:
204+ # SOROBAN_ADMIN_KEY=YOUR_PUBLIC_KEY
205+ ```
206+
207+ Or generate and configure a new key:
208+ ``` bash
209+ # Generate a new keypair
210+ soroban keys generate my_admin --network testnet
211+
212+ # Get the public key
213+ soroban keys list
214+
215+ # Add to .env
216+ SOROBAN_ADMIN_KEY=GA7...
217+ ```
218+
219+ ### Step 3: Deploy to Testnet
220+
221+ ``` bash
222+ # Deploy the contract
146223cargo run -p stellaraid-tools -- deploy --network testnet
147224```
225+
226+ Expected output:
227+ ```
228+ 🚀 Deploying to network: testnet
229+ 📦 Using WASM: target/wasm32-unknown-unknown/debug/stellaraid_core.wasm
230+ ✅ Contract deployed successfully!
231+ 📝 Contract ID: CB7...ABC
232+ ✅ Contract ID stored in .stellaraid_contract_id
233+ ```
234+
235+ ### Step 4: Invoke the ping Method
236+
237+ ``` bash
238+ # Invoke ping
239+ cargo run -p stellaraid-tools -- invoke ping
240+ ```
241+
242+ Expected output:
243+ ```
244+ 🔄 Invoking method 'ping' on network: testnet
245+ 📝 Using contract ID: CB7...ABC
246+ ✅ Invocation successful!
247+ 📤 Result: 1
248+ ```
249+
250+ ### Step 5: Check Deployment
251+
252+ ``` bash
253+ # View all deployed contract IDs
254+ cargo run -p stellaraid-tools -- contract-id
255+
256+ # View network configuration
257+ cargo run -p stellaraid-tools -- network
258+ ```
259+
260+ ### Using Sandbox (Local Development)
261+
262+ For local testing without testnet:
263+
264+ ``` bash
265+ # Start local sandbox
266+ soroban sandbox start
267+
268+ # Deploy to sandbox
269+ cargo run -p stellaraid-tools -- deploy --network sandbox
270+
271+ # Invoke on sandbox
272+ cargo run -p stellaraid-tools -- invoke ping --network sandbox
273+ ```
274+
275+ ### Troubleshooting
276+
277+ - ** "WASM file not found"** : Run ` make wasm ` to build the contract first
278+ - ** "No contract ID found"** : Deploy a contract first with ` deploy ` command
279+ - ** "Configuration error"** : Run ` cargo run -p stellaraid-tools -- config check ` to diagnose
280+ - ** "soroban: command not found"** : Install with ` cargo install soroban-cli `
148281## 📌 Features
149282
150283### 🎯 For Donors
0 commit comments