Skip to content

Commit b95653c

Browse files
bump to photon 0.50.1 in install.sh (#1830)
1 parent 59fb024 commit b95653c

File tree

1 file changed

+39
-6
lines changed

1 file changed

+39
-6
lines changed

scripts/install.sh

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ VERSIONS=(
1313
"solana:2.2.15"
1414
"anchor:anchor-v0.29.0"
1515
"jq:jq-1.7.1"
16-
"photon:0.50.0"
16+
"photon:0.50.1"
1717
"redis:8.0.1"
1818
)
1919

@@ -107,8 +107,6 @@ install_rust() {
107107
export PATH="${PREFIX}/cargo/bin:${PATH}"
108108
rustup component add --toolchain 1.86-x86_64-unknown-linux-gnu clippy
109109
cargo install cargo-expand --locked
110-
# temp - commit hash from PR as of 2025-06-16
111-
cargo install --git https://github.com/lightprotocol/photon.git --rev 49b7e7f0d668babbc4d65fe8a0a7236df76f75a8 --locked
112110
log "rust"
113111
else
114112
echo "Rust already installed, skipping..."
@@ -190,6 +188,35 @@ install_jq() {
190188
fi
191189
}
192190

191+
install_photon() {
192+
# Check if photon is properly installed and correct version
193+
local expected_version=$(get_version "photon")
194+
local photon_installed=false
195+
local photon_correct_version=false
196+
197+
export CARGO_HOME="${PREFIX}/cargo"
198+
export PATH="${PREFIX}/cargo/bin:${PATH}"
199+
200+
if [ -f "${PREFIX}/cargo/bin/photon" ]; then
201+
photon_installed=true
202+
# Check version
203+
if photon_version=$(${PREFIX}/cargo/bin/photon --version 2>/dev/null); then
204+
if echo "$photon_version" | grep -q "$expected_version"; then
205+
photon_correct_version=true
206+
fi
207+
fi
208+
fi
209+
210+
if [ "$photon_installed" = false ] || [ "$photon_correct_version" = false ]; then
211+
echo "Installing Photon indexer (version $expected_version)..."
212+
# Use git commit for now as specified in constants.ts
213+
cargo install --git https://github.com/lightprotocol/photon.git --rev 49b7e7f0d668babbc4d65fe8a0a7236df76f75a8 --locked --force
214+
log "photon"
215+
else
216+
echo "Photon already installed with correct version, skipping..."
217+
fi
218+
}
219+
193220
download_gnark_keys() {
194221
ROOT_DIR="$(git rev-parse --show-toplevel)"
195222
# Always check if keys actually exist, not just the install log
@@ -369,6 +396,7 @@ main() {
369396
local key_type="light"
370397
local reset_log=true
371398
local skip_components=""
399+
local force_reinstall=false
372400

373401
while [[ $# -gt 0 ]]; do
374402
case $1 in
@@ -388,16 +416,20 @@ main() {
388416
skip_components="$2"
389417
shift 2
390418
;;
419+
--force-reinstall)
420+
force_reinstall=true
421+
shift
422+
;;
391423
*)
392424
echo "Unknown option: $1"
393-
echo "Usage: $0 [--full-keys] [--no-reset] [--skip-components <comma-separated-list>]"
394-
echo "Components that can be skipped: go,rust,node,pnpm,solana,anchor,jq,keys,dependencies,redis"
425+
echo "Usage: $0 [--full-keys] [--no-reset] [--skip-components <comma-separated-list>] [--force-reinstall]"
426+
echo "Components that can be skipped: go,rust,node,pnpm,solana,anchor,jq,photon,keys,dependencies,redis"
395427
exit 1
396428
;;
397429
esac
398430
done
399431

400-
if $reset_log; then
432+
if $reset_log || $force_reinstall; then
401433
rm -f "$INSTALL_LOG"
402434
fi
403435

@@ -410,6 +442,7 @@ main() {
410442
# Install components unless explicitly skipped
411443
should_skip "go" || install_go
412444
should_skip "rust" || install_rust
445+
should_skip "photon" || install_photon
413446
should_skip "node" || install_node
414447
should_skip "pnpm" || install_pnpm
415448
should_skip "solana" || install_solana

0 commit comments

Comments
 (0)