Bitcoin Forum
June 25, 2019, 09:50:36 PM *
News: Latest Bitcoin Core release: 0.18.0 [Torrent] (New!)
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: RPC Api with client?  (Read 8577 times)
martin
Full Member
***
Offline Offline

Activity: 150
Merit: 100



View Profile WWW
July 14, 2010, 10:57:00 PM
 #1

A simple question which I can't find the answer to, and I'm not at a computer with a bitcoin client at the moment so I can't test - does the windows bitcoin client (with GUI) run the Json Rpc Api, or is that only run from the headless client?
1561499436
Hero Member
*
Offline Offline

Posts: 1561499436

View Profile Personal Message (Offline)

Ignore
1561499436
Reply with quote  #2

1561499436
Report to moderator
Try The Brand New Ethereum Game
50 Last Players Also Win The Bank
Works On Any iOS/Android Device With Standard Browser
Join Us On Telegram To Get Notified When You Can Win
COLOR PIXELS
AND WIN
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1561499436
Hero Member
*
Offline Offline

Posts: 1561499436

View Profile Personal Message (Offline)

Ignore
1561499436
Reply with quote  #2

1561499436
Report to moderator
theymos
Administrator
Legendary
*
Offline Offline

Activity: 3430
Merit: 5934


View Profile
July 14, 2010, 11:00:46 PM
 #2

You can run it with the "-server" switch to have it run the RPC server.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
martin
Full Member
***
Offline Offline

Activity: 150
Merit: 100



View Profile WWW
July 14, 2010, 11:17:23 PM
 #3

Ah, that sounds promising, and it still shows the normal UI etc?
theymos
Administrator
Legendary
*
Offline Offline

Activity: 3430
Merit: 5934


View Profile
July 14, 2010, 11:38:51 PM
 #4

Yes.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
martin
Full Member
***
Offline Offline

Activity: 150
Merit: 100



View Profile WWW
July 15, 2010, 12:31:14 AM
Last edit: July 15, 2010, 12:49:09 AM by martin
 #5

Thanks theymos.

I'm back at my development machine now, and I've successfully got a java applet communicating with the client via the Json Rpc. I wonder if you could help me with some specifics of the API?

Sending a string like this to the server:

{"jsonrpc": "2.0", "id":"json test", "method": "getinfo", "params": [] }

Returns a response like this:

{"result":{"balance": 0.00000000000000,"blocks":67486,"connections":8,"proxy":"","generate":true,"genproclimit":4,"difficulty":45.38582234101263},"error":null,"id":"json test"}

All well and good. However, sending a string like this:

{"jsonrpc": "2.0", "id":"send money to testaddress from web ui", "method": "sendtoaddress", "params": [1DoMXge6kToHZN8m4B2my43anCPbD4rJgE, 0.25] }

Gets me a http 500 error, which isn't great. Is my string malformed in some way?

EDIT:: Fixed, of course the bitcoin address is a string, and I wasn't enclosing it in quotes, silly me.
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!