@solana-compass/cli 0.1.0 → 0.2.1

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.
@@ -0,0 +1,158 @@
1
+ # Troubleshooting
2
+
3
+ ## RPC Issues
4
+
5
+ ### "Rate limited" or slow responses
6
+
7
+ The public Solana RPC (`api.mainnet-beta.solana.com`) rate-limits
8
+ aggressively. Set a dedicated RPC endpoint:
9
+
10
+ ```bash
11
+ sol config set rpc.url https://your-rpc-endpoint.com
12
+ ```
13
+
14
+ Free RPC tiers are available from Helius, Triton, and QuickNode.
15
+
16
+ ### RPC resolution order
17
+
18
+ The CLI finds an RPC endpoint in this order:
19
+
20
+ 1. `--rpc` flag on the command
21
+ 2. `SOL_RPC_URL` environment variable
22
+ 3. `~/.sol/config.toml` → `rpc.url`
23
+ 4. Solana CLI config (`solana config get`)
24
+ 5. Public mainnet RPC (with warning)
25
+
26
+ ### "Failed to fetch blockhash" / connection errors
27
+
28
+ - Check that your RPC URL is correct: `sol config get rpc.url`
29
+ - Verify the endpoint is reachable: `curl <your-rpc-url> -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1,"method":"getHealth"}'`
30
+ - Try a different RPC provider
31
+
32
+ ## Token Resolution
33
+
34
+ ### Wrong token resolved
35
+
36
+ Symbol search is ranked by liquidity, but ambiguous symbols can
37
+ resolve to the wrong token. To verify:
38
+
39
+ ```bash
40
+ sol token info <symbol> # check the mint address
41
+ ```
42
+
43
+ To avoid ambiguity, use the mint address directly:
44
+
45
+ ```bash
46
+ sol token swap 50 usdc EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
47
+ ```
48
+
49
+ ### "Token not found"
50
+
51
+ - Run `sol token sync` to refresh the local cache
52
+ - Use the full mint address instead of a symbol
53
+ - Check if the token exists on Jupiter: some very new or illiquid
54
+ tokens may not be indexed yet
55
+
56
+ ## Transaction Issues
57
+
58
+ ### "Transaction simulation failed"
59
+
60
+ Common causes:
61
+ - **Insufficient balance**: Check with `sol wallet balance`
62
+ - **Slippage exceeded**: Increase with `--slippage <bps>` (e.g. `--slippage 200` for 2%)
63
+ - **Account not initialized**: The CLI creates associated token accounts
64
+ automatically, but some edge cases may require manual setup
65
+
66
+ ### "Transaction expired"
67
+
68
+ Solana transactions have a ~60-second lifetime. This can happen when:
69
+ - The RPC is slow to relay the transaction
70
+ - Network congestion is high
71
+
72
+ The CLI retries automatically with backoff. If it keeps failing, try
73
+ again or use a faster RPC endpoint.
74
+
75
+ ### "Blockhash not found"
76
+
77
+ Usually means the transaction took too long to confirm. The CLI
78
+ handles retry logic, but persistent failures suggest RPC issues.
79
+
80
+ ## Wallet Issues
81
+
82
+ ### "No wallets found"
83
+
84
+ Create one:
85
+
86
+ ```bash
87
+ sol wallet create --name main
88
+ ```
89
+
90
+ Or import from Solana CLI:
91
+
92
+ ```bash
93
+ sol wallet import --solana-cli
94
+ ```
95
+
96
+ ### "Wallet not found: <name>"
97
+
98
+ Check available wallets:
99
+
100
+ ```bash
101
+ sol wallet list
102
+ ```
103
+
104
+ Wallet names are case-sensitive.
105
+
106
+ ### Recovering a removed wallet
107
+
108
+ `sol wallet remove` renames the key file to `<name>.json.deleted` in
109
+ `~/.sol/wallets/`. To recover, rename it back:
110
+
111
+ ```bash
112
+ mv ~/.sol/wallets/old-wallet.json.deleted ~/.sol/wallets/old-wallet.json
113
+ ```
114
+
115
+ Then re-import it:
116
+
117
+ ```bash
118
+ sol wallet import ~/.sol/wallets/old-wallet.json --name old-wallet
119
+ ```
120
+
121
+ ## Staking Issues
122
+
123
+ ### "Stake account is activating"
124
+
125
+ New stakes take 1 epoch (~2-3 days) to become active. During this
126
+ time, the account shows as "activating" and cannot be withdrawn.
127
+
128
+ ### "Cannot withdraw active stake"
129
+
130
+ Active stake must be deactivated first. Use `--force` to deactivate:
131
+
132
+ ```bash
133
+ sol stake withdraw 7gK...abc --force
134
+ ```
135
+
136
+ After deactivation, wait one epoch for it to become inactive, then
137
+ withdraw.
138
+
139
+ ## Database Issues
140
+
141
+ ### Corrupted database
142
+
143
+ The SQLite database is at `~/.sol/data.db`. If it becomes corrupted:
144
+
145
+ ```bash
146
+ rm ~/.sol/data.db
147
+ ```
148
+
149
+ The CLI will recreate it on next run. You'll lose transaction history
150
+ and snapshots, but wallet key files are stored separately and are
151
+ not affected.
152
+
153
+ ## General Tips
154
+
155
+ - Use `--verbose` on any command to see debug output
156
+ - Use `--json` to get structured error messages with error codes
157
+ - Check `sol config list` to verify your settings
158
+ - Run `sol network` to verify RPC connectivity and see network status
@@ -0,0 +1,150 @@
1
+ # Wallet Commands Reference
2
+
3
+ ## Create a Wallet
4
+
5
+ ```bash
6
+ sol wallet create # auto-named (wallet-1, wallet-2, ...)
7
+ sol wallet create --name trading # pick a name
8
+ sol wallet create --name bot --count 5 # batch-create 5 wallets
9
+ ```
10
+
11
+ Creates a new Ed25519 keypair and stores it as a JSON key file in
12
+ `~/.sol/wallets/<name>.json` (Solana CLI compatible format, chmod 600).
13
+
14
+ The first wallet created becomes the default for all commands.
15
+
16
+ ## List Wallets
17
+
18
+ ```bash
19
+ sol wallet list # all wallets with SOL balances
20
+ sol wallet list --label trading # filter by label
21
+ ```
22
+
23
+ Shows wallet name, address, SOL balance, and whether it's the default.
24
+ Hints at `sol wallet balance <name>` for full token breakdown.
25
+
26
+ ## Check Balances
27
+
28
+ ```bash
29
+ sol wallet balance # default wallet, all tokens + USD
30
+ sol wallet balance trading # specific wallet
31
+ ```
32
+
33
+ Displays every token held with current USD values. Tokens below the
34
+ dust threshold ($0.0001) are grouped as dust.
35
+
36
+ ## Import an Existing Wallet
37
+
38
+ ```bash
39
+ sol wallet import --solana-cli # from ~/.config/solana/id.json
40
+ sol wallet import ./keypair.json --name cold
41
+ sol wallet import /path/to/key.json
42
+ ```
43
+
44
+ Copies the key file into `~/.sol/wallets/`. The `--solana-cli` flag
45
+ imports from the default Solana CLI keypair location.
46
+
47
+ ## Export / Show Key File Path
48
+
49
+ ```bash
50
+ sol wallet export main
51
+ ```
52
+
53
+ Prints the file system path to the key file. Does NOT print the
54
+ private key itself.
55
+
56
+ ## Remove a Wallet
57
+
58
+ ```bash
59
+ sol wallet remove old-wallet
60
+ ```
61
+
62
+ Removes the wallet from the registry. The key file is renamed with a
63
+ `.deleted` suffix (not permanently deleted) so it can be recovered.
64
+
65
+ ## Set Default Wallet
66
+
67
+ ```bash
68
+ sol wallet set-default trading
69
+ ```
70
+
71
+ Changes which wallet is used when `--wallet` is not specified.
72
+
73
+ ## Labels
74
+
75
+ ```bash
76
+ sol wallet label main --add trading # add a label
77
+ sol wallet label main --add defi --add bot # multiple labels
78
+ sol wallet label main --remove trading # remove a label
79
+ ```
80
+
81
+ Labels are freeform tags for organizing wallets. Use them with
82
+ `sol wallet list --label <label>` to filter.
83
+
84
+ ## Transaction History
85
+
86
+ ```bash
87
+ sol wallet history # recent transactions
88
+ sol wallet history --limit 20 # more results
89
+ sol wallet history --type swap # filter by type (swap, send, stake, lend)
90
+ sol wallet history trading # specific wallet
91
+ ```
92
+
93
+ Shows transactions from the local log — type, tokens, amounts, USD
94
+ values at execution time, and timestamps.
95
+
96
+ ## Fund via Fiat Onramp
97
+
98
+ ```bash
99
+ sol wallet fund # default wallet, default amount
100
+ sol wallet fund --amount 50 # specify USD amount
101
+ sol wallet fund trading --provider moonpay
102
+ ```
103
+
104
+ Generates a URL to purchase SOL via a fiat onramp provider. Opens
105
+ in your browser.
106
+
107
+ ## Global Wallet Flag
108
+
109
+ Any command that operates on a wallet accepts `--wallet <name-or-address>`:
110
+
111
+ ```bash
112
+ sol token swap 50 usdc bonk --wallet trading
113
+ sol stake new 10 --wallet cold
114
+ sol lend deposit 100 usdc --wallet defi
115
+ ```
116
+
117
+ ## JSON Output
118
+
119
+ All wallet commands support `--json`:
120
+
121
+ ```bash
122
+ sol wallet list --json
123
+ sol wallet balance --json
124
+ ```
125
+
126
+ ### Example: `sol wallet list --json`
127
+
128
+ ```json
129
+ {
130
+ "ok": true,
131
+ "data": {
132
+ "wallets": [
133
+ {
134
+ "name": "main",
135
+ "address": "7nY...xyz",
136
+ "sol_balance": 12.5,
137
+ "is_default": true,
138
+ "labels": ["trading"]
139
+ }
140
+ ]
141
+ },
142
+ "meta": { "elapsed_ms": 320 }
143
+ }
144
+ ```
145
+
146
+ ## Data Storage
147
+
148
+ - Key files: `~/.sol/wallets/<name>.json`
149
+ - Wallet registry: `~/.sol/data.db` (SQLite)
150
+ - Config: `~/.sol/config.toml`