Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: bitcoinex on August 04, 2010, 07:00:42 PM



Title: different return codes when sending coins from CLI?
Post by: bitcoinex on August 04, 2010, 07:00:42 PM
Please make a different return codes for bitcoin client when sending coins from command line.

Now amount error and address error have equal return codes and becomes difficult to distinguish error while writing a high-level interface.



Title: Re: different return codes when sending coins from CLI?
Post by: lachesis on August 04, 2010, 11:13:45 PM
You should be using Python or Perl or something when writing a high level interface. The CLI code is really just there to let you play with the server. You should try the python-jsonrpc library.


Title: Re: different return codes when sending coins from CLI?
Post by: bitcoinex on August 05, 2010, 05:47:16 PM
You should be using Python or Perl or something when writing a high level interface. The CLI code is really just there to let you play with the server. You should try the python-jsonrpc library.

Not agree with you.

JSON-RPC provides too many permissions. For webshop you need only address generation and info about receiving coins to address. JSON-RPC will provide an opportunity after site hack steal coins through it with website's uid.

That is, you still need a wrapper that implenets only the necessary functions and that changes the uid (by sudo or suid)


Title: Re: different return codes when sending coins from CLI?
Post by: knightmb on August 05, 2010, 06:24:28 PM
Aren't the JSON-RPC commands the same as the command line, just ported over the http ? Both would return the same problem I believe.


Title: Re: different return codes when sending coins from CLI?
Post by: Gavin Andresen on August 05, 2010, 06:40:16 PM
Ummm, the command-line RPC is implemented on top of the JSON-RPC mechanism.

So if the command-line RPC is working on your machine, then the JSON-RPC is, too.


Title: Re: different return codes when sending coins from CLI?
Post by: bitcoinex on August 05, 2010, 06:58:41 PM
Ummm, the command-line RPC is implemented on top of the JSON-RPC mechanism.

So if the command-line RPC is working on your machine, then the JSON-RPC is, too.


On my project bitcoin client runs as special 'bitcoin' user's program.
All communications between www-data (webserver user) and bitcoin client works through wrappers. User www-data don't knows JSON-RPC password.