2
So I just started writing a rails app that will be an online wallet. I'm looking over the API code examples for connecting to the bitcoin network at https://en.bitcoin.it/wiki/API_reference_(JSON-RPC).
PHP was the easiest example, seen here
require_once 'jsonRPCClient.php';
$bitcoin = new jsonRPCClient('http://user:password@127.0.0.1:8332/');
echo "<pre>\n";
print_r($bitcoin->getinfo()); echo "\n";
echo "Received: ".$bitcoin->getreceivedbylabel("Your Address")."\n";
echo "</pre>";
So I'm presuming that it connects to the bitcoin network via a username and password. Couple of questions.
What username/password? I bought bitcoin on coinbase, then exported it to a paper wallet. What user/pass is associated with my bitcoin? I thought it was just public/private key?
Why port 8332?
Why 127.0.0.1? Could it be any address?
Pick any username and password that you want. The values are used only for RPC connections. Port 8332 is the default port used by bitcoin for RPC connections and 127.0.0.1 is the localhost address (that is, connecting to 127.0.0.1 means you are connecting to a service running on the local system). You can change the port number if you have a conflict on your system by specifying rpcport in bitcoin.conf. – ScripterRon – 2013-12-10T16:47:08.170