Skip to content
/ spray Public

Proxy service for Yellowstone gRPC plugin that exposes transactions and blocks via JSON-RPC Websocket subscription with advanced filtering capabilities

Notifications You must be signed in to change notification settings

subsquid/spray

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spray beta

Proxy service for Yellowstone Geyser gRPC plugin, that exposes transactions and blocks via JSON-RPC Websocket subscription with advanced filtering capabilities.

Features

  • Subsquid portal-like queries for data filtering
  • Subsquid portal-like data format for data messages
  • Multiple geyser endpoints can be configured for reliable and fast data delivery

API

Only a single subscription kind is available.

  • spraySubscribe - subscription method, accepts data filter as a single parameter
  • sprayNotification - data message
  • sprayUnsubscribe - subscription cancellation

Data filter

Data filter follows Subsquid portal Solana data query format except that block range selection parameters (fromBlock, toBlock, parentBlockHash) are not available and forbidden.

Data message

There are two kinds of data messages - block notification and transaction notification.

interface TransactionNotification {
    type: 'transaction'
    slot: number
    transactionIndex: number
    // Data items matched by the data filter
    transaction?: SubquidPortalSolanaTransaction
    instructions?: SubquidPortalSolanaInstruction[]
    balances?: SubquidPortalSolanaBalance[]
    tokenBalances?: SubquidPortalSolanaTokenBalance[]
}

interface BlockNotification {
    type: 'block'
    slot: number
    // Solana block info defined by `query.fields.block`
    header?: SolanaPortalBlockHeader
}

Block notifications are pushed to the client in the following circumstances

  • Transaction notification belonging to the given block was pushed before
  • Every fifth slot since the last pushed block or subscription start
  • Every block if query.includeAllBlocks is true.

Sequencing

  • Slot numbers are non-decreasing
  • Block notification marks the end of a slot (no notifications for the given slot will be received in the future)
  • Delivery of all data messages is not guaranteed

Setup

Usage: sqd-spray <config>

Arguments:
  <config>  Config file

Where config file has the following format (yaml)

port: 3000 # port to listen on (optional, default is 3000)
# data sources
sources:
  getblock: # data source name
    url: https://go.getblock.io/
    x_access_token: xxx # add `X-Access-Token` header to gRPC request

  shyft:
    url: https://xxx
    x_token: xxx  # add `X-Token` header to every gRPC request

About

Proxy service for Yellowstone gRPC plugin that exposes transactions and blocks via JSON-RPC Websocket subscription with advanced filtering capabilities

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published