solforge 0.2.3 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/LICENSE +2 -2
  2. package/README.md +323 -364
  3. package/cli.cjs +126 -69
  4. package/package.json +1 -1
  5. package/scripts/install.sh +112 -0
  6. package/scripts/postinstall.cjs +66 -58
  7. package/server/methods/program/get-token-accounts-by-owner.ts +7 -2
  8. package/server/ws-server.ts +4 -1
  9. package/src/api-server-entry.ts +91 -91
  10. package/src/cli/commands/rpc-start.ts +4 -1
  11. package/src/cli/main.ts +39 -14
  12. package/src/cli/run-solforge.ts +20 -6
  13. package/src/commands/add-program.ts +324 -328
  14. package/src/commands/init.ts +106 -106
  15. package/src/commands/list.ts +125 -125
  16. package/src/commands/mint.ts +246 -246
  17. package/src/commands/start.ts +834 -831
  18. package/src/commands/status.ts +80 -80
  19. package/src/commands/stop.ts +381 -382
  20. package/src/config/manager.ts +149 -149
  21. package/src/gui/public/app.css +1556 -1
  22. package/src/gui/public/build/main.css +1569 -1
  23. package/src/gui/server.ts +20 -21
  24. package/src/gui/src/app.tsx +56 -37
  25. package/src/gui/src/components/airdrop-mint-form.tsx +17 -11
  26. package/src/gui/src/components/clone-program-modal.tsx +6 -6
  27. package/src/gui/src/components/clone-token-modal.tsx +7 -7
  28. package/src/gui/src/components/modal.tsx +13 -11
  29. package/src/gui/src/components/programs-panel.tsx +27 -15
  30. package/src/gui/src/components/status-panel.tsx +31 -17
  31. package/src/gui/src/components/tokens-panel.tsx +25 -19
  32. package/src/gui/src/index.css +491 -463
  33. package/src/index.ts +161 -146
  34. package/src/rpc/start.ts +1 -1
  35. package/src/services/api-server.ts +470 -473
  36. package/src/services/port-manager.ts +167 -167
  37. package/src/services/process-registry.ts +143 -143
  38. package/src/services/program-cloner.ts +312 -312
  39. package/src/services/token-cloner.ts +799 -797
  40. package/src/services/validator.ts +288 -288
  41. package/src/types/config.ts +71 -71
  42. package/src/utils/shell.ts +75 -75
  43. package/src/utils/token-loader.ts +77 -77
package/README.md CHANGED
@@ -1,523 +1,482 @@
1
- # SolForge – Lightning-Fast Solana Development Server
1
+ # 🔥 SolForge
2
2
 
3
- A blazing-fast, drop-in replacement for `solana-test-validator` built on LiteSVM. Get a full Solana development environment running in under 1 second with comprehensive RPC support and zero configuration.
3
+ > **Lightning-fast Solana localnet for developers**
4
+ > Drop-in replacement for `solana-test-validator` with sub-second startup and minimal memory footprint.
4
5
 
