Bitcoin Forum
May 08, 2024, 06:11:13 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2]  All
  Print  
Author Topic: Bitcoind / bitcoin-cli and RPC.......  (Read 3812 times)
chagry
Sr. Member
****
Offline Offline

Activity: 500
Merit: 327


Partage des connaissances pour évoluer.


View Profile WWW
November 15, 2015, 03:42:51 PM
Last edit: November 15, 2015, 04:30:54 PM by chagry
 #21

Le bitcoin rpc s'utilise en localhost.
Comme "sangoku" te la indiquer en haut.

Code:
require_once 'jsonRPCClient.php';
 
$bitcoin = new jsonRPCClient('http://user:password@127.0.0.1:8332/');
 
print_r($bitcoin->getinfo());

Donc c'est pas ton ip a toi qu'il faut utiliser mais l'ip du localhost. donc 127.0.0.1
Regarde aussi si ton port 8332 est ouvert avec ipTables.

Pour information error 500 et un problème de serveur.
Sur ta config php je ne vois pas la lib curl installer.

Bon si non, voila l'erreur si on veux faire une connexion de l'extérieurs sur ton serveur.

Code:
Warning:  fopen(http://...@45.63.9.127:8332/): failed to open stream: Connection timed out in /home/.../test/jsonRPC1Client.php on line 132

Fatal error:  Uncaught exception 'Exception' with message 'Unable to connect to http://ha...:mji....@45.63.9.127:8332/'

Chagry.com Consultant en Crypto-monnaie, Blockchain, Trading, Implémentation, Automatisation. || ibtc.cash Simple HTML Page for Bitcoin Payments System. || mircoin.com Easy Brain & Paper Bitcoin Wallet.
1715148673
Hero Member
*
Offline Offline

Posts: 1715148673

View Profile Personal Message (Offline)

Ignore
1715148673
Reply with quote  #2

1715148673
Report to moderator
1715148673
Hero Member
*
Offline Offline

Posts: 1715148673

View Profile Personal Message (Offline)

Ignore
1715148673
Reply with quote  #2

1715148673
Report to moderator
1715148673
Hero Member
*
Offline Offline

Posts: 1715148673

View Profile Personal Message (Offline)

Ignore
1715148673
Reply with quote  #2

1715148673
Report to moderator
"In a nutshell, the network works like a distributed timestamp server, stamping the first transaction to spend a coin. It takes advantage of the nature of information being easy to spread but hard to stifle." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715148673
Hero Member
*
Offline Offline

Posts: 1715148673

View Profile Personal Message (Offline)

Ignore
1715148673
Reply with quote  #2

1715148673
Report to moderator
1715148673
Hero Member
*
Offline Offline

Posts: 1715148673

View Profile Personal Message (Offline)

Ignore
1715148673
Reply with quote  #2

1715148673
Report to moderator
kcud_dab
Legendary
*
Offline Offline

Activity: 1652
Merit: 1000


Bitcoin enthusiast!


View Profile WWW
November 15, 2015, 04:28:24 PM
 #22

Hmmm, c'est vraiment une mauvaise idée de laisser le mdp root sur un forum... je l'ai supprimé.
(et un conseil, réinstalle ton serveur maintenant !)

hamdi369 (OP)
Jr. Member
*
Offline Offline

Activity: 51
Merit: 2


View Profile
November 15, 2015, 04:40:01 PM
 #23

j'ai trouvé la solution alors je poste ici si cela arrive a quelqu'un/e ca peut aider :

le script php disait avant :

Code:
<?php
require_once('jsonRPCClient.php');
$bitcoin = new jsonRPCClient ('user','password','ip','port');
$test=$bitcoin->getinfo();
print_r($test);
echo (
$test);
?>


Mais il fallait faire

Code:
<?php
require_once('jsonRPCClient.php');
$bitcoin = new jsonRPCClient("http://user:password@ip:port");
$test=$bitcoin->getinfo();
print_r($test);
echo (
$test);
?>

Merci à vous tous pour votre aide et surtout merci a Sangoku
hamdi369 (OP)
Jr. Member
*
Offline Offline

Activity: 51
Merit: 2


View Profile
November 15, 2015, 05:00:52 PM
 #24

Merci encore au membre de ce forum d'aider de simple newbies comme moi a realiser ceci
ne faites pas la meme erreur que moi et prenez le temps de bien vous doccumenter Smiley
Pages: « 1 [2]  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!