Skip to content

Commit

Permalink
release v1.0.15
Browse files Browse the repository at this point in the history
  • Loading branch information
xizho10 committed Dec 12, 2019
1 parent e0596a0 commit 13de739
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.github.ontio</groupId>
<artifactId>ontology-sdk-java</artifactId>
<version>1.0.14</version>
<version>1.0.15</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
38 changes: 38 additions & 0 deletions src/main/java/demo/ApiDemo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package demo;

import com.github.ontio.OntSdk;

/**
* @Description:
* @date 2019/12/12
*/
public class ApiDemo {

public static void main(String[] args) {

try {
OntSdk ontSdk = getOntSdk();
if (true) {
System.out.println(ontSdk.getConnect().getBalance("AHX1wzvdw9Yipk7E9MuLY4GGX4Ym9tHeDe"));
System.out.println(ontSdk.getConnect().getNodeSyncStatus());
System.exit(0);
}
}catch (Exception ex){
}
}
public static OntSdk getOntSdk() throws Exception {

String ip = "http://polaris1.ont.io";
String restUrl = ip + ":" + "20334";
String rpcUrl = ip + ":" + "20336";
String wsUrl = ip + ":" + "20335";

OntSdk wm = OntSdk.getInstance();
wm.setRpc(rpcUrl);
wm.setRestful(restUrl);
wm.setDefaultConnect(wm.getRpc());
wm.openWalletFile("wallet2.dat");

return wm;
}
}

0 comments on commit 13de739

Please sign in to comment.