Skip to content

Commit a5a799e

Browse files
authored
Merge pull request #721 from hyperweb-io/anmol/add-solana
feature: add solana to default values
2 parents 1e14e6d + 8047d9f commit a5a799e

37 files changed

+2326
-13
lines changed

.github/workflows/pr-tests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
- "one-chain-cometmock.yaml"
4646
- "one-cosmoshub-cosmjs-faucet.yaml"
4747
- "eth-lite.yaml"
48+
- "solana-lite.yaml"
4849
fail-fast: true
4950
max-parallel: 3
5051

docs/config/_meta.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"chains": "Chains Directive Syntax",
44
"relayers": "Relayers Directive Syntax",
55
"features": "Feature Toggles",
6-
"ethereum": "Ethereum"
6+
"ethereum": "Ethereum",
7+
"solana": "Solana"
78
}

docs/config/solana.mdx

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
# Solana Chain Configuration in Starship
2+
3+
Solana support in Starship allows users to deploy Solana validator nodes using simple configurations.
4+
This section details how to configure Solana-based chains within Starship.
5+
6+
## Solana Chain
7+
8+
The Solana chain runs a Solana validator node that can handle transactions and maintain the blockchain state.
9+
10+
### Basic Config
11+
```yaml
12+
chains:
13+
- id: solana
14+
name: solana
15+
numValidators: 2
16+
ports:
17+
rpc: 8899
18+
ws: 8900
19+
exposer: 8001
20+
faucet: 9900
21+
resources:
22+
cpu: 2000m
23+
memory: 2048Mi
24+
```
25+
26+
### Lite Configuration (CI/Testing)
27+
28+
For CI environments or testing scenarios where you need minimal resource usage, you can use the lite configuration:
29+
30+
```yaml
31+
chains:
32+
- id: solana
33+
name: solana
34+
numValidators: 1
35+
ports:
36+
rpc: 8899
37+
ws: 8900
38+
exposer: 8001
39+
faucet: 9900
40+
resources:
41+
cpu: 1500m
42+
memory: 1500Mi
43+
44+
exposer:
45+
resources:
46+
cpu: 100m
47+
memory: 100Mi
48+
49+
faucet:
50+
resources:
51+
cpu: 200m
52+
memory: 200Mi
53+
```
54+
55+
## Configuration Options
56+
57+
### Chain Properties
58+
59+
- **id**: The chain identifier (can be string or number)
60+
- **name**: Must be `"solana"` for Solana chains
61+
- **numValidators**: Number of validator nodes to deploy (minimum: 1)
62+
63+
### Ports
64+
65+
- **rpc**: JSON RPC port (default: 8899)
66+
- **ws**: WebSocket port (default: 8900)
67+
- **exposer**: Exposer service port for chain information
68+
- **faucet**: Faucet service port for requesting test tokens
69+
70+
### Resources
71+
72+
You can specify CPU and memory resources for the Solana validators:
73+
74+
```yaml
75+
resources:
76+
cpu: 2000m # 2 CPU cores
77+
memory: 2048Mi # 2GB RAM
78+
```
79+
80+
For lighter deployments (like CI), you can reduce these requirements:
81+
82+
```yaml
83+
resources:
84+
cpu: 1500m # 1.5 CPU cores
85+
memory: 1500Mi # 1.5GB RAM
86+
```
87+
88+
## Default Configuration
89+
90+
Starship uses the following defaults for Solana chains:
91+
92+
- **Image**: `ghcr.io/hyperweb-io/starship/solana-agave:v2.3.4`
93+
- **Binary**: `solana-validator`
94+
- **Home Directory**: `/root/.solana`
95+
- **Denomination**: `lamports` (base unit), `sol` (display unit)
96+
- **HD Path**: `m/44'/501'/0'/0'`
97+
- **Coin Type**: 501
98+
- **Faucet**: Enabled by default with Solana-specific faucet
99+
100+
## Registry Integration
101+
102+
When using the registry service, Solana chains are automatically registered with the following asset information:
103+
104+
```yaml
105+
registry:
106+
enabled: true
107+
ports:
108+
rest: 8081
109+
resources:
110+
cpu: "0.1"
111+
memory: "100M"
112+
```
113+
114+
## Usage Examples
115+
116+
### Full Development Environment
117+
118+
For a complete development setup with multiple validators:
119+
120+
```yaml
121+
name: solana-dev
122+
version: 1.10.0
123+
124+
chains:
125+
- id: solana
126+
name: solana
127+
numValidators: 2
128+
ports:
129+
rpc: 8899
130+
ws: 8900
131+
exposer: 8001
132+
faucet: 9900
133+
resources:
134+
cpu: 2000m
135+
memory: 2048Mi
136+
137+
registry:
138+
enabled: true
139+
ports:
140+
rest: 8081
141+
```
142+
143+
### CI/Testing Environment
144+
145+
For continuous integration or testing environments where resources are limited:
146+
147+
```yaml
148+
name: solana-ci
149+
version: 1.10.0
150+
151+
chains:
152+
- id: solana
153+
name: solana
154+
numValidators: 1
155+
ports:
156+
rpc: 8899
157+
ws: 8900
158+
exposer: 8001
159+
faucet: 9900
160+
resources:
161+
cpu: 1500m
162+
memory: 1500Mi
163+
164+
exposer:
165+
resources:
166+
cpu: 100m
167+
memory: 100Mi
168+
169+
faucet:
170+
resources:
171+
cpu: 200m
172+
memory: 200Mi
173+
```
174+
175+
This lite configuration is perfect for CI pipelines where you need to test Solana functionality with minimal resource overhead.

