1

I am looking for Java Json-Rpc for Litecoin or any implementation for Litecoin

2 Answers 2

2

Since Litecoin is a fork of bitcoin you can use JavaBitcoindRpcClient to connect with litecoin client and execute API calls.

link:https://github.com/Polve/JavaBitcoindRpcClient

To connect with client, you can use below code :

String user = "RPC_USER_NAME";
String password = "RPC_PASSWORD";
String host = "127.0.0.1";
String port = "PORT";

try {
    URL url = new URL("http://" + user + ':' + password + "@" + host + ":" + port + "/");

    BitcoinJSONRPCClient bitcoinClient = new BitcoinJSONRPCClient(url);
    System.out.println(bitcoinClient.getInfo());
} catch (MalformedURLException e) {
    e.printStackTrace();
}
2
  • Thank you @AjitSoman . I have went through it earlier but not able to find any example for using it,It will helpful if you can provide few reference for the example.
    – Aman Vyas
    Dec 12, 2017 at 9:18
  • I have added connection code
    – Ajit Soman
    Dec 12, 2017 at 9:46
0

In my implementation the java URL cannot be built with the structure http://username:pass@server:port

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.