Skip to content

Commit 13de739

Browse files
committed
release v1.0.15
1 parent e0596a0 commit 13de739

2 files changed

Lines changed: 39 additions & 1 deletion

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.github.ontio</groupId>
88
<artifactId>ontology-sdk-java</artifactId>
9-
<version>1.0.14</version>
9+
<version>1.0.15</version>
1010

1111
<properties>
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

src/main/java/demo/ApiDemo.java

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package demo;
2+
3+
import com.github.ontio.OntSdk;
4+
5+
/**
6+
* @Description:
7+
* @date 2019/12/12
8+
*/
9+
public class ApiDemo {
10+
11+
public static void main(String[] args) {
12+
13+
try {
14+
OntSdk ontSdk = getOntSdk();
15+
if (true) {
16+
System.out.println(ontSdk.getConnect().getBalance("AHX1wzvdw9Yipk7E9MuLY4GGX4Ym9tHeDe"));
17+
System.out.println(ontSdk.getConnect().getNodeSyncStatus());
18+
System.exit(0);
19+
}
20+
}catch (Exception ex){
21+
}
22+
}
23+
public static OntSdk getOntSdk() throws Exception {
24+
25+
String ip = "http://polaris1.ont.io";
26+
String restUrl = ip + ":" + "20334";
27+
String rpcUrl = ip + ":" + "20336";
28+
String wsUrl = ip + ":" + "20335";
29+
30+
OntSdk wm = OntSdk.getInstance();
31+
wm.setRpc(rpcUrl);
32+
wm.setRestful(restUrl);
33+
wm.setDefaultConnect(wm.getRpc());
34+
wm.openWalletFile("wallet2.dat");
35+
36+
return wm;
37+
}
38+
}

0 commit comments

Comments
 (0)