solforge 0.2.4 → 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 (42) hide show
  1. package/README.md +471 -79
  2. package/cli.cjs +106 -78
  3. package/package.json +1 -1
  4. package/scripts/install.sh +1 -1
  5. package/scripts/postinstall.cjs +66 -58
  6. package/server/methods/program/get-token-accounts-by-owner.ts +7 -2
  7. package/server/ws-server.ts +4 -1
  8. package/src/api-server-entry.ts +91 -91
  9. package/src/cli/commands/rpc-start.ts +4 -1
  10. package/src/cli/main.ts +7 -3
  11. package/src/cli/run-solforge.ts +20 -6
  12. package/src/commands/add-program.ts +324 -328
  13. package/src/commands/init.ts +106 -106
  14. package/src/commands/list.ts +125 -125
  15. package/src/commands/mint.ts +246 -246
  16. package/src/commands/start.ts +834 -831
  17. package/src/commands/status.ts +80 -80
  18. package/src/commands/stop.ts +381 -382
  19. package/src/config/manager.ts +149 -149
  20. package/src/gui/public/app.css +1556 -1
  21. package/src/gui/public/build/main.css +1569 -1
  22. package/src/gui/server.ts +20 -21
  23. package/src/gui/src/app.tsx +56 -37
  24. package/src/gui/src/components/airdrop-mint-form.tsx +17 -11
  25. package/src/gui/src/components/clone-program-modal.tsx +6 -6
  26. package/src/gui/src/components/clone-token-modal.tsx +7 -7
  27. package/src/gui/src/components/modal.tsx +13 -11
  28. package/src/gui/src/components/programs-panel.tsx +27 -15
  29. package/src/gui/src/components/status-panel.tsx +31 -17
  30. package/src/gui/src/components/tokens-panel.tsx +25 -19
  31. package/src/gui/src/index.css +491 -463
  32. package/src/index.ts +161 -146
  33. package/src/rpc/start.ts +1 -1
  34. package/src/services/api-server.ts +470 -473
  35. package/src/services/port-manager.ts +167 -167
  36. package/src/services/process-registry.ts +143 -143
  37. package/src/services/program-cloner.ts +312 -312
  38. package/src/services/token-cloner.ts +799 -797
  39. package/src/services/validator.ts +288 -288
  40. package/src/types/config.ts +71 -71
  41. package/src/utils/shell.ts +75 -75
  42. package/src/utils/token-loader.ts +77 -77
@@ -1,99 +1,99 @@
1
1
  import chalk from "chalk";
2
- import { runCommand, checkSolanaTools } from "../utils/shell.js";
3
2
  import { configManager } from "../config/manager.js";
4
3
  import { processRegistry } from "../services/process-registry.js";
4
+ import { checkSolanaTools, runCommand } from "../utils/shell.js";
5
5
 
