The project is in a healthy, maintained state
Subscribes to Solana WebSocket RPC for account changes and broadcasts updates via ActionCable/Turbo Streams. Includes Idiomorph auto-refresh Stimulus controller.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

SolRengine Realtime

Real-time Solana account monitoring via WebSocket + Turbo Streams. Subscribes to account changes and triggers callbacks when balances update.

Part of the SolRengine framework.

Install

gem "solrengine-realtime"

Usage

Configure what happens when an account changes:

# config/initializers/solrengine_realtime.rb
Solrengine::Realtime.on_account_change = ->(wallet_address) {
  Rails.cache.delete("wallet/#{wallet_address}/tokens")

  portfolio = Solrengine::Tokens::Portfolio.new(wallet_address)

  Turbo::StreamsChannel.broadcast_replace_to(
    "wallet_#{wallet_address}",
    target: "token_list",
    partial: "dashboard/token_list",
    locals: { tokens: portfolio.tokens }
  )
}

Run the monitor as a separate process:

# bin/solana_monitor
monitor = Solrengine::Realtime::AccountMonitor.new("Abc...xyz")
monitor.start

License

MIT