Bitcoin Forum
May 14, 2024, 12:25:43 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 3813 times)
hamdi369 (OP)
Jr. Member
*
Offline Offline

Activity: 51
Merit: 2


View Profile
November 13, 2015, 12:15:16 PM
 #1

salut

j'ai installé bitcoind sur un serveur VPS ubuntu ... (pour faire des test)
et appache..
configuré le bitcoin.conf...
installé appache..
php5....

rien ne marche...

pas moyen de faire du rpc avec un script php...

peut ton installer une vielle version de bitcoind ? sans bitcoin-cli et tout les message d'erreur?
1715646343
Hero Member
*
Offline Offline

Posts: 1715646343

View Profile Personal Message (Offline)

Ignore
1715646343
Reply with quote  #2

1715646343
Report to moderator
1715646343
Hero Member
*
Offline Offline

Posts: 1715646343

View Profile Personal Message (Offline)

Ignore
1715646343
Reply with quote  #2

1715646343
Report to moderator
1715646343
Hero Member
*
Offline Offline

Posts: 1715646343

View Profile Personal Message (Offline)

Ignore
1715646343
Reply with quote  #2

1715646343
Report to moderator
It is a common myth that Bitcoin is ruled by a majority of miners. This is not true. Bitcoin miners "vote" on the ordering of transactions, but that's all they do. They can't vote to change the network rules.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715646343
Hero Member
*
Offline Offline

Posts: 1715646343

View Profile Personal Message (Offline)

Ignore
1715646343
Reply with quote  #2

1715646343
Report to moderator
1715646343
Hero Member
*
Offline Offline

Posts: 1715646343

View Profile Personal Message (Offline)

Ignore
1715646343
Reply with quote  #2

1715646343
Report to moderator
1715646343
Hero Member
*
Offline Offline

Posts: 1715646343

View Profile Personal Message (Offline)

Ignore
1715646343
Reply with quote  #2

1715646343
Report to moderator
sangoku
Hero Member
*****
Offline Offline

Activity: 616
Merit: 501



View Profile WWW
November 13, 2015, 12:30:25 PM
 #2

Déjà quel message d'erreur.
Apache et non Appache.
Qu'as-tu mis dans ton fichier bitcoin.conf
Et aussi le code php que tu utilises.

Bref tu donnes aucunes infos et tu veux de l'aide Wink

DΛSH is digital cash. Transactions are obscured in the blockchain, making them private from the wallet. You can send Dash to family or friends, or pay for goods or services, anywhere in the world. DΛSH Anonymous and Untraceable. The Perfect Digital Cash And The Best Way To Protect Your Privacy https://www.dashpay.io DΛSH is 59.5 times faster with syncing and updating  than Monero.
My DΛSH Address: XgF6sNzGHU58dn36WsC16no9FHct6nPeZD
hamdi369 (OP)
Jr. Member
*
Offline Offline

Activity: 51
Merit: 2


View Profile
November 13, 2015, 01:00:17 PM
 #3

excuse moi Smiley

je galere grave.... Smiley

mon fichier bitcoin.conf

Code:
server=1
daemon=1
rpcuser=hamdi
rpcpassword=motdepasse

mon php

Code:
<?php
require_once('jsonRPCClient.php');
$bitcoin = new Bitcoin('hamdi','motdepasse','107.191.40.74','8332');
$test=$bitcoin->getinfo();
print_r($test);
echo (
$test);
?>


sangoku
Hero Member
*****
Offline Offline

Activity: 616
Merit: 501



View Profile WWW
November 13, 2015, 01:03:11 PM
 #4

"et tout les message d'erreur", ils sont où ? Wink

https://en.bitcoin.it/wiki/PHP_developer_intro

https://en.bitcoin.it/wiki/API_reference_%28JSON-RPC%29

DΛSH is digital cash. Transactions are obscured in the blockchain, making them private from the wallet. You can send Dash to family or friends, or pay for goods or services, anywhere in the world. DΛSH Anonymous and Untraceable. The Perfect Digital Cash And The Best Way To Protect Your Privacy https://www.dashpay.io DΛSH is 59.5 times faster with syncing and updating  than Monero.
My DΛSH Address: XgF6sNzGHU58dn36WsC16no9FHct6nPeZD
hamdi369 (OP)
Jr. Member
*
Offline Offline

