I'm trying to write a PHP plugin that will talk to bitcoind to generate a random address to send a bitcoin transaction to.
I'm really confused: how am I supposed to setup bitcoind so that we can query it to generate a random address?
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.Sign up to join this community
bitcoind on your server. Set up
bitcoin.conf to have the correct RPC port and a password and etc.
Then, include the jsonRPCClient.php file:
Then, instantiate an object like so:
$bitcoind = new jsonRPCClient("http://$YOUR_RPC_USER:$YOUR_RPC_PASS@$YOUR_RPC_HOST:$YOUR_RPC_PORT/");
You can now run commands from the RPC using this object.
So if you want a new address:
$newaddr = $bitcoind->getnewaddress();