Author: Tim Schipper [email protected] Description: Electrum support for Laravel with optional Vue wallet component.
WARNING: Be safe and never ever put your private keys on a webserver, use a watch only wallet or even better, get and setup a hardware wallet, so your keys and coins will be safe.
Require this package in your composer.json and update composer. This will download the package.
composer require araneadev/laravel-electrum
After updating composer, add the ServiceProvider to the providers array in config/app.php
AraneaDev\Electrum\ElectrumServiceProvider::class,
Download and install Electrum if you haven't done so yet.
electrum daemon -d
electrum setconfig log_to_file true
electrum setconfig rpchost 127.0.0.1
electrum setconfig rpcport 7777
electrum setconfig rpcuser your_user
electrum setconfig rpcpassword your_password
electrum stop
electrum daemon -d
electrum create
electrum load_wallet
And set then following variables in your .env file:
ELECTRUM_RPC_HOST=http://127.0.0.1
ELECTRUM_RPC_PORT=7777
ELECTRUM_RPC_USER=your_user
ELECTRUM_RPC_PASS=your_password
* Included in Laravel 5.4+
npm install clipboard --save-dev
npm install moment --save-dev
npm install vue2-bootstrap-modal --save-dev
npm install vue-qrcode-component --save-dev
php artisan vendor:publish --provider=AraneaDev\Electrum\ElectrumServiceProvider
Enable the Web interface in config/electrum.php.
[
....
'webinterface'=> [
'enabled' => true,
....
]
]
Then add the following line to your app.js:
Vue.component('electrum-wallet', require('./vendor/araneadev/Electrum.vue'));
Electrum's JSON-RPC methods are mapped to artisan commands:
php artisan electrum [METHOD] [--address=ADDRESS] [--txid=TXID] [--key=KEY]