packages/packages/client/src/client.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ const defaultPorts: PodPorts = {
7474
rest: 8545,
7575
ws: 8546
7676
},
77+
solana: {
78+
rpc: 8899,
79+
ws: 8900,
80+
exposer: 8081,
81+
faucet: 9900
82+
},
7783
defaultPorts: {
7884
rpc: 26657,
7985
grpc: 9090,

packages/packages/generator/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
},
2222
"scripts": {
2323
"copy": "copyfiles -f ../../LICENSE README.md package.json dist",
24-
"clean": "del dist/**; del __tests__/__output__/**",
24+
"clean": "del dist/**",
25+
"clean:test": "del __tests__/__output__/**",
2526
"prepare": "npm run build",
2627
"build": "npm run clean; tsc; tsc -p tsconfig.esm.json; npm run copy",
2728
"dev": "ts-node src/index",

starship/charts/devnet/defaults.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,37 @@ defaultChains:
803803
png: https://raw.githubusercontent.com/cosmos/chain-registry/master/xpla/images/xpla.png
804804
svg: https://raw.githubusercontent.com/cosmos/chain-registry/master/xpla/images/xpla.svg
805805
coingecko_id: xpla
806+
solana:
807+
type: solana
808+
image: ghcr.io/hyperweb-io/starship/solana-agave:v2.3.4
809+
home: /root/.solana
810+
binary: solana-validator
811+
prefix: sol
812+
denom: lamports
813+
prettyName: Solana
814+
coins: 1000000000000000lamports
815+
hdPath: m/44'/501'/0'/0'
816+
coinType: 501
817+
repo: https://github.com/anzaxyz/agave
818+
faucet:
819+
enabled: true
820+
type: solana-faucet
821+
assets:
822+
- base: lamports
823+
description: "The native token of Solana"
824+
name: Solana
825+
display: sol
826+
symbol: SOL
827+
logo_URIs:
828+
png: "https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/So11111111111111111111111111111111111111112/logo.png"
829+
svg: "https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/So11111111111111111111111111111111111111112/logo.svg"
830+
denom_units:
831+
- denom: lamports
832+
exponent: 0
833+
- denom: sol
834+
exponent: 9
835+
coingecko_id: solana
836+
keywords: ["layer1"]
806837
ethereum:
807838
image: ghcr.io/hyperweb-io/starship/ethereum/client-go:v1.14.12
808839
home: /ethereum
@@ -1008,6 +1039,9 @@ defaultFaucet:
10081039
starship:
10091040
image: ghcr.io/hyperweb-io/starship/faucet:20250325-2207109
10101041
concurrency: 5
1042+
solana-faucet:
1043+
image: ghcr.io/hyperweb-io/starship/solana-agave:v2.3.4
1044+
concurrency: 5
10111045

10121046
defaultCometmock:
10131047
image: ghcr.io/informalsystems/cometmock:v0.37.x
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
3+
here=$(dirname "$0")
4+
# shellcheck source=multinode-demo/common.sh
5+
source "$here"/common.sh
6+
7+
# shellcheck source=net/common.sh
8+
source "$(cd "$here"/..; pwd)"/net/common.sh
9+
10+
args=()
11+
default_arg --entrypoint 127.0.0.1:8001
12+
default_arg --faucet 127.0.0.1:9900
13+
default_arg --tx_count 50000
14+
default_arg --duration 90
15+
16+
exec "$solana_bench_tps" "${args[@]}" "$@"

0 commit comments

Comments
 (0)