laravel-bitcoinrpc
laravel-bitcoinrpc copied to clipboard
Argument 1 passed to Denpa\\Bitcoin\\ClientFactory::__construct()
Describe the bug A clear and concise description of what the bug is. Hello bro, Is my first time to use this package and have this error bro,
{
"message": "Argument 1 passed to Denpa\\Bitcoin\\ClientFactory::__construct() must be of the type array, null given, called in /home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/denpa/laravel-bitcoinrpc/src/Providers/ServiceProvider.php on line 65",
"exception": "TypeError",
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/denpa/laravel-bitcoinrpc/src/ClientFactory.php",
"line": 42,
"trace": [
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/denpa/laravel-bitcoinrpc/src/Providers/ServiceProvider.php",
"line": 65,
"function": "__construct",
"class": "Denpa\\Bitcoin\\ClientFactory",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Container/Container.php",
"line": 826,
"function": "Denpa\\Bitcoin\\Providers\\{closure}",
"class": "Denpa\\Bitcoin\\Providers\\ServiceProvider",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Container/Container.php",
"line": 712,
"function": "build",
"class": "Illuminate\\Container\\Container",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Foundation/Application.php",
"line": 796,
"function": "resolve",
"class": "Illuminate\\Container\\Container",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Container/Container.php",
"line": 651,
"function": "resolve",
"class": "Illuminate\\Foundation\\Application",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Foundation/Application.php",
"line": 781,
"function": "make",
"class": "Illuminate\\Container\\Container",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php",
"line": 119,
"function": "make",
"class": "Illuminate\\Foundation\\Application",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/denpa/laravel-bitcoinrpc/src/Traits/Bitcoind.php",
"line": 18,
"function": "app"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/app/Http/Controllers/Auth/RegisterController.php",
"line": 69,
"function": "bitcoind",
"class": "App\\Http\\Controllers\\Auth\\RegisterController",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/app/Http/Controllers/Auth/RegisterController.php",
"line": 25,
"function": "blockInfo",
"class": "App\\Http\\Controllers\\Auth\\RegisterController",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Routing/Controller.php",
"line": 54,
"function": "create",
"class": "App\\Http\\Controllers\\Auth\\RegisterController",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php",
"line": 45,
"function": "callAction",
"class": "Illuminate\\Routing\\Controller",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
"line": 254,
"function": "dispatch",
"class": "Illuminate\\Routing\\ControllerDispatcher",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
"line": 197,
"function": "runController",
"class": "Illuminate\\Routing\\Route",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 692,
"function": "run",
"class": "Illuminate\\Routing\\Route",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 128,
"function": "Illuminate\\Routing\\{closure}",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php",
"line": 41,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Routing\\Middleware\\SubstituteBindings",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php",
"line": 127,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php",
"line": 103,
"function": "handleRequest",
"class": "Illuminate\\Routing\\Middleware\\ThrottleRequests",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php",
"line": 55,
"function": "handleRequestUsingNamedLimiter",
"class": "Illuminate\\Routing\\Middleware\\ThrottleRequests",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Routing\\Middleware\\ThrottleRequests",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/sanctum/src/Http/Middleware/EnsureFrontendRequestsAreStateful.php",
"line": 33,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 128,
"function": "Laravel\\Sanctum\\Http\\Middleware\\{closure}",
"class": "Laravel\\Sanctum\\Http\\Middleware\\EnsureFrontendRequestsAreStateful",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 103,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/sanctum/src/Http/Middleware/EnsureFrontendRequestsAreStateful.php",
"line": 34,
"function": "then",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Laravel\\Sanctum\\Http\\Middleware\\EnsureFrontendRequestsAreStateful",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 103,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 694,
"function": "then",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 669,
"function": "runRouteWithinStack",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 635,
"function": "runRoute",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 624,
"function": "dispatchToRoute",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
"line": 166,
"function": "dispatch",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 128,
"function": "Illuminate\\Foundation\\Http\\{closure}",
"class": "Illuminate\\Foundation\\Http\\Kernel",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
"line": 21,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
"line": 21,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php",
"line": 27,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php",
"line": 87,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/fideloper/proxy/src/TrustProxies.php",
"line": 57,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Fideloper\\Proxy\\TrustProxies",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustHosts.php",
"line": 48,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Http\\Middleware\\TrustHosts",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/fruitcake/laravel-cors/src/HandleCors.php",
"line": 57,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Fruitcake\\Cors\\HandleCors",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 103,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
"line": 141,
"function": "then",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
"line": 110,
"function": "sendRequestThroughRouter",
"class": "Illuminate\\Foundation\\Http\\Kernel",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/public/index.php",
"line": 52,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Kernel",
"type": "->"
},
{
"file": "/home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/server.php",
"line": 21,
"function": "require_once"
}
]
}
To Reproduce What code caused the problem. Feel free to omit any sensitive information. In my RegisterController I have this
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Models\Role;
use App\Models\TypeUser;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Illuminate\Http\Request;
use App\Models\Country;
use App\Models\User;
use Illuminate\Support\Str;
use MongoDB\BSON\Type;
use Denpa\Bitcoin\Traits\Bitcoind;
class RegisterController extends Controller
{
//
use Bitcoind;
public function create(Request $request){
return $this->blockInfo();
}
public function getUniqueRefferalCode(){
return uniqid();
}
public function blockInfo()
{
$hash = '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f';
$block = $this->bitcoind()->getBlock($hash);
return response()->json($block->get());
}
}
Expected behavior A clear and concise description of what you expected to happen. I send with my postman un post and the response is the tittle of this issue. Logs If applicable, attach log files. Feel free to omit any sensitive information.
Cryptocurrency Describe used software and network:
- Software: Bitcoin Core v0.17.0
- Network: mainnet or testnet
Environment Describe your runtime environment:
- Laravel: 8.12 (run
php artisan --version
to get Laravel version) - PHP: 7.3 o 8.0 (run
php -v
to get php version) - Web Server (if applicable): nginx/1.15.3
- System: Lubuntu 20.04 LTS
Additional information Add any other information about the problem here.
Hi, thanks for the feedback!
Did you publish config file, as mentioned in documentation?
This can be done, by running following command:
php artisan vendor:publish --provider="Denpa\Bitcoin\Providers\ServiceProvider"
in your project directory /home/aisak/Documentos/lubuntu/Projects Front/walletBitcoin/backend/
.
Yes, bro but not work :(