Crates.io | photon-indexer |
lib.rs | photon-indexer |
version | 0.47.0 |
source | src |
created_at | 2024-03-29 17:13:52.074313 |
updated_at | 2024-11-08 22:02:41.778563 |
description | Solana indexer for general compression |
homepage | |
repository | https://github.com/helius-labs/photon |
max_upload_size | |
id | 1190385 |
size | 15,052,284 |
Photon is the core indexer for ZK Compression on the Solana blockchain. It offers rapid indexing capabilities, snapshot support, and flexible database options to cater to local and production deployments.
sudo apt install -y build-essential pkg-config libssl-dev
photon-indexer
:cargo install photon-indexer
photon
photon --rpc-url=https://api.devnet.solana.com
photon --rpc-url=https://api.devnet.solana.com --grpc-url=<grpc_url>
photon --db-url=postgres://postgres@localhost/postgres
photon --start-slot=123
photon --help
Photon supports snapshots for quick bootstrapping.
photon-snapshot-loader --snapshot-dir=~/snapshot --snapshot-server-url=https://photon-devnet-snapshot.helius-rpc.com
photon --snapshot-dir=~/snapshot --rpc-url=https://api.devnet.solana.com --db-url=postgres://postgres@localhost/postgres
Create a local snapshot:
photon-snapshotter --snapshot-dir=~/snapshot
Store snapshots in an R2 bucket:
photon-snapshotter --r2-bucket=some-bucket --r2-prefix=prefix
Note: Set R2_ACCESS_KEY
, R2_ACCOUNT_ID
, and R2_SECRET_KEY
environment variables when using R2.
Photon supports both Postgres and SQLite. By default, it uses an in-memory SQLite database.
To use a custom database:
export DATABASE_URL="postgres://postgres@localhost/postgres"
photon-migration up
photon --db-url=$DATABASE_URL
export MAINNET_RPC_URL=https://api.mainnet-beta.solana.com
export DEVNET_RPC_URL=https://api.devnet.solana.com
export TEST_DATABASE_URL="postgres://postgres@localhost/postgres"
npm install -g @apidevtools/swagger-cli
wget https://dl.min.io/server/minio/release/linux-amd64/minio
chmod +x minio
docker run -p 3001:3001 docker.io/pmantica1/light-prover:1
cargo test
Note: All migrations run automatically during tests for both Postgres and SQLite.
cargo install sea-orm-cli --version 0.10.6
sea-orm-cli generate entity -o src/dao/generated
Generate OpenAPI schemas:
cargo run --bin=photon-openapi
For support or queries, please open an issue on Github or contact the Helius discord.