Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rpcuser=usernamebitcoin
- rpcpassword=mypasswordbitcoin
- rpcallowip=127.0.0.1
- rpcallowip=xxx.xxx.xxx.xxx
- rpcallowip=xxx.xxx.xxx.xxx
- rpcport=8332
- server=1
- daemon=1
- listen=1
- txindex=1
- curl --user usernamebitcoin --data-binary '{"jsonrpc": "1", "id":"", "method": "getblockchaininfo", "params": [] }' -H 'content-type: text/plain' http://xxx.xxx.xxx.xxx:8332/
- <?php
- $postfields = [
- 'jsonrpc' => '1',
- 'id' => '',
- 'method' => '',
- 'getbalance' => '',
- 'params' => [],
- ];
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, "http://xxx.xxx.xxx.xxx:8332/" );
- curl_setopt($ch, CURLOPT_USERPWD, "usernamebitcoin:mypasswordbitcoin");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );
- curl_setopt($ch, CURLOPT_POST, 1 );
- curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/plain'));
- $output = curl_exec($ch);
- $info = curl_getinfo($ch);
- echo "<pre>";
- print_r($info);
- curl_close($ch);
- ?>
- Array
- (
- [url] => http://xxx.xxx.xxx.xxx:8332/
- [content_type] => application/json
- [http_code] => 500
- [header_size] => 152
- [request_size] => 235
- [filetime] => -1
- [ssl_verify_result] => 0
- [redirect_count] => 0
- [total_time] => 0.106437
- [namelookup_time] => 3.6E-5
- [connect_time] => 0.035309
- [pretransfer_time] => 0.035477
- [size_upload] => 528
- [size_download] => 74
- [speed_download] => 695
- [speed_upload] => 4960
- [download_content_length] => 74
- [upload_content_length] => 528
- [starttransfer_time] => 0.070569
- [redirect_time] => 0
- [redirect_url] =>
- [primary_ip] => xxx.xxx.xxx.xxx
- [certinfo] => Array
- (
- )
- [primary_port] => 8332
- [local_ip] => xxx.xx.xxx.xxx
- [local_port] => 41040
- )
Add Comment
Please, Sign In to add comment