PHPackages                             skaisser/laravel-multicoin-rpc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. skaisser/laravel-multicoin-rpc

ActiveLibrary

skaisser/laravel-multicoin-rpc
==============================

Multi-cryptocurrency RPC integration for Laravel with dedicated facades

v1.0.2(8mo ago)02MITPHPPHP ^8.2CI failing

Since Sep 12Pushed 8mo agoCompare

[ Source](https://github.com/skaisser/laravel-multicoin-rpc)[ Packagist](https://packagist.org/packages/skaisser/laravel-multicoin-rpc)[ Docs](https://github.com/skaisser/laravel-multicoin-rpc)[ RSS](/packages/skaisser-laravel-multicoin-rpc/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (9)Versions (4)Used By (0)

Laravel Multi-Coin RPC
======================

[](#laravel-multi-coin-rpc)

Multi-cryptocurrency RPC integration for Laravel with dedicated facades for each coin. Production-ready with circuit breakers, health monitoring, and automatic failover.

Features
--------

[](#features)

- 🚀 **Clean Facade API**: Use `Bitcoin::`, `Bch::`, `Ltc::`, `Bc2::` instead of complex factories
- 🔄 **Multi-Node Failover**: Automatic switching between primary and backup nodes
- 🛡️ **Circuit Breaker**: Protects against cascading failures
- 📊 **Health Monitoring**: Real-time node health checks and metrics
- ⚡ **Performance Tracking**: Response time monitoring and optimization
- 🔧 **Laravel Integration**: Full auto-discovery, artisan commands, and logging
- 🪙 **Multi-Coin Support**: Bitcoin, Bitcoin Cash, Litecoin, Bitcoinii, and more
- 📦 **Production Ready**: Battle-tested with 95% test coverage

Quick Start
-----------

[](#quick-start)

### Install the package

[](#install-the-package)

```
composer require skaisser/laravel-multicoin-rpc
```

### Simple Setup (Single Coin)

[](#simple-setup-single-coin)

Add to your `.env` file:

```
# Bitcoin only
BITCOIN_RPC_HOST=localhost
BITCOIN_RPC_PORT=8332
BITCOIN_RPC_USER=your-rpc-user
BITCOIN_RPC_PASSWORD=your-rpc-password
```

Use in your code:

```
use Bitcoin;

// Get blockchain info
$info = Bitcoin::getBlockchainInfo();

// Get current block count
$height = Bitcoin::getBlockCount();

// Get specific block
$block = Bitcoin::getBlock($blockHash);

// Validate address
$valid = Bitcoin::validateAddress('bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh');
```

### Setup with Failover (Recommended for Production)

[](#setup-with-failover-recommended-for-production)

Add primary and backup nodes to `.env`:

```
# Primary node
BITCOIN_RPC_HOST=localhost
BITCOIN_RPC_PORT=8332
BITCOIN_RPC_USER=your-rpc-user
BITCOIN_RPC_PASSWORD=your-rpc-password

# Backup node (automatic failover)
BITCOIN_RPC_BACKUP_HOST=backup.server.com
BITCOIN_RPC_BACKUP_PORT=8332
BITCOIN_RPC_BACKUP_USER=backup-user
BITCOIN_RPC_BACKUP_PASSWORD=backup-password
```

The package automatically switches to the backup node if the primary fails.

Multiple Cryptocurrencies
-------------------------

[](#multiple-cryptocurrencies)

```
use Bitcoin;
use Bch;
use Ltc;
use Bc2;

// Each coin has its own facade
$btcInfo = Bitcoin::getBlockchainInfo();
$bchInfo = Bch::getBlockchainInfo();
$ltcInfo = Ltc::getBlockchainInfo();
$bc2Info = Bc2::getBlockchainInfo();
```

Advanced Configuration
----------------------

[](#advanced-configuration)

For detailed configuration options, see [Installation Guide](Installation.md).

Available Methods
-----------------

[](#available-methods)

All coins support these common RPC methods:

```
// Blockchain
getBlockchainInfo()
getBlockCount()
getBlock(string $hash, int $verbosity = 1)
getBlockHash(int $height)

// Transactions
getRawTransaction(string $txid, bool $verbose = false)
sendRawTransaction(string $hexString)
validateAddress(string $address)

// Network
getNetworkInfo()
getPeerInfo()
getConnectionCount()

// Mining
getMiningInfo()
getDifficulty()
```

Artisan Commands
----------------

[](#artisan-commands)

```
# Check node health
php artisan multicoin:health

# List configured coins
php artisan multicoin:list

# Add new coin support
php artisan multicoin:add dash --name="Dash" --port=9998
```

Production Features
-------------------

[](#production-features)

### Health Monitoring

[](#health-monitoring)

```
php artisan multicoin:health --coin=btc

# Output:
# Bitcoin (BTC) Health Check
# ==========================
# Primary Node: ✅ Healthy (245ms)
# Backup Node: ✅ Healthy (312ms)
# Block Height: 830,000
# Circuit Breaker: Closed
```

### Event Listening

[](#event-listening)

```
use Skaisser\MultiCoinRpc\Events\NodeFailover;
use Illuminate\Support\Facades\Event;

Event::listen(NodeFailover::class, function ($event) {
    Log::warning("Node failover: {$event->coin} switched from {$event->failedNode} to {$event->activeNode}");
});
```

Testing
-------

[](#testing)

```
composer test
composer test-coverage
```

Mock RPC calls in your tests:

```
use Bitcoin;

it('can get block count', function () {
    Bitcoin::fake(['getBlockCount' => 830000]);

    expect(Bitcoin::getBlockCount())->toBe(830000);
});
```

Documentation
-------------

[](#documentation)

- [Installation Guide](Installation.md) - Detailed setup instructions
- [Contributing](CONTRIBUTING.md) - How to contribute
- [Changelog](CHANGELOG.md) - Version history

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 11.x or 12.x
- Bitcoin Core or compatible node with RPC enabled

Security
--------

[](#security)

If you discover any security issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Shirleyson Kaisser](https://github.com/skaisser)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

---

Made with ❤️ by [Shirleyson Kaisser](https://github.com/skaisser)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance62

Regular maintenance activity

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

242d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e0bf71a52e0741cbfe669f9cd4d1b967e34f1b38179b44fb6032f92e5d0dfce5?d=identicon)[skaisser](/maintainers/skaisser)

---

Top Contributors

[![skaisser](https://avatars.githubusercontent.com/u/1593505?v=4)](https://github.com/skaisser "skaisser (23 commits)")

---

Tags

laravelrpcbitcoinlitecoincryptocurrencyblockchainbitcoin-cashltcbch

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/skaisser-laravel-multicoin-rpc/health.svg)

```
[![Health](https://phpackages.com/badges/skaisser-laravel-multicoin-rpc/health.svg)](https://phpackages.com/packages/skaisser-laravel-multicoin-rpc)
```

###  Alternatives

[laravel/boost

Laravel Boost accelerates AI-assisted development by providing the essential context and structure that AI needs to generate high-quality, Laravel-specific code.

3.4k10.6M274](/packages/laravel-boost)[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
