Skip to content
This repository was archived by the owner on Jan 19, 2024. It is now read-only.

Commit 476f6e9

Browse files
authored
Fix merge (#17)
* fix ignores and remove stale files * remove checkouts * Create Java Demo (#12) * readme * node demo and docs * node demo * demo image * node demo * update ci * wip * remove swift demo * base infra to work with carthage * deinit some submodules * Update README.md * more source * more finicking with xcode * remove carthage * remove frameworks * working demo * working CI / demo * rename file * minor polish * java wip * add circle config * Update README.md * demo * CI * git ignore / CI fixes * rebuild * update gitignore * update ci * update gitignore * remove errant ignore * adding in cached files * add executable jar * exporting * configure plugin * install maven * remove files * Update config.yml * running demo * polish * remove more files * rm file * remove iml * remove ignore * fix gitignore * fix typo * rm carthage
1 parent e1a59bd commit 476f6e9

File tree

6 files changed

+120
-2
lines changed

6 files changed

+120
-2
lines changed

.circleci/config.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ jobs:
99

1010
- run:
1111
name: "Install tooling"
12-
command: brew install swiftlint
12+
command: brew install swiftlint maven
1313

1414
- run:
1515
name: "Run Node SDK Demo"
1616
command: cd node && npm i && node src/index.js
1717

1818
- run:
1919
name: "Run Swift SDK Demo"
20-
command: cd swift && carthage bootstrap --platform mac && set -o pipefail && xcodebuild build -scheme Demo ONLY_ACTIVE_ARCH=YES
20+
command: cd swift && carthage bootstrap --platform mac && set -o pipefail && xcodebuild build -scheme Demo ONLY_ACTIVE_ARCH=YES
21+
22+
- run:
23+
name: "Run Java SDK Demo"
24+
command: cd java && mvn package

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
java/*.iml
2+
java/target
3+
java/.idea
14

25
# Created by https://www.gitignore.io/api/osx,node,java,xcode,swift,intellij,carthage
36
# Edit at https://www.gitignore.io/?templates=osx,node,java,xcode,swift,intellij,carthage

java/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Java Demo
2+
3+
<img src="java-demo.png" alt="Screenshot of the Xpring SDK Demo"/>
4+
5+
Demonstrates [xpring4j](http://github.com/xpring-eng/xpring4j).
6+
7+
This demo builds using [Maven](https://maven.apache.org/what-is-maven.html) but it is also possible to use xpring4j with [Gradle](https://gradle.org/).
8+
9+
To build:
10+
```shell
11+
# Install required tooling
12+
brew install maven
13+
14+
# Build and run demo
15+
mvn package exec:java
16+
```

java/java-demo.png

256 KB
Loading

java/pom.xml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>io.xpring</groupId>
8+
<artifactId>SDK-Demo</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
<properties>
11+
<slf4j.version>1.7.30</slf4j.version>
12+
</properties>
13+
14+
15+
<dependencies>
16+
<dependency>
17+
<groupId>io.xpring</groupId>
18+
<artifactId>xpring4j</artifactId>
19+
<version>2.0.0</version>
20+
</dependency>
21+
<dependency>
22+
<groupId>org.slf4j</groupId>
23+
<artifactId>slf4j-api</artifactId>
24+
<version>1.7.5</version>
25+
</dependency>
26+
<dependency>
27+
<groupId>org.slf4j</groupId>
28+
<artifactId>slf4j-simple</artifactId>
29+
<version>1.6.4</version>
30+
</dependency>
31+
</dependencies>
32+
33+
<build>
34+
35+
<plugins>
36+
<plugin>
37+
<groupId>org.apache.maven.plugins</groupId>
38+
<artifactId>maven-compiler-plugin</artifactId>
39+
<configuration>
40+
<source>8</source>
41+
<target>8</target>
42+
</configuration>
43+
</plugin>
44+
<plugin>
45+
<groupId>org.codehaus.mojo</groupId>
46+
<artifactId>exec-maven-plugin</artifactId>
47+
<version>1.4.0</version>
48+
<configuration>
49+
<mainClass>io.xpring.demo.Demo</mainClass>
50+
<cleanupDaemonThreads>false</cleanupDaemonThreads>
51+
</configuration>
52+
</plugin>
53+
</plugins>
54+
</build>
55+
56+
</project>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package io.xpring.demo;
2+
3+
import io.xpring.xrpl.*;
4+
5+
import java.math.BigInteger;
6+
7+
public class Demo {
8+
public static void main(String[] args) throws XpringException {
9+
// A URL to reach the remote rippled node at.
10+
String grpcAddress = "3.14.64.116:50051";
11+
12+
// A wallet that exists on Testnet.
13+
String seed = "snYP7oArxKepd3GPDcrjMsJYiJeJB";
14+
Wallet wallet = new Wallet(seed);
15+
16+
// A recipient address.
17+
String recipientAddress = "X7cBcY4bdTTzk3LHmrKAK6GyrirkXfLHGFxzke5zTmYMfw4";
18+
BigInteger dropsToSend = BigInteger.valueOf(10);
19+
20+
System.out.println("\nUsing rippled node located at: " + grpcAddress + "\n");
21+
XpringClient xrpClient = new XpringClient(grpcAddress, true);
22+
23+
System.out.println("Retrieving balance for" + wallet.getAddress() + "..");
24+
BigInteger balance = xrpClient.getBalance(wallet.getAddress());
25+
26+
System.out.println("Balance was " + balance + " drops!\n");
27+
28+
System.out.println("Sending:");
29+
System.out.println("- Drops " + dropsToSend );
30+
System.out.println("- To: " + recipientAddress);
31+
System.out.println("- From: " + wallet.getAddress() + "\n");
32+
String hash = xrpClient.send(dropsToSend, recipientAddress, wallet);
33+
34+
System.out.println("Hash for transaction:\n" + hash + "\n");
35+
36+
TransactionStatus status = xrpClient.getTransactionStatus( hash);
37+
System.out.println("Result for transaction is:\n" + status + "\n");
38+
}
39+
}

0 commit comments

Comments
 (0)