Activity: 51
Merit: 2


View Profile
November 13, 2015, 01:08:25 PM
 #5

sur le serveur...

si tu veux je peux te donner les identifiants, tu le constateras par toi meme...

par exemple

root@vultr:~/.bitcoin# bitcoin-cli rpcwait
error: {"code":-32601,"message":"Method not found"}
sangoku
Hero Member
*****
Offline Offline

Activity: 616
Merit: 501



View Profile WWW
November 13, 2015, 01:08:50 PM
 #6

Déjà dans la doc je vois ça

$bitcoin = new jsonRPCClient('http://user:password@127.0.0.1:8332/');

DΛSH is digital cash. Transactions are obscured in the blockchain, making them private from the wallet. You can send Dash to family or friends, or pay for goods or services, anywhere in the world. DΛSH Anonymous and Untraceable. The Perfect Digital Cash And The Best Way To Protect Your Privacy https://www.dashpay.io DΛSH is 59.5 times faster with syncing and updating  than Monero.
My DΛSH Address: XgF6sNzGHU58dn36WsC16no9FHct6nPeZD
sangoku
Hero Member
*****
Offline Offline

Activity: 616
Merit: 501



View Profile WWW
November 13, 2015, 01:12:52 PM
 #7

sur le serveur...

si tu veux je peux te donner les identifiants, tu le constateras par toi meme...

par exemple

root@vultr:~/.bitcoin# bitcoin-cli rpcwait
error: {"code":-32601,"message":"Method not found"}


./bitcoin-cli --help

"Usage:
  bitcoin-cli [options] <command> [params]  Send command to Bitcoin Core
  bitcoin-cli [options] help                List commands
  bitcoin-cli [options] help <command>      Get help for a command

Options:

  -?
       This help message

  -conf=<file>
       Specify configuration file (default: bitcoin.conf)

  -datadir=<dir>
       Specify data directory

  -testnet
       Use the test network

  -regtest
       Enter regression test mode, which uses a special chain in which blocks
       can be solved instantly. This is intended for regression testing tools
       and app development.

  -rpcconnect=<ip>
       Send commands to node running on <ip> (default: 127.0.0.1)

  -rpcport=<port>
       Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332)

  -rpcwait
       Wait for RPC server to start

  -rpcuser=<user>
       Username for JSON-RPC connections

  -rpcpassword=<pw>
       Password for JSON-RPC connections

SSL options: (see the Bitcoin Wiki for SSL setup instructions)

  -rpcssl
       Use OpenSSL (https) for JSON-RPC connections"

Tu donne une option à une commande sans le - Wink

DΛSH is digital cash. Transactions are obscured in the blockchain, making them private from the wallet. You can send Dash to family or friends, or pay for goods or services, anywhere in the world. DΛSH Anonymous and Untraceable. The Perfect Digital Cash And The Best Way To Protect Your Privacy https://www.dashpay.io DΛSH is 59.5 times faster with syncing and updating  than Monero.
My DΛSH Address: XgF6sNzGHU58dn36WsC16no9FHct6nPeZD
hamdi369 (OP)
Jr. Member
*
Offline Offline

Activity: 51
Merit: 2


View Profile
November 13, 2015, 01:20:45 PM
 #8

merci pour ton aide, mais que je mette des - ou pas j'ai toujours une erreur...

root@vultr:~/.bitcoin# bitcoin-cli --rpcwait
error: too few parameters
root@vultr:~/.bitcoin# bitcoin-cli -rpcwait
error: too few parameters
root@vultr:~/.bitcoin# bitcoin-cli rpcwait
error: {"code":-32601,"message":"Method not found"}
root@vultr:~/.bitcoin#


si tu veux je peux te filer le login du serveur tu le constatera de toi meme... Smiley
sangoku
Hero Member
*****
Offline Offline

Activity: 616
Merit: 501



View Profile WWW
November 13, 2015, 01:31:37 PM
 #9

T'as installé comment bitcoin sur ton serveur ? via des dépots ou t'as été chercher les sources que tu as compilé ou direct les exécutable pour ton système ?
Parce que là tu te trouves dans un dossier caché, donc dans le dossier de config du bitcoin.
Je crois pas que tu vas trouver tes fichiers exécutable là dedans Wink

