I want to create a wallet for every user. With the easybitcoin rpc, I would like to call up the balance in php. Everything runs in the testnet.
I found out that I have to adjust the initialization like:
$bitcoin = new Bitcoin('bitcoinrpc','Password','localhost','18332','wallets/user/wallet.dat');
or ...127.0.0.1:18332/wallets/user/wallet.dat);
But no option is working.
I want to implement something like this:
function getBalance($user) {
$bitcoin = new Bitcoin('bitcoinrpc','Password','localhost','18332');
$balance = $bitcoin->getbalance($user);
echo $balance
}
Example wallet is located in: /root/.Bitcoin/testnet3/wallets/user/wallet.dat
This:
bitcoin-cli createwallet user
bitcion-cli -rpcwallet=user getbalance
is working, but how can i run it in php.