ConsensusJ/consensusj

I want to use jsonrpc to connect bitcoind. What should I do?

Closed this issue · 2 comments

I want to use jsonrpc to connect bitcoind. What should I do?
Can you give me an example?

Create an instance of BitcoinClient and then start calling the methods you want to use. You'll need to provide URL, port, username, password to connect, of course.

Something like this:

    URI server = new URI("http://server.domain.tld:8332");  
    BitcoinClient client = new BitcoinClient(MainNetParams.get(), server, "username", "password");
    Integer count = client.getBlockCount();

Long term the answer to this question should be provided by #21 and #54 .