DΛSH is digital cash. Transactions are obscured in the blockchain, making them private from the wallet. You can send Dash to family or friends, or pay for goods or services, anywhere in the world. DΛSH Anonymous and Untraceable. The Perfect Digital Cash And The Best Way To Protect Your Privacy https://www.dashpay.io DΛSH is 59.5 times faster with syncing and updating  than Monero.
My DΛSH Address: XgF6sNzGHU58dn36WsC16no9FHct6nPeZD
hamdi369 (OP)
Jr. Member
*
Offline Offline

Activity: 51
Merit: 2


View Profile
November 13, 2015, 01:35:05 PM
 #10

ok merci

je suis pas habitué à ubuntu et les lignes de commandes...

dois-je creer un user pour lancer correctement bitcoin?
hamdi369 (OP)
Jr. Member
*
Offline Offline

Activity: 51
Merit: 2


View Profile
November 13, 2015, 01:42:43 PM
 #11

Cannot obtain a lock on data directory /root/.bitcoin. Bitcoin Core is probably already running....
sangoku
Hero Member
*****
Offline Offline

Activity: 616
Merit: 501



View Profile WWW
November 13, 2015, 01:43:16 PM
 #12

T'as démarré ton daemon ? ./bitcoin -daemon
Essayes ./bitcoin-cli -rpcwait help

DΛSH is digital cash. Transactions are obscured in the blockchain, making them private from the wallet. You can send Dash to family or friends, or pay for goods or services, anywhere in the world. DΛSH Anonymous and Untraceable. The Perfect Digital Cash And The Best Way To Protect Your Privacy https://www.dashpay.io DΛSH is 59.5 times faster with syncing and updating  than Monero.
My DΛSH Address: XgF6sNzGHU58dn36WsC16no9FHct6nPeZD
sangoku
Hero Member
*****
Offline Offline

Activity: 616
Merit: 501



View Profile WWW
November 13, 2015, 01:43:40 PM
 #13

Ok donc ton daemon est bien démarré, essaye

./bitcoin-cli -rpcwait help

DΛSH is digital cash. Transactions are obscured in the blockchain, making them private from the wallet. You can send Dash to family or friends, or pay for goods or services, anywhere in the world. DΛSH Anonymous and Untraceable. The Perfect Digital Cash And The Best Way To Protect Your Privacy https://www.dashpay.io DΛSH is 59.5 times faster with syncing and updating  than Monero.
My DΛSH Address: XgF6sNzGHU58dn36WsC16no9FHct6nPeZD
hamdi369 (OP)
Jr. Member
*
Offline Offline

Activity: 51
Merit: 2


View Profile
November 13, 2015, 01:49:57 PM
 #14

merci pour ton aide mais je suis vraiment perdu...
sangoku
Hero Member
*****
Offline Offline

Activity: 616
Merit: 501



View Profile WWW
November 13, 2015, 01:53:35 PM
 #15

https://en.bitcoin.it/wiki/Running_Bitcoin

https://en.bitcoin.it/wiki/PHP_developer_intro

https://en.bitcoin.it/wiki/API_reference_%28JSON-RPC%29

https://bitcoin.org/en/developer-examples


Tout est là

DΛSH is digital cash. Transactions are obscured in the blockchain, making them private from the wallet. You can send Dash to family or friends, or pay for goods or services, anywhere in the world. DΛSH Anonymous and Untraceable. The Perfect Digital Cash And The Best Way To Protect Your Privacy https://www.dashpay.io DΛSH is 59.5 times faster with syncing and updating  than Monero.
My DΛSH Address: XgF6sNzGHU58dn36WsC16no9FHct6nPeZD
hamdi369 (OP)
Jr. Member
*
Offline Offline

Activity: 51
Merit: 2


View Profile
November 13, 2015, 02:09:12 PM
 #16

je veux pas t'ennuyer

je sais bien que je dois suivre le mode d'emploi...

par exemple je le suis je met  bitcoind [options] 

donc je tape bitcoind + une option dans la liste: -daemon :


root@vultr:~/.bitcoin# bitcoind -daemon
Bitcoin server starting
root@vultr:~/.bitcoin# Error: Cannot obtain a lock on data directory /root/.bitcoin. Bitcoin Core is probably already running.



