Is there a way to use any JSON-RPC framework in Java to connect and pass commands to a node?
I have tried this and I get a connection reset even though it connects just fine using telnet (so there's definitely a process attached to the port):
Map<String, String> headers = new HashMap<>();
headers.put("Authorization", "Basic <My credentials in Base64 from multichain.conf>");
JsonRpcHttpClient client = new JsonRpcHttpClient(new URL("http://<my node>:9551"), headers);
client.invoke("getinfo", new Object[] { "chain_name", "chain1", "id", 1 });
I am using
<dependency>
<groupId>com.github.briandilley.jsonrpc4j</groupId>
<artifactId>jsonrpc4j</artifactId>
<version>1.2.0</version>
</dependency>
as JSON-RPC client. What am I doing wrong?