I think the hard part will be finding the bitcoin.conf on the system,
assuming you aren't feeding its path into the app. You might be able to use
some logic like so:
https://github.com/Blockchaintechs/StakerUI/blob/master/src/main/CommWithWallet.java#L158

Though that code could use improving and probably OS X support.

On Tue, May 24, 2016 at 5:21 AM, Sean Gilligan <[email protected]> wrote:

> Hi everyone,
>
> I'm looking for (and have written a quick hack solution) a Java class
> that can read a `bitcoin.conf` file. Has anybody seen anything that's
> fairly complete?
>
> The use case is a GUI or command-line app Java app that is using a
> Bitcoin JSON-RPC client to talk to bitcoind. If it's running under the
> same user account as the daemon, it can read the `bitcoin.conf` file to
> find the connection info for bitcoind.
>
> As I've mentioned before (to Mike Hearn and in the Issues DB) I'm
> working on a JSON-RPC client that uses bitcoinj types that can talk to
> bitcoind. I've also got some command-line tools written in Java that
> could use this feature. All are available under the Apache license and
> I'm willing to contribute them to bitcoinj (possibly in a separate
> add-ons repo)
>
> So I see a class that can read `bitcoin.conf` as a useful part of that
> overall solution.
>
> If there is nothing better out there I will improve my hack (that is
> currently in my RPC client module)
>
> Thanks,
>
> Sean
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "bitcoinj" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"bitcoinj" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to