@@ -13,7 +13,7 @@ VERSIONS=(
13
13
" solana:2.2.15"
14
14
" anchor:anchor-v0.29.0"
15
15
" jq:jq-1.7.1"
16
- " photon:0.50.0 "
16
+ " photon:0.50.1 "
17
17
" redis:8.0.1"
18
18
)
19
19
@@ -107,8 +107,6 @@ install_rust() {
107
107
export PATH=" ${PREFIX} /cargo/bin:${PATH} "
108
108
rustup component add --toolchain 1.86-x86_64-unknown-linux-gnu clippy
109
109
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
112
110
log " rust"
113
111
else
114
112
echo " Rust already installed, skipping..."
@@ -190,6 +188,35 @@ install_jq() {
190
188
fi
191
189
}
192
190
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
+
193
220
download_gnark_keys () {
194
221
ROOT_DIR=" $( git rev-parse --show-toplevel) "
195
222
# Always check if keys actually exist, not just the install log
@@ -369,6 +396,7 @@ main() {
369
396
local key_type=" light"
370
397
local reset_log=true
371
398
local skip_components=" "
399
+ local force_reinstall=false
372
400
373
401
while [[ $# -gt 0 ]]; do
374
402
case $1 in
@@ -388,16 +416,20 @@ main() {
388
416
skip_components=" $2 "
389
417
shift 2
390
418
;;
419
+ --force-reinstall)
420
+ force_reinstall=true
421
+ shift
422
+ ;;
391
423
* )
392
424
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"
395
427
exit 1
396
428
;;
397
429
esac
398
430
done
399
431
400
- if $reset_log ; then
432
+ if $reset_log || $force_reinstall ; then
401
433
rm -f " $INSTALL_LOG "
402
434
fi
403
435
@@ -410,6 +442,7 @@ main() {
410
442
# Install components unless explicitly skipped
411
443
should_skip " go" || install_go
412
444
should_skip " rust" || install_rust
445
+ should_skip " photon" || install_photon
413
446
should_skip " node" || install_node
414
447
should_skip " pnpm" || install_pnpm
415
448
should_skip " solana" || install_solana
0 commit comments