Rails meets Solana
Build Solana dApps with Ruby on Rails 8. Modular gems for wallet auth, RPC, tokens, transactions, and real-time updates.
$
bundle add solrengine
Real code, not promises
Production examples from our showcase apps. Copy, paste, ship.
# Gemfile
gem "solrengine-auth"
# routes.rb — mounts at /auth
mount Solrengine::Auth::Engine => "/auth"
# User model — wallet address as identity
class User < ApplicationRecord
include Solrengine::Auth::Authenticatable
end
# Any controller — protect routes
class DashboardController < ApplicationController
before_action :authenticate!
end
# Gemfile
gem "solrengine-rpc"
# Get wallet balance
client = Solrengine::Rpc.client
balance = client.get_balance("wallet_address")
# => 4.2 (SOL)
# Token accounts
tokens = client.get_token_accounts("wallet_address")
# => [{mint: "...", ui_amount: 100, decimals: 6}]
# Latest blockhash
blockhash = client.get_latest_blockhash
# => {blockhash: "...", last_valid_block_height: 123}
# Gemfile
gem "solrengine-transactions"
# Transfer model with status tracking
class Transfer < ApplicationRecord
include Solrengine::Transactions::Transferable
end
# Status flow:
# pending → submitted → confirmed → finalized
# Background confirmation with exponential backoff
Solrengine::Transactions::ConfirmationJob
.perform_later(transfer.id)
# Generate from Anchor IDL
$ rails generate solrengine:program PiggyBank config/idl/piggy_bank.json
# Account model — reads on-chain state
class PiggyBank::Lock < Solrengine::Programs::Account
program_id "ZaU8j7X..."
account_name "lock"
borsh_field :dst, :pubkey
borsh_field :expiration, :u64
end
# Query accounts from chain
locks = PiggyBank::Lock.for_wallet(current_user.wallet_address)
Modular by design
Use what you need. Each gem works independently or together as a full framework.
solrengine-auth
Sign In With Solana — wallet authentication for Rails. Works with Phantom, Solflare, Backpack, and any Wallet Standard wallet.
gem "solrengine-auth"
solrengine-rpc
Solana JSON-RPC client. Balances, token accounts, signatures, blockhash, and transactions with SSL CRL tolerance.
gem "solrengine-rpc"
solrengine-tokens
SPL token metadata and portfolio management. Jupiter API integration for USD prices with intelligent caching.
gem "solrengine-tokens"
solrengine-transactions
SOL transfers with confirmation tracking. Background job with exponential backoff and full status lifecycle.
gem "solrengine-transactions"
solrengine-realtime
Real-time Solana account monitoring via WebSocket. Broadcasts balance changes to your views with Turbo Streams.
gem "solrengine-realtime"
solrengine-programs
Anchor program interaction. Parse IDL files to generate Ruby account models, instruction builders, and Stimulus controllers.
gem "solrengine-programs"
Or install everything at once
The solrengine meta-gem bundles all components with a single install generator.
$
bundle add solrengine && rails generate solrengine:install
Support SolRengine
SolRengine is open source and community-supported. Help us keep building.
Donate SOL
Support directly on-chain
Or send SOL directly to:
EViz4YGrY6GZtfu35Y1Q3PoFWAhoXY6YMHFrcneMbdCF