Skip to content

Add Solana support to Starship #691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 35 additions & 4 deletions starship/charts/devnet/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -798,11 +798,42 @@ defaultChains:
exponent: 0
name: XPLA
display: XPLA
symbol: XPLA
solana:
image: ghcr.io/hyperweb-io/starship/solana:v1.18.26
home: /root/.solana
binary: solana-validator
prefix: sol
denom: lamports
prettyName: Solana
coins: 1000000000000000lamports
hdPath: m/44'/501'/0'/0'
coinType: 501
repo: https://github.com/solana-labs/solana
scripts:
createGenesis:
file: scripts/solana/create-genesis.sh
updateGenesis:
file: scripts/solana/update-genesis.sh
assets:
- base: lamports
description: "The native token of Solana"
name: Solana
display: sol
symbol: SOL
logo_URIs:
png: https://raw.githubusercontent.com/cosmos/chain-registry/master/xpla/images/xpla.png
svg: https://raw.githubusercontent.com/cosmos/chain-registry/master/xpla/images/xpla.svg
coingecko_id: xpla
png: "https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/So11111111111111111111111111111111111111112/logo.png"
svg: "https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/So11111111111111111111111111111111111111112/logo.svg"
denom_units:
- denom: lamports
exponent: 0
- denom: sol
exponent: 9
coingecko_id: solana
keywords: ["layer1"]
ports:
rpc: 8899
ws: 8900
gossip: 8001
ethereum:
image: ghcr.io/hyperweb-io/starship/ethereum/client-go:v1.14.12
home: /ethereum
Expand Down
16 changes: 16 additions & 0 deletions starship/charts/devnet/scripts/solana/create-genesis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -eux

solana-keygen new --no-bip39-passphrase -o $HOME/.solana/validator-keypair.json
solana-keygen new --no-bip39-passphrase -o $HOME/.solana/vote-account-keypair.json
solana-keygen new --no-bip39-passphrase -o $HOME/.solana/stake-account-keypair.json

solana-genesis \
--max-genesis-archive-unpacked-size 1073741824 \
--enable-warmup-epochs \
--bootstrap-validator \
$HOME/.solana/validator-keypair.json \
$HOME/.solana/vote-account-keypair.json \
$HOME/.solana/stake-account-keypair.json \
--ledger $HOME/.solana/ledger
7 changes: 7 additions & 0 deletions starship/charts/devnet/scripts/solana/update-genesis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

set -eux


echo "Solana genesis already configured"
solana-validator --version
3 changes: 2 additions & 1 deletion starship/charts/devnet/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@
"hyperweb",
"noble",
"xpla",
"ethereum"
"ethereum",
"solana"
]
},
"numValidators": {
Expand Down
18 changes: 18 additions & 0 deletions starship/docker/chains/Dockerfile.solana
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
ARG BASE_IMAGE=alpine:3.17
FROM ${BASE_IMAGE}

LABEL org.opencontainers.image.source="https://github.com/hyperweb-io/starship"

# Set up dependencies
ENV PACKAGES curl make bash jq sed

# Install minimum necessary dependencies and Solana requirements
RUN apk add --no-cache $PACKAGES libgcc libstdc++

# Download and install Solana binaries
RUN curl -sSfL https://github.com/solana-labs/solana/releases/download/v1.18.26/solana-release-x86_64-unknown-linux-gnu.tar.bz2 | \
tar -xj -C /tmp && \
mv /tmp/solana-release/bin/solana* /usr/bin/ && \
rm -rf /tmp/solana-release

WORKDIR /opt
5 changes: 5 additions & 0 deletions starship/docker/chains/versions.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
chains:
- name: solana
base: alpine:3.17
file: Dockerfile.solana
tags:
- v1.18.26
- name: osmosis
base: ghcr.io/strangelove-ventures/heighliner/osmosis
tags:
Expand Down
33 changes: 33 additions & 0 deletions starship/tests/e2e/configs/solana.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: starship-e2e-tests
version: 1.7.0

chains:
- id: solana-1
name: solana
numValidators: 1
metrics: true
ports:
rest: 8899
rpc: 8900
exposer: 38083
faucet: 8003
gossip: 8001
resources:
cpu: "0.5"
memory: 500M
genesis:
app_state: {}

registry:
enabled: true
ports:
rest: 8081
grpc: 9091
resources:
cpu: "0.1"
memory: 100M

resources:
wait:
cpu: "0.1"
memory: 100M
Loading