【发布时间】:2020-12-16 10:49:31
【问题描述】:
我想为每个用户创建一个钱包。使用easybitcoin rpc,我想在php中调用余额。一切都在测试网中运行。
我发现我必须像这样调整初始化:
$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.
我想实现这样的东西:
function getBalance($user) {
$bitcoin = new Bitcoin('bitcoinrpc','Password','localhost','18332');
$balance = $bitcoin->getbalance($user);
echo $balance
}
示例钱包位于: /root/.Bitcoin/testnet3/wallets/user/wallet.dat
这个:
bitcoin-cli createwallet user
bitcion-cli -rpcwallet=user getbalance
正在工作,但我如何在 php 中运行它。
【问题讨论】:
-
你能看看我与
json_rpc相关的问题吗?请:stackoverflow.com/questions/67605266/…
标签: php bitcoin json-rpc wallet balance