6
6
  export async function statusCommand(): Promise<void> {
7
- console.log(chalk.blue("šŸ“Š Checking system status...\n"));
7
+ console.log(chalk.blue("šŸ“Š Checking system status...\n"));
8
8
 
9
- // Check Solana CLI tools
10
- console.log(chalk.cyan("šŸ”§ Solana CLI Tools:"));
11
- const tools = await checkSolanaTools();
9
+ // Check Solana CLI tools
10
+ console.log(chalk.cyan("šŸ”§ Solana CLI Tools:"));
11
+ const tools = await checkSolanaTools();
12
12
 
13
- console.log(
14
- ` ${tools.solana ? "āœ…" : "āŒ"} solana CLI: ${
15
- tools.solana ? "Available" : "Not found"
16
- }`
17
- );
18
- console.log(
19
- ` ${tools.splToken ? "āœ…" : "āŒ"} spl-token CLI: ${
20
- tools.splToken ? "Available" : "Not found"
21
- }`
22
- );
13
+ console.log(
14
+ ` ${tools.solana ? "āœ…" : "āŒ"} solana CLI: ${
15
+ tools.solana ? "Available" : "Not found"
16
+ }`,
17
+ );
18
+ console.log(
19
+ ` ${tools.splToken ? "āœ…" : "āŒ"} spl-token CLI: ${
20
+ tools.splToken ? "Available" : "Not found"
21
+ }`,
22
+ );
23
23
 
24
- if (!tools.solana || !tools.splToken) {
25
- console.log(chalk.yellow("\nšŸ’” Install Solana CLI tools:"));
26
- console.log(
27
- chalk.gray(
28
- ' sh -c "$(curl -sSfL https://release.solana.com/v1.18.4/install)"'
29
- )
30
- );
31
- console.log();
32
- }
24
+ if (!tools.solana || !tools.splToken) {
25
+ console.log(chalk.yellow("\nšŸ’” Install Solana CLI tools:"));
26
+ console.log(
27
+ chalk.gray(
28
+ ' sh -c "$(curl -sSfL https://release.solana.com/v1.18.4/install)"',
29
+ ),
30
+ );
31
+ console.log();
32
+ }
33
33
 
34
- // Check running validators
35
- console.log(chalk.cyan("\nšŸ—ļø Validator Status:"));
34
+ // Check running validators
35
+ console.log(chalk.cyan("\nšŸ—ļø Validator Status:"));
36
36
 
37
- // Clean up dead processes first
38
- await processRegistry.cleanup();
37
+ // Clean up dead processes first
38
+ await processRegistry.cleanup();
39
39
 
40
- const validators = processRegistry.getRunning();
40
+ const validators = processRegistry.getRunning();
41
41
 
42
- if (validators.length === 0) {
43
- console.log(` āŒ No validators running`);
44
- console.log(` šŸ’” Run 'solforge start' to launch a validator`);
45
- } else {
46
- console.log(
47
- ` āœ… ${validators.length} validator${
48
- validators.length > 1 ? "s" : ""
49
- } running`
50
- );
42
+ if (validators.length === 0) {
43
+ console.log(` āŒ No validators running`);
44
+ console.log(` šŸ’” Run 'solforge start' to launch a validator`);
45
+ } else {
46
+ console.log(
47
+ ` āœ… ${validators.length} validator${
48
+ validators.length > 1 ? "s" : ""
49
+ } running`,
50
+ );
51
51
 
52
- for (const validator of validators) {
53
- const isRunning = await processRegistry.isProcessRunning(validator.pid);
54
- if (isRunning) {
55
- console.log(` šŸ”¹ ${validator.name} (${validator.id}):`);
56
- console.log(` 🌐 RPC: ${validator.rpcUrl}`);
57
- console.log(` šŸ’° Faucet: ${validator.faucetUrl}`);
58
- console.log(` šŸ†” PID: ${validator.pid}`);
52
+ for (const validator of validators) {
53
+ const isRunning = await processRegistry.isProcessRunning(validator.pid);
54
+ if (isRunning) {
55
+ console.log(` šŸ”¹ ${validator.name} (${validator.id}):`);
56
+ console.log(` 🌐 RPC: ${validator.rpcUrl}`);
57
+ console.log(` šŸ’° Faucet: ${validator.faucetUrl}`);
58
+ console.log(` šŸ†” PID: ${validator.pid}`);
59
59
 
60
- // Get current slot for this validator
61
- try {
62
- const slotResult = await runCommand(
63
- "solana",
64
- ["slot", "--url", validator.rpcUrl, "--output", "json"],
65
- { silent: true, jsonOutput: true }
66
- );
60
+ // Get current slot for this validator
61
+ try {
62
+ const slotResult = await runCommand(
63
+ "solana",
64
+ ["slot", "--url", validator.rpcUrl, "--output", "json"],
65
+ { silent: true, jsonOutput: true },
66
+ );
67
67
 
68
- if (slotResult.success && typeof slotResult.stdout === "object") {
69
- console.log(` šŸ“Š Current slot: ${slotResult.stdout}`);
70
- }
71
- } catch {
72
- // Ignore slot check errors
73
- }
74
- } else {
75
- processRegistry.updateStatus(validator.id, "stopped");
76
- console.log(
77
- ` āš ļø ${validator.name} (${validator.id}): Process stopped`
78
- );
79
- }
80
- }
68
+ if (slotResult.success && typeof slotResult.stdout === "object") {
69
+ console.log(` šŸ“Š Current slot: ${slotResult.stdout}`);
70
+ }
71
+ } catch {
72
+ // Ignore slot check errors
73
+ }
74
+ } else {
75
+ processRegistry.updateStatus(validator.id, "stopped");
76
+ console.log(
77
+ ` āš ļø ${validator.name} (${validator.id}): Process stopped`,
78
+ );
79
+ }
80
+ }
81
81
 
82
- console.log(` šŸ’” Run 'solforge list' for detailed validator information`);
83
- }
82
+ console.log(` šŸ’” Run 'solforge list' for detailed validator information`);
83
+ }
84
84
 
85
- // Check config file
86
- console.log(chalk.cyan("\nšŸ“„ Configuration:"));
87
- try {
88
- const config = configManager.getConfig();
89
- console.log(` āœ… Config loaded: ${configManager.getConfigPath()}`);
90
- console.log(` šŸ“ Project: ${config.name}`);
91
- console.log(` šŸŖ™ Tokens: ${config.tokens.length}`);
92
- console.log(` šŸ“¦ Programs: ${config.programs.length}`);
93
- } catch (error) {
94
- console.log(` āŒ No valid configuration found`);
95
- console.log(` šŸ’” Run 'solforge init' to create one`);
96
- }
85
+ // Check config file
86
+ console.log(chalk.cyan("\nšŸ“„ Configuration:"));
87
+ try {
88
+ const config = configManager.getConfig();
89
+ console.log(` āœ… Config loaded: ${configManager.getConfigPath()}`);
90
+ console.log(` šŸ“ Project: ${config.name}`);
91
+ console.log(` šŸŖ™ Tokens: ${config.tokens.length}`);
92
+ console.log(` šŸ“¦ Programs: ${config.programs.length}`);
93
+ } catch (error) {
94
+ console.log(` āŒ No valid configuration found`);
95
+ console.log(` šŸ’” Run 'solforge init' to create one`);
96
+ }
97
97
 
98
- console.log();
98
+ console.log();
99
99
  }