سؤال

I am interested in creating a php application that uses bitcoin. I've understood everything so far except for what I am supposed to supply as these variables:

$btc_connect = array("user" => "youusername",             // RPC Username
        "pass" =>   "yourpassword",                   // RPC Password
        "host" =>   "127.0.0.1",                      // RPC Hostname/IP
        "port" =>   8321);                            // RPC Port

$mybtc = new jsonRPCClient("http://{$btc_connect['user']}:{$btc_connect['pass']}@{$btc_connect['host']}:{$btc_connect['port']}");

I have searched everywhere, including the bitcoin.org website to try to find out how to set this up. Is there something I have to install on my server?

I have a webserver and can set things up if only I knew how to get started with this.

هل كانت مفيدة؟

المحلول

You're supposed to set up a bitcoind daemon on a server. Then, you set up a bitcoin.conf file (location depends on your OS) where you have the lines:

rpcuser=someusernamehere
rpcpassword=somepasswordhere
rpcport=8332

rpcport defaults to 8332 so you can leave it out. You'd run the bitcoind with flag daemon. The other two lines give you the user and pass. Then in that array you'd fill in the selected user/pass, the IP of the server and 8332 as the port.

see here: https://en.bitcoin.it/wiki/Running_Bitcoin#Bitcoin.conf_Configuration_File

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top