Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: berlinguyinca on July 13, 2011, 04:22:43 AM



Title: groovy - access wallet over JSON
Post by: berlinguyinca on July 13, 2011, 04:22:43 AM
hi,

I have a short question. I'm trying since 2-3 days now to access my local wallet using groovy and I'm sadly failling at this and running out of idea's by now. Does anybody has a simple groovy client?

I always get the error message: 'internal server error' without any details what is actually wrong.

my cleint:

Code:
  def authSite = new HTTPBuilder('http://127.0.0.1:8332/',JSON)
        authSite.auth.basic 'username', 'password'

        authSite.get(path: 'getbalance',
                query: [:]) { resp, json ->

            println resp.status

            json.each {  // iterate over JSON 'status' object in the response:
                println it
            }
        }


if I use the bitcoind tool on the command line, it works fine. So I'm sure the daemon is running.

thanks,

g.


Title: Re: groovy - access wallet over JSON
Post by: TeraPool on July 13, 2011, 05:41:42 PM
Never worked with or even heard of Groovy, sorry.

Why don't you try to implement some of the simple PHP peices of code available out there? https://en.bitcoin.it/wiki/PHP_developer_intro (https://en.bitcoin.it/wiki/PHP_developer_intro)


Title: Re: groovy - access wallet over JSON
Post by: berlinguyinca on July 13, 2011, 06:21:21 PM
Never worked with or even heard of Groovy, sorry.

Why don't you try to implement some of the simple PHP peices of code available out there? https://en.bitcoin.it/wiki/PHP_developer_intro (https://en.bitcoin.it/wiki/PHP_developer_intro)

Because I really dislike php/perl and this script is going to be included in a grails based application. Which means it needs to run on the jam. So groovy/scala/java it is. And there is sadly not a single fully documented java example on the bit coin site as far as I can see.


Title: Re: groovy - access wallet over JSON
Post by: willphase on July 14, 2011, 08:58:18 PM
Never worked with or even heard of Groovy, sorry.

Why don't you try to implement some of the simple PHP peices of code available out there? https://en.bitcoin.it/wiki/PHP_developer_intro (https://en.bitcoin.it/wiki/PHP_developer_intro)

Because I really dislike php/perl and this script is going to be included in a grails based application. Which means it needs to run on the jam. So groovy/scala/java it is. And there is sadly not a single fully documented java example on the bit coin site as far as I can see.

there is a complete Java bitcoin client here:

http://code.google.com/p/bitcoinj/

Possible you're using the wrong auth method in your code... but I'm totally unfamiliar with 'Groovy'.

Will