Installation
Run Spray using Docker:Configuration
Create aconfig.yaml file to define your data sources:
Subscription API
Spray exposes a JSON-RPC 2.0 WebSocket API on the configured port.Subscribe to Data
Method:spraySubscribe
Request:
Query Parameters
Top-level options:includeAllBlocks(boolean) - Include all block headers, not just blocks with matching transactionsfields(object) - Specify which fields to include in responses
transactions- Array of transaction filtersinstructions- Array of instruction filtersbalances- Array of balance change filterstokenBalances- Array of token balance change filters
feePayer- Filter by fee payer addressesmentionsAccount- Filter by any mentioned accountinstructions- Include all instructionslogs- Include transaction logsbalances- Include balance changestokenBalances- Include token balance changes
programId- Filter by program IDdiscriminator- Filter by instruction discriminator (variable length)d1,d2,d4,d8- Filter by fixed-length discriminators (1, 2, 4, 8 bytes)mentionsAccount- Filter by any account in instructiona0througha15- Filter by specific account positionsisCommitted- Filter by commitment statustransaction- Include parent transactiontransactionInstructions- Include all instructions from transactioninnerInstructions- Include inner instructionsparentInstructions- Include parent instructions
account- Filter by account addresstransaction- Include parent transactiontransactionInstructions- Include transaction instructions
account- Filter by account addresspreMint,postMint- Filter by token mint (before/after)preProgramId,postProgramId- Filter by token programpreOwner,postOwner- Filter by token ownertransaction- Include parent transactiontransactionInstructions- Include transaction instructions
Response Format
Spray sends JSON messages for each matching block or transaction: Block message:Unsubscribe
Method:sprayUnsubscribe
Metrics
Spray exposes Prometheus metrics at/metrics:
spray_blocks_published- Number of blocks pushed to subscriptionsspray_transactions_published- Number of transactions pushed to subscriptionsspray_last_block- Last published block numberspray_active_subscriptions- Number of active client subscriptionsspray_data_source_errors- Number of data source connection errorsspray_mapping_errors- Number of data mapping errors

