Skip to content

marioproto92/chia-rpc-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chia RPC client for Java (1.8 and above)

NOTE!! This repo is in development, and the code is draft

convert cert

openssl pkcs12 -export \
  -in private_full_node.crt \
  -inkey private_full_node.key \
  -out private_full_node.p12 \
  -name "chia.net"

example

final String endpoint = "http://127.0.0.1:8555";
final String keyStorePass = "keyStorePass";

KeyStore keyStore;
try (InputStream in = this.getClass().getResourceAsStream("/path/to/private_full_node.p12")) {
    keyStore = KeyStoreLoader.load(in, "PKCS12", keyStorePass);
}
CloseableHttpClient hc = ClientCertAuthHttpClientBuilder.build(keyStore, keyStorePass, true);
FullNode client = new FullNodeHttpImpl(hc, new URL(endpoint).toURI());

final BlockchainState state = client.getBlockchainState();
System.out.println(state.getSync().isSynced());

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages