Ravina Solana
Components to ease the development of Solana based services.
GitHub Repository
Dependencies
- java.net.http
- systems.comodal.json_iterator
- org.bouncycastle.provider
- software.sava.core
- software.sava.rpc
- software.sava.solana_programs
- software.sava.anchor_src_gen
- software.sava.anchor_programs
- software.sava.ravina_core
- software.sava.kms_core
RPC Call Weights
RPC Call Weights Construction
Used to match the request capacity available for a given RPC provider.
RPC Caller
Ties together a Load Balancer, RPC Call Weights and an Executor Service to make using remote calls more convenient.
RPC Caller Construction
Epoch Info Service
Periodically polls for slot performance stats and epoch information to create an Epoch data record which provides the following features:
- Duration remaining for a given time unit.
- Percent complete.
- Epochs per year.
- The current slot index.
- The current block height accounting for a skip rate.
- SlotPerformanceStats
Epoch Service Configuration
- defaultMillisPerSlot: Used if performance samples are not available.
- minMillisPerSlot: Performance samples will be capped to greater than or equal to this value.
- maxMillisPerSlot: Performance samples will be capped to less than or equal to this value.
- slotSampleWindow: The recent time window to draw performance samples.
- fetchSlotSamplesDelay: Poll new performance samples and epoch information delay.
- fetchEpochInfoAfterEndDelay: Also fetch new performance samples and epoch information after each epoch rollover.
Epoch Info Service Usage
Web Socket Manager
Used to manage the connection of a SolanaRpcWebsocket. Call checkConnection
to drive re-connections. If errors are
observed, the corresponding delay from the provided Backoff will be respected.
Pseudo Web Socket Manager Usage
Web Socket Manager Configuration
- endpoint: websocket url.
- backoff: Used for connection attempts in response to failures.
Chain Item Formatter
Used to provide more convenient logging of accounts and transaction hashes.
Formatter Usage
Lookup Table Cache
May be used to dynamically fetch lookup tables. Ideally used in conjunction with a websocket to maintain the latest view of a table. The current implementation only removes tables if they are no longer active or no longer exist on-chain.
Lookup Table Cache Usage
Transaction Processor
Convenience methods for creating, simulating, signing and sending transactions.
Transaction Processor Construction
Transaction Monitor Service
Provides functionality for tracking transaction confirmation via asynchronous and polling signature status RPC calls. Up to 256 transaction signatures are checked for each polling call. It is recommended to use this with the Instruction or Batch Instruction Services, rather than directly.
Transaction Monitor Service Construction
Instruction Service
Handles transaction simulation, creation, and confirmation/expiration monitoring.
The transaction is simulated against a Confirmed state.
The blockhash and its height is taken from the simulation result to enable expiration tracking.
After sending a transaction, a confirmed state signature status Web Socket subscription is made, which expires based on the Transaction Monitor configuration.
If a response message is received over the Web Socket and a finalized state is desired an additional subscription is made, which expires two times the estimated duration of 32 blocks.
If the Web Socket subscriptions time out the service falls back to polling signature status calls. The monitor will make at least one call without transaction history and optionally continue to do so until the transactions’ block has expired. After which one final call is made with transaction history enabled to ensure the transaction did not land but was expired from the recent history cache.
While waiting for expiration the transaction may optionally be re-sent based on the Transaction Monitor configuration.
Instruction Service Usage
Batch Instruction Service
Extends the Instruction Service functionality by dynamically batching multiple instructions which may exceed the size of a single transaction into multiple transactions.