5
- ## 🚀 Why SolForge?
6
-
7
- | Feature | solana-test-validator | SolForge |
8
- | ----------------- | --------------------- | ---------------- |
9
- | **Startup Time** | 10-30 seconds | < 1 second |
10
- | **Memory Usage** | 500MB+ | ~50MB |
11
- | **Configuration** | Complex setup | Zero config |
12
- | **Airdrops** | Rate limited | Unlimited |
13
- | **Database** | Full ledger | Ephemeral SQLite |
6
+ [![Version](https://img.shields.io/badge/version-0.2.5-blue)](https://github.com/nitishxyz/solforge)
7
+ [![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
8
+ [![Powered by LiteSVM](https://img.shields.io/badge/powered%20by-LiteSVM-purple)](https://github.com/litesvm/litesvm)
14
9
 
15
10
  ## ✨ Features
16
11
 
17
- - **Sub-second startup** with LiteSVM in-memory execution
18
- - 🔄 **Drop-in replacement** for solana-test-validator
19
- - 💧 **Unlimited airdrops** via real faucet transfers
20
- - 🗃️ **Smart persistence** with ephemeral SQLite + Drizzle
21
- - 🔌 **WebSocket support** for signature subscriptions
22
- - 🧰 **Universal compatibility** with Solana CLI, Anchor, @solana/kit, web3.js
23
- - 📊 **Rich RPC coverage** (90+ methods implemented)
24
- - 🖥️ **Built-in GUI dashboard** for airdrops, mints, and asset management
25
- - 🎯 **CLI tools** for tokens, programs, and accounts
12
+ - **⚡ Blazing Fast**: Sub-second startup, ~50MB memory (vs 500MB+ for test-validator)
13
+ - **🔌 Drop-in Compatible**: Works with Solana CLI, Anchor, web3.js, and @solana/kit
14
+ - **💰 Unlimited Airdrops**: Built-in faucet with no rate limits
15
+ - **🎨 Web GUI**: Interactive dashboard for airdrops, minting, and monitoring
16
+ - **📦 Program Cloning**: Import programs and accounts from mainnet
17
+ - **🔄 WebSocket Support**: Real-time transaction subscriptions (in the works)
18
+
26
19
 
27
- ## 📦 Installation & Quick Start
20
+ ## 🚀 Quick Install
28
21
 
29
- ### Option 1: From Source (Recommended)
22
+ ### One-Liner Install (Recommended)
30
23
 
31
24
  ```bash
32
- # Clone and install
33
- git clone https://github.com/nitishxyz/solforge
34
- cd solforge
35
- bun install
36
-
37
- # Start the server
38
- bun start
39
- # or with debug logging
40
- DEBUG_RPC_LOG=1 bun start
25
+ curl -fsSL https://install.solforge.sh | sh
41
26
  ```
42
27
 
43
- ### Option 2: Compiled Binary (Coming Soon)
28
+ ### Manual Install
44
29
 
45
- ```bash
46
- # Download and run
47
- curl -L https://github.com/nitishxyz/solforge/releases/latest/download/solforge-$(uname -s)-$(uname -m) -o solforge
48
- chmod +x solforge
49
- ./solforge # first run guides you through setup
50
- ```
30
+ Download the latest binary from [GitHub Releases](https://github.com/nitishxyz/solforge/releases) and add to your PATH.
51
31
 
52
- ### Option 3: CLI Development
32
+ ### NPM/Bun Install
53
33
 
54
34
  ```bash
55
- # Use the CLI directly
56
- bun src/cli/main.ts start
57
- bun src/cli/main.ts config init # Create sf.config.json
35
+ # Using npm
36
+ npm install -g solforge
37
+
38
+ # Using bun
39
+ bun install -g solforge
58
40
  ```
59
41
 
60
- ## 🎯 Usage Examples
42
+ ## 🎯 Quick Start
61
43
 
62
- ### With Solana CLI
44
+ ### 1️⃣ Start the Localnet
63
45
 
64
46
  ```bash
65
- # Connect to SolForge
66
- solana config set -u http://localhost:8899
47
+ solforge
48
+ ```
67
49
 
68
- # Get unlimited airdrops
69
- solana airdrop 1000
50
+ This starts:
70
51
 
71
- # Deploy programs normally
72
- solana program deploy ./program.so
73
- ```
52
+ - 🌐 **RPC Server**: `http://127.0.0.1:8899`
53
+ - 📡 **WebSocket**: `ws://127.0.0.1:8900`
54
+ - 🎨 **Web GUI**: `http://127.0.0.1:42069`
74
55
 
75
- ### With @solana/kit
56
+ ### 2️⃣ Configure Solana CLI
76
57
 
77
- ```typescript
78
- import { createSolanaRpc, generateKeyPairSigner, lamports } from "@solana/kit";
58
+ ```bash
59
+ solana config set -u http://127.0.0.1:8899
60
+ ```
79
61
 
80
- const rpc = createSolanaRpc("http://localhost:8899");
62
+ ### 3️⃣ Get Some SOL
81
63
 
82
- // Get account balance
83
- const { value: balance } = await rpc.getBalance(address).send();
64
+ ```bash
65
+ # Using Solana CLI
66
+ solana airdrop 1000
84
67
 
85
- // Request airdrops (no limits!)
86
- const signature = await rpc
87
- .requestAirdrop(
88
- address,
89
- lamports(1_000_000_000n), // 1 SOL
90
- )
91
- .send();
68
+ # Using SolForge CLI
69
+ solforge airdrop --to <PUBKEY> --sol 100
92
70
  ```
93
71
 
94
- ### With web3.js
72
+ ## 📚 Command Reference
95
73
 
96
- ```typescript
97
- import { Connection, PublicKey, LAMPORTS_PER_SOL } from "@solana/web3.js";
74
+ ### 🔧 Server Commands
98
75
 
99
- const connection = new Connection("http://localhost:8899");
76
+ #### Start Server
100
77
 
101
- // Get account info
102
- const accountInfo = await connection.getAccountInfo(publicKey);
78
+ ```bash
79
+ # Basic start
80
+ solforge start
103
81
 
104
- // Send transaction
105
- const signature = await connection.sendTransaction(transaction, [keypair]);
106
- ```
82
+ # Custom ports
83
+ solforge start --port 8899 --ws-port 8900
107
84
 
108
- ### With Anchor
85
+ # Bind to 0.0.0.0 for LAN access
86
+ solforge start --network
87
+ ```
109
88
 
110
- ```typescript
111
- // anchor.toml - use default settings
112
- [provider]
113
- cluster = \"http://127.0.0.1:8899\"
114
- wallet = \"~/.config/solana/id.json\"
89
+ ### 💰 Airdrop Commands
115
90
 
116
- // Deploy and test normally
117
- anchor build
118
- anchor deploy
119
- anchor test --skip-local-validator # SolForge is already running
120
- ```
91
+ #### Send SOL
121
92
 
122
- ## 🖥️ GUI Dashboard
93
+ ```bash
94
+ # Airdrop to specific address
95
+ solforge airdrop --to <PUBKEY> --sol 100
123
96
 
124
- Solforge ships a dark-mode dashboard that starts alongside the RPC server. By default it listens on `http://127.0.0.1:42069` and provides:
97
+ # Interactive mode
98
+ solforge airdrop
99
+ ```
125
100
 
126
- - Quick airdrops and SPL mints via a faucet-aware form.
127
- - Live RPC metrics (slot, block height, transaction count, blockhash, faucet balance).
128
- - Tables of cloned programs and token mints with one-click modals to import additional assets.
101
+ ### 🪙 Token Commands
129
102
 
130
- ### Launching the Dashboard
103
+ #### Create Token
131
104
 
132
105
  ```bash
133
- # Run the interactive CLI (starts RPC + GUI)
134
- bun src/cli/main.ts
106
+ # Interactive token creation
107
+ solforge mint
135
108
 
136
- # Or start directly
137
- bun src/cli/main.ts start
109
+ # Create new token
110
+ solforge token create --decimals 9 --supply 1000000
138
111
 
139
- # Open the dashboard
140
- open http://127.0.0.1:42069
141
- ```
112
+ # Clone from mainnet
113
+ solforge token clone <MINT_ADDRESS>
142
114
 
143
- ### GUI API Endpoints
115
+ # Adopt mint authority
116
+ solforge token adopt-authority <MINT_ADDRESS>
117
+ ```
144
118
 
145
- The GUI server exposes REST endpoints backed by the same JSON-RPC methods:
119
+ ### 📦 Program Commands
146
120
 
147
- | Method & Path | Description |
148
- | ------------------------- | ------------------------------------ |
149
- | `GET /api/status` | Aggregated RPC stats + faucet info |
150
- | `GET /api/programs` | List the registered programs |
151
- | `GET /api/tokens` | Detailed SPL mint metadata |
152
- | `POST /api/airdrop` | Proxy to `requestAirdrop` |
153
- | `POST /api/mint` | Proxy to `solforgeMintTo` |
154
- | `POST /api/clone/program` | Proxy to program clone helpers |
155
- | `POST /api/clone/token` | Proxy to token clone helpers |
121
+ #### Clone Program
156
122
 
157
- Override the GUI port via `sf.config.json` (`gui.port`) or `SOLFORGE_GUI_PORT`.
123
+ ```bash
124
+ # Clone program from mainnet
125
+ solforge program clone <PROGRAM_ID>
158
126
 
159
- Run `bun run build:css` before `bun run build:bin` to embed the latest Tailwind styles in the standalone binary.
127
+ # Clone with accounts
128
+ solforge program clone <PROGRAM_ID> --with-accounts
160
129
 
130
+ # Clone specific accounts
131
+ solforge program accounts clone <PROGRAM_ID> --limit 100
161
132
 
162
- ## 🔧 Configuration
133
+ # Load local program
134
+ solforge program load --file ./program.so --id <PROGRAM_ID>
135
+ ```
163
136
 
164
- SolForge works with zero configuration, but can be customized via environment variables or config file.
137
+ ### ⚙️ Configuration Commands
165
138
 
166
- ### Environment Variables
139
+ #### Initialize Config
167
140
 
168
141
  ```bash
169
- # Server settings
170
- export RPC_PORT=8899 # HTTP port (WS uses port+1)
171
- export DEBUG_RPC_LOG=1 # Log all RPC calls
142
+ # Create default config
143
+ solforge config init
172
144
 
173
- # Database
174
- export SOLFORGE_DB_MODE=ephemeral # or 'persistent'
175
- export SOLFORGE_DB_PATH=.solforge/db.db
145
+ # Get config value
146
+ solforge config get server.rpcPort
176
147
 
177
- # Faucet
178
- export SOLFORGE_FAUCET_LAMPORTS=1000000000000000 # 1M SOL
148
+ # Set config value
149
+ solforge config set server.rpcPort 9999
179
150
  ```
180
151
 
181
- ### Config File (sf.config.json)
152
+ ## 📝 Configuration File
182
153
 
183
- ```bash
184
- # Generate default config
185
- bun src/cli/main.ts config init
186
-
187
- # Edit configuration
188
- bun src/cli/main.ts config set server.rpcPort 9000
189
- bun src/cli/main.ts config get server.db.mode
190
- ```
154
+ Create `sf.config.json` in your project root:
191
155
 
192
156
  ```json
193
157
  {
194
- \"server\": {
195
- \"rpcPort\": 8899,
196
- \"wsPort\": 8900,
197
- \"db\": {
198
- \"mode\": \"ephemeral\",
199
- \"path\": \".solforge/db.db\"
200
- }
158
+ "server": {
159
+ "rpcPort": 8899,
160
+ "wsPort": 8900,
201
161
  },
202
- \"svm\": {
203
- \"initialLamports\": \"1000000000000000\",
204
- \"faucetSOL\": 1000
162
+ "svm": {
163
+ "initialLamports": "1000000000000000",
164
+ "faucetSOL": 1000
205
165
  },
206
- \"clone\": {
207
- \"endpoint\": \"https://api.mainnet-beta.solana.com\",
208
- \"programs\": [],
209
- \"tokens\": [],
210
- \"programAccounts\": []
166
+ "clone": {
167
+ "endpoint": "https://api.mainnet-beta.solana.com",
168
+ "programs": [
169
+ "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
170
+ "11111111111111111111111111111111"
171
+ ],
172
+ "tokens": ["So11111111111111111111111111111111111111112"],
173
+ "programAccounts": [
174
+ {
175
+ "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
176
+ "limit": 10
177
+ }
178
+ ]
211
179
  },
212
- \"gui\": {
213
- \"enabled\": true,
214
- \"port\": 42069
180
+ "gui": {
181
+ "enabled": true,
182
+ "port": 42069
215
183
  },
216
- \"bootstrap\": {
217
- \"airdrops\": []
184
+ "bootstrap": {
185
+ "airdrops": [
186
+ {
187
+ "address": "YOUR_WALLET_ADDRESS",
188
+ "amountSol": 100
189
+ }
190
+ ]
218
191
  }
219
192
  }
220
193
  ```
221
194
 
222
- ## 🛠️ CLI Tools
223
-
224
- SolForge includes powerful CLI tools for development:
195
+ ### 🔑 Configuration Options
225
196
 
226
- ```bash
227
- # Airdrop SOL to any address
228
- bun src/cli/main.ts airdrop --to <pubkey> --sol 100
229
-
230
- # Interactive token minting
231
- bun src/cli/main.ts mint
197
+ | Option | Description | Default |
198
+ | --------------------- | ------------------------------------------- | ------------------------------------- |
199
+ | `server.rpcPort` | HTTP RPC port | `8899` |
200
+ | `server.wsPort` | WebSocket port | `8900` |
201
+ | `server.network` | Bind to `0.0.0.0` for LAN access | `false` |
202
+ | `svm.initialLamports` | Initial lamports for accounts | `1000000000000000` |
203
+ | `svm.faucetSOL` | SOL amount per airdrop | `1000` |
204
+ | `clone.endpoint` | RPC endpoint for cloning | `https://api.mainnet-beta.solana.com` |
205
+ | `clone.programs` | Program IDs to clone on startup | `[]` |
206
+ | `clone.tokens` | Token mints to clone on startup | `[]` |
207
+ | `gui.enabled` | Enable web GUI | `true` |
208
+ | `gui.port` | GUI port | `42069` |
209
+ | `bootstrap.airdrops` | Auto-airdrops on startup | `[]` |
232
210
 
233
- # Clone mainnet programs and data
234
- bun src/cli/main.ts program clone <program-id>
235
- bun src/cli/main.ts token clone <mint-address>
211
+ ## 🌍 Environment Variables
236
212
 
237
- # Manage configuration
238
- bun src/cli/main.ts config init
239
- bun src/cli/main.ts config set server.rpcPort 9000
240
- ```
213
+ Override configuration with environment variables:
241
214
 
242
- ## 📡 RPC Method Coverage
243
-
244
- ### ✅ Fully Implemented (90+ methods)
245
-
246
- **Account Operations**
247
-
248
- - `getAccountInfo`, `getMultipleAccounts`, `getBalance`
249
- - `getParsedAccountInfo`, `getProgramAccounts`
215
+ ```bash
216
+ # Server settings
217
+ export RPC_PORT=8899
218
+ export SOLFORGE_GUI_PORT=3000
250
219
 
251
- **Transaction Operations**
220
+ # Debug mode
221
+ export DEBUG_RPC_LOG=1 # Log all RPC calls
252
222
 
253
- - `sendTransaction`, `simulateTransaction`, `getTransaction`
254
- - `getSignatureStatuses`, `getSignaturesForAddress`
223
+ # Start with env vars
224
+ solforge start
225
+ ```
255
226
 
256
- **Block & Slot Operations**
227
+ ## 🔌 Integration Examples
257
228
 
258
- - `getLatestBlockhash`, `getBlock`, `getBlocks`, `getBlockHeight`
259
- - `getSlot`, `getSlotLeader`, `getSlotLeaders`
229
+ ### Anchor Framework
260
230
 
261
- **System & Network**
231
+ Configure `Anchor.toml`:
262
232
 
263
- - `getHealth`, `getVersion`, `getGenesisHash`, `getEpochInfo`
264
- - `getSupply`, `getInflationRate`, `getVoteAccounts`
233
+ ```toml
234
+ [provider]
235
+ cluster = "http://127.0.0.1:8899"
236
+ wallet = "~/.config/solana/id.json"
265
237
 
266
- **Fee Operations**
238
+ [scripts]
239
+ test = "solforge start && anchor test --skip-local-validator"
240
+ ```
267
241
 
268
- - `getFeeForMessage`, `getFees`, `getRecentPrioritizationFees`
242
+ ### @solana/web3.js
269
243
 
270
- **WebSocket Subscriptions**
244
+ ```javascript
245
+ import { Connection, LAMPORTS_PER_SOL, PublicKey } from "@solana/web3.js";
271
246
 
272
- - `signatureSubscribe/Unsubscribe` (real-time notifications)
273
- - Other subscriptions (stubbed but functional)
247
+ const connection = new Connection("http://127.0.0.1:8899", "confirmed");
274
248
 
275
- ### ⚠️ Minimal/Stubbed
249
+ // Request airdrop
250
+ const signature = await connection.requestAirdrop(
251
+ new PublicKey("YOUR_WALLET"),
252
+ 100 * LAMPORTS_PER_SOL,
253
+ );
276
254
 
277
- - Token-specific RPCs (returns defaults unless indexed)
278
- - Some advanced cluster RPCs (simplified for local dev)
255
+ // Get balance
256
+ const balance = await connection.getBalance(publicKey);
257
+ ```
279
258
 
280
- ## 💾 Data & Persistence
259
+ ### @solana/kit (Recommended)
281
260
 
282
- ### Ephemeral Mode (Default)
261
+ ```typescript
262
+ import { createSolanaRpc } from "@solana/kit";
263
+ import { address, lamports } from "@solana/web3.js";
283
264
 
284
- - SQLite database recreated on each restart
285
- - Perfect for testing and development
286
- - Stores full transaction history during session
265
+ const rpc = createSolanaRpc("http://127.0.0.1:8899");
287
266
 
288
- ### Persistent Mode
267
+ // Request airdrop
268
+ await rpc
269
+ .requestAirdrop(address("YOUR_WALLET"), lamports(1_000_000_000n))
270
+ .send();
289
271
 
290
- ```bash
291
- # Enable persistent storage
292
- export SOLFORGE_DB_MODE=persistent
293
- bun start
272
+ // Get balance
273
+ const balance = await rpc.getBalance(address("YOUR_WALLET")).send();
294
274
  ```
295
275
 
296
- ### Database Schema
297
-
298
- ```sql
299
- -- Transactions with full metadata
300
- CREATE TABLE transactions (
301
- signature TEXT PRIMARY KEY,
302
- slot INTEGER,
303
- raw_transaction BLOB, -- Full transaction data
304
- logs TEXT, -- JSON array of logs
305
- status TEXT, -- success/error
306
- fee INTEGER,
307
- timestamp INTEGER
308
- );
276
+ ## 🎨 Web GUI
309
277
 
310
- -- Account snapshots
311
- CREATE TABLE accounts (
312
- address TEXT PRIMARY KEY,
313
- lamports INTEGER,
314
- owner TEXT,
315
- data_len INTEGER,
316
- last_slot INTEGER
317
- );
278
+ The built-in GUI provides:
318
279
 
319
- -- Address to signature mapping
320
- CREATE TABLE address_signatures (
321
- address TEXT,
322
- signature TEXT,
323
- slot INTEGER
324
- );
325
- ```
280
+ - **📊 Dashboard**: Current slot, block height, recent transactions
281
+ - **💸 Airdrop Tool**: Quick SOL distribution interface
282
+ - **🪙 Token Minter**: Create and mint SPL tokens
283
+ - **📈 Status Monitor**: Real-time localnet statistics
326
284
 
327
- ## 🔌 WebSocket Support
285
+ Access at: `http://127.0.0.1:42069`
328
286
 
329
- ```javascript
330
- const ws = new WebSocket("ws://localhost:8900");
331
-
332
- // Subscribe to signature updates
333
- ws.send(
334
- JSON.stringify({
335
- jsonrpc: "2.0",
336
- id: 1,
337
- method: "signatureSubscribe",
338
- params: ["<signature>", { commitment: "confirmed" }],
339
- }),
340
- );
287
+ ## 🏗️ Building from Source
341
288
 
342
- // Receive real-time notifications
343
- ws.onmessage = (event) => {
344
- const response = JSON.parse(event.data);
345
- console.log("Signature update:", response);
346
- };
347
- ```
289
+ ### Prerequisites
348
290
 
349
- ## 🧪 Testing & Validation
291
+ - [Bun](https://bun.sh) runtime installed
292
+
293
+ ### Build Steps
350
294
 
351
295
  ```bash
352
- # Run comprehensive test suite
353
- bun run test-client.ts
296
+ # Clone repository
297
+ git clone https://github.com/nitishxyz/solforge.git
298
+ cd solforge
354
299
 
355
- # Test specific functionality
356
- bun test
300
+ # Install dependencies
301
+ bun install
357
302
 
358
- # Validate against real programs
359
- anchor test --skip-local-validator
360
- ```
303
+ # Run from source
304
+ bun src/cli/main.ts start
361
305
 
362
- ## 🏗️ Architecture Overview
306
+ # Build binary
307
+ bun run build:bin
363
308
 
364
- ```
365
- SolForge
366
- ├── 🧠 LiteSVM Core # In-memory execution engine
367
- ├── 🌐 HTTP Server # JSON-RPC over HTTP
368
- ├── 🔌 WebSocket Server # Real-time subscriptions
369
- ├── 🗃️ SQLite + Drizzle # Ephemeral data indexing
370
- ├── 💧 Smart Faucet # Unlimited SOL distribution
371
- └── 🎯 CLI Tools # Developer utilities
309
+ # Build for all platforms
310
+ bun run build:bin:all
372
311
  ```
373
312
 
374
- ### Key Components
313
+ ### Platform-Specific Builds
375
314
 
376
- - **`index.ts`**: Main server entry point
377
- - **`server/`**: HTTP and WebSocket servers
378
- - **`server/methods/`**: Modular RPC implementations
379
- - **`src/cli/`**: Command-line interface
380
- - **`src/config/`**: Configuration management
381
- - **`src/db/`**: Database schema and operations
315
+ ```bash
316
+ # macOS (Apple Silicon)
317
+ bun run build:bin:darwin-arm64
382
318
 
383
- ## 🤝 Development
319
+ # macOS (Intel)
320
+ bun run build:bin:darwin-x64
384
321
 
385
- ### Adding New RPC Methods
322
+ # Linux x64
323
+ bun run build:bin:linux-x64
386
324
 
387
- 1. Create method file: `server/methods/your-method.ts`
388
- 2. Implement the `RpcMethodHandler` interface
389
- 3. Export from `server/methods/index.ts`
390
- 4. Add to `rpcMethods` object
325
+ # Linux ARM64
326
+ bun run build:bin:linux-arm64
391
327
 
392
- ```typescript
393
- // server/methods/your-method.ts
394
- import type { RpcMethodHandler } from \"../types\";
395
-
396
- export const yourMethod: RpcMethodHandler = (id, params, context) => {
397
- try {
398
- const result = context.svm.someOperation();
399
- return context.createSuccessResponse(id, result);
400
- } catch (error: any) {
401
- return context.createErrorResponse(id, -32603, \"Internal error\");
402
- }
403
- };
328
+ # Windows
329
+ bun run build:bin:windows-x64
404
330
  ```
405
331
 
406
- ### Project Structure
332
+ ## 🗂️ Project Structure
407
333
 
408
334
  ```
409
335
  solforge/
410
- ├── index.ts # Main entry point
411
- ├── server/ # Core server
412
- │ ├── rpc-server.ts # HTTP server
413
- │ ├── ws-server.ts # WebSocket server
414
- │ ├── methods/ # RPC method implementations
415
- │ ├── account/ # Account methods
416
- │ │ ├── transaction/ # Transaction methods
417
- │ └── index.ts # Method registry
418
- └── lib/ # Utilities
419
- ├── src/ # CLI and config
420
- ├── cli/ # Command-line interface
421
- │ ├── config/ # Configuration management
422
- │ └── db/ # Database operations
423
- ├── test-client.ts # Integration tests
424
- └── docs/ # Documentation
336
+ ├── src/
337
+ ├── cli/ # CLI commands and routing
338
+ │ ├── config/ # Configuration management
339
+ │ ├── db/ # Database schemas and operations
340
+ │ ├── rpc/ # RPC server bootstrap
341
+ └── gui/ # Web GUI (React)
342
+ ├── server/
343
+ ├── methods/ # RPC method implementations
344
+ ├── lib/ # Shared utilities
345
+ │ └── types.ts # TypeScript definitions
346
+ ├── scripts/ # Build and setup scripts
347
+ └── sf.config.json # Configuration file
425
348
  ```
426
349
 
427
- ### Development Guidelines
350
+ ## 🔍 Troubleshooting
428
351
 
429
- - Use **Bun exclusively** (no npm/yarn/node)
430
- - Keep files **under 200 lines** (split when larger)
431
- - Follow **kebab-case** for filenames
432
- - Write **comprehensive tests**
433
- - Use **TypeScript strictly**
352
+ ### Port Already in Use
434
353
 
435
- ## 🐛 Troubleshooting
354
+ ```bash
355
+ # Use different port
356
+ solforge start --port 9999
436
357
 
437
- ### Common Issues
358
+ # Or update config
359
+ solforge config set server.rpcPort 9999
360
+ ```
438
361
 
439
- **Server won't start**
362
+ ### GUI Not Loading
440
363
 
441
364
  ```bash
442
- # Check if port is in use
443
- lsof -i :8899
365
+ # Check if port is available
366
+ lsof -i :42069
444
367
 
445
- # Use different port
446
- RPC_PORT=9000 bun start
368
+ # Use different GUI port
369
+ export SOLFORGE_GUI_PORT=3000
370
+ solforge start
447
371
  ```
448
372
 
449
- **Anchor deploy fails**
373
+
374
+
375
+ ### Connection Refused
450
376
 
451
377
  ```bash
452
- # Ensure relaxed validation (default)
378
+ # Verify server is running
379
+ curl http://127.0.0.1:8899/health
380
+
453
381
  # Check logs with debug mode
454
- DEBUG_RPC_LOG=1 bun start
382
+ DEBUG_RPC_LOG=1 solforge start
455
383
  ```
456
384
 
457
- **WebSocket connection issues**
385
+ ## 📊 Performance Comparison
458
386
 
459
- ```bash
460
- # WebSocket runs on RPC_PORT + 1
461
- # Default: ws://localhost:8900
462
- ```
387
+ | Metric | SolForge | solana-test-validator |
388
+ | ---------------- | -------- | --------------------- |
389
+ | Startup Time | < 1s | 10-30s |
390
+ | Memory Usage | ~50MB | 500MB+ |
391
+ | CPU Usage (idle) | < 1% | 5-10% |
392
+ | Airdrop Speed | Instant | Rate limited |
393
+ | Program Deploy | < 100ms | 1-2s |
394
+
395
+ ## 🤝 Contributing
396
+
397
+ We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
463
398
 
464
- **Airdrop not working**
399
+ ### Development Workflow
465
400
 
466
401
  ```bash
467
- # Check faucet was created
468
- ls .solforge/faucet.json
402
+ # Run tests
403
+ bun test
404
+
405
+ # Lint code
406
+ bun run lint
469
407
 
470
- # Manual airdrop via CLI
471
- bun src/cli/main.ts airdrop --to <address> --sol 10
408
+ # Format code
409
+ bun run format
472
410
  ```
473
411
 
474
- ## 🔮 Roadmap
412
+ ## 📚 API Coverage
475
413
 
476
- ### v0.3.0 - Enhanced RPC Coverage
414
+ ### Fully Implemented (90+ methods)
477
415
 
478
- - [ ] Complete token RPC implementations
479
- - [ ] Advanced subscription support
480
- - [ ] Improved error handling
416
+ - Account operations
417
+ - Transaction submission/simulation
418
+ - Block/slot queries
419
+ - Token operations
420
+ - Program deployment
421
+ - WebSocket subscriptions (signatures)
481
422
 
482
- ### v0.4.0 - Developer Experience
423
+ ### 🚧 Partial Support
483
424
 
484
- - [ ] Web-based dashboard
485
- - [ ] Time-travel debugging
486
- - [ ] Snapshot/restore functionality
425
+ - Stake operations
426
+ - Vote accounts
427
+ - Advanced subscriptions
487
428
 
488
- ### v0.5.0 - Production Features
429
+ ### 📋 Planned
489
430
 
490
- - [ ] Clustering support
491
- - [ ] Metrics and monitoring
492
- - [ ] Plugin architecture
431
+ - Snapshot/restore
432
+ - Time-travel debugging
433
+ - Multi-tenant support
493
434
 
494
- ## 📄 License
435
+ ## 🛠️ Advanced Usage
495
436
 
496
- MIT License - see LICENSE file for details.
437
+ ### Custom Program Development
497
438
 
498
- ## 🤝 Contributing
439
+ ```bash
440
+ # Deploy custom program
441
+ solana program deploy ./my-program.so
499
442
 
500
- We welcome contributions! Please see:
443
+ # Clone and modify existing program
444
+ solforge program clone <PROGRAM_ID>
445
+ ```
501
446
 
502
- - [AGENTS.md](./AGENTS.md) - Development guidelines
503
- - [PROJECT_STRUCTURE.md](./PROJECT_STRUCTURE.md) - Architecture details
504
- - [SOLFORGE.md](./SOLFORGE.md) - Vision and roadmap
447
+ ### CI/CD Integration
505
448
 
506
- ## 🙏 Acknowledgments
449
+ ```yaml
450
+ # GitHub Actions example
451
+ - name: Setup SolForge
452
+ run: |
453
+ curl -fsSL https://install.solforge.sh | sh
454
+ solforge start &
455
+ sleep 2
507
456
 
508
- Built with ❤️ using:
457
+ - name: Run Tests
458
+ run: |
459
+ anchor test --skip-local-validator
460
+ ```
509
461
 
510
- - [LiteSVM](https://github.com/litesvm/litesvm) - Fast Solana VM
511
- - [Bun](https://bun.sh) - Lightning-fast JavaScript runtime
512
- - [Drizzle](https://drizzle.team) - TypeScript SQL toolkit
462
+ ## 📄 License
513
463
 
514
- ---
464
+ MIT License - see [LICENSE](LICENSE) file for details.
515
465
 
516
- **⚡ Ready to build on Solana at lightning speed?**
466
+ ## 🔗 Links
517
467
 
518
- ```bash
519
- git clone https://github.com/nitishxyz/solforge
520
- cd solforge && bun install && bun start
521
- ```
468
+ - **GitHub**: [github.com/nitishxyz/solforge](https://github.com/nitishxyz/solforge)
469
+ - **Issues**: [Report bugs or request features](https://github.com/nitishxyz/solforge/issues)
470
+ - **Discord**: [Join our community](#) _(coming soon)_
471
+
472
+ ## 🙏 Acknowledgments
473
+
474
+ - Built on [LiteSVM](https://github.com/litesvm/litesvm) - Fast SVM implementation
475
+ - Powered by [Bun](https://bun.sh) - All-in-one JavaScript runtime
476
+ - Inspired by the Solana developer community
477
+
478
+ ---
522
479
 
523
- _Happy coding! 🦀_
480
+ <p align="center">
481
+ Made with ❤️ for Solana developers
482
+ </p>