https://weavechain.com: Layer-0 For Data
implementation 'com.weavechain:api:1.1'
implementation("com.weavechain:api:1.1")
<dependency>
<groupId>com.weavechain</groupId>
<artifactId>api</artifactId>
<version>1.1</version>
</dependency>
--add-opens=java.base/sun.security.x509=ALL-UNNAMED --add-exports=java.base/sun.security.util=ALL-UNNAMED
val jvmAddedArgs = listOf(
"--add-opens=java.base/sun.security.x509=ALL-UNNAMED",
"--add-exports=java.base/sun.security.util=ALL-UNNAMED"
)
application {
mainClass.set(mainCls)
applicationDefaultJvmArgs += jvmAddedArgs
}
mavenCentral()
maven("https://jitpack.io")
maven("https://hyperledger.jfrog.io/artifactory/besu-maven")
Keys keys = Keys.generateKeys();
String pub = keys.getPublicKey();
String pvk = keys.getPrivateKey();
System.out.println("Public key: " + pub);
System.out.println("Private key:" + pvk);
String host = "public.weavechain.com";
int port = 443;
String seed = "92f30f0b6be2732cb817c19839b0940c";
String organization = "weavedemo";
String scope = "shared";
String table = "directory";
ChainClientConfig cfg = new ChainClientConfig()
.organization(organization)
.http(new HttpClientConfig()
.host(host)
.port(port)
.useHttps(true)
)
.seed(seed)
.privateKey(pvk)
.publicKey(pub);
ApiClientV1 nodeApi = ChainApiFactory.createApiClient(cfg);
nodeApi.init();
Session session = nodeApi.login(organization, pub, "*").get();
OperationResult reply = nodeApi.read(session, scope, table, null, ReadOptions.DEFAULT_NO_CHAIN).get();
System.out.println(reply.getStringData());
nodeApi.logout(session);