Ca m'ennuie de t'embetter comme ça...

ce message Error: Cannot obtain a lock on data directory /root/.bitcoin. Bitcoin Core is probably already running. c'est celui qui reviens sans cesse...
sangoku
Hero Member
*****
Offline Offline

Activity: 616
Merit: 501



View Profile WWW
November 13, 2015, 02:13:50 PM
 #17

Normal, ton daemon bitcoin est déjà démarré.
Bon si tu es pas famillier avec les bases, je te conseille d'abord de les étudier et ensuite te mettre à bitcoin.
Tape simplement: ps -aux | grep bitcoind
Tu verras un résultat, tu auras le numéro du process, tu as déjà démaré le daemon.

Tu peux aussi utiliser la commande top pour voir les process
Si tu veux plus d'info man nom_commande
Bon là on s'écarte du sujet.

DΛSH is digital cash. Transactions are obscured in the blockchain, making them private from the wallet. You can send Dash to family or friends, or pay for goods or services, anywhere in the world. DΛSH Anonymous and Untraceable. The Perfect Digital Cash And The Best Way To Protect Your Privacy https://www.dashpay.io DΛSH is 59.5 times faster with syncing and updating  than Monero.
My DΛSH Address: XgF6sNzGHU58dn36WsC16no9FHct6nPeZD
hamdi369 (OP)
Jr. Member
*
Offline Offline

Activity: 51
Merit: 2


View Profile
November 13, 2015, 02:18:29 PM
 #18

ok

si j'ai demarré le deamon, pourquoi je n'obtient aucune reponse quand je check le php pour un simple get info?....

bref

merci de m'avoir aidé........
sangoku
Hero Member
*****
Offline Offline

Activity: 616
Merit: 501



View Profile WWW
November 13, 2015, 04:05:38 PM
 #19

Je suis pas un spécialiste PHP, mais dans la doc, c'est indiqué de cette façon

require_once 'jsonRPCClient.php';
$bitcoin = new jsonRPCClient('http://user:password@ip:8332/');

Toi tu fais ça:

require_once('jsonRPCClient.php');
$bitcoin = new Bitcoin('hamdi','motdepasse','107.191.40.74','8332');

Ne le prend pas mal,  mais souvent le problème est entre le clavier et la chaise Wink

DΛSH is digital cash. Transactions are obscured in the blockchain, making them private from the wallet. You can send Dash to family or friends, or pay for goods or services, anywhere in the world. DΛSH Anonymous and Untraceable. The Perfect Digital Cash And The Best Way To Protect Your Privacy https://www.dashpay.io DΛSH is 59.5 times faster with syncing and updating  than Monero.
My DΛSH Address: XgF6sNzGHU58dn36WsC16no9FHct6nPeZD
hamdi369 (OP)
Jr. Member
*
Offline Offline

Activity: 51
Merit: 2


View Profile
November 15, 2015, 02:49:19 PM
Last edit: November 15, 2015, 04:27:30 PM by kcud_dab
 #20

Je te remercie Sangoku
c'est super sympa de m'aider

merci
mais meme avec ça ce n'est pas là le probleme....

cette faute etait du que j'avais essayé avec jsonRPCClient.php et easybitcoin.php....

bitcoin-cli getinfo marche tres bien sur le serveur mais jamais en php...

j'ai fait tout essayé...
rien ne marche

j'ai essayé plein de solutions differentes...
toujours cette erreur 500...

j'ai beau cherché, je trouve pas.....

voici mon serveur pour celles/ceux qui veulent jeter un oeil....

je compte plus le nombre de serveur que j'ai supprimme et recommencé....

le serveur web marche bien : http://45.63.9.127/
le php aussi : http://45.63.9.127/info.php
Bitcoin-cli getinfo (en liogne de commande sur le serveur) output correctement

que je me requiere à jsonRPCClient.php (test1.php) ou à easybitcoin.php (test2.php) j'ai toujours une erreur 500....

j'aimerais bien savoir ou est le probleme... ... ... ...

mon serveur c'est 45.63.9.127
mot de passe : [edit modo: supprimé]

merci pour votre aide

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.
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!