Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

Commit

Permalink
Accounts beta release - 1.0.0-beta4 (#157)
Browse files Browse the repository at this point in the history
* Event management system

* Account builder and API builder rewrite for re-usability

* Split storage and config modules

* Reattach/Promote plugin (runs every 30 seconds, excluding POW time when doing local) 

* Incoming transfer plugin

* Outgoing transfer plugin

* Added account state and deposit methods

* load/save account state using JSON file

* Added a custom seed provider

* Address generation cache

* Added shutdown event, called before account "shutdown()"

* Added some documentation and tests to account module

* Added javadoc to connection, allow custom connection methods

* Updated to Junit 5 (tests are still Junit 4 using legacy plugin)

* Added QRCode and Magnet link creation from a CDA

* Addded a MongoDB storage class

* Organised imports
  • Loading branch information
kwek20 authored Apr 9, 2019
1 parent b5df0ce commit b9d025c
Show file tree
Hide file tree
Showing 226 changed files with 13,087 additions and 929 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ To download the IOTA Java client library and its dependencies, you can use one o
```gradle
dependencies {
compile 'com.github.iotaledger:iota-java:1.0.0-beta3'
compile 'com.github.iotaledger:iota-java:1.0.0-beta4'
}
```
Expand All @@ -96,7 +96,7 @@ To download the IOTA Java client library and its dependencies, you can use one o
```
3. Change the value of the `<version>` tag to either a release number or the first 10 characters of a Git commit hash:
`<version>a98de8ea50</version>` or `<version>1.0.0-beta3</version>`
`<version>51adea1b25</version>` or `<version>1.0.0-beta4</version>`
**Note:** Find the latest version on the [Jitpack](https://jitpack.io/#iotaledger/iota-java) page.
Expand Down Expand Up @@ -178,6 +178,7 @@ We have a list of test cases on the [`src/test/java` directory][tests] that you
A good starter is the [`IotaAPITest` case](https://github.com/iotaledger/iota-java/blob/master/jota/src/test/java/jota/IotaAPITest.java).

## Change logs:
- Changes in [**1.0.0-beta4**](https://github.com/iotaledger/iota-java/compare/1.0.0-beta3...1.0.0-beta4)
- Changes in [**1.0.0-beta3**](https://github.com/iotaledger/iota-java/compare/1.0.0-beta2...1.0.0-beta3)
- Changes in [**1.0.0-beta2**](https://github.com/iotaledger/iota-java/compare/1.0.0-beta1...1.0.0-beta2)
- Changes in [**1.0.0-beta1**](https://github.com/iotaledger/iota-java/compare/0.9.10...1.0.0-beta1)
Expand Down Expand Up @@ -211,8 +212,8 @@ The Apache 2.0 license can be found [here](license).
[travis-badge]: https://travis-ci.org/iotaledger/iota-java.svg?branch=master
[license]: https://github.com/iotaledger/iota-java/blob/master/LICENSE
[license-badge]: https://img.shields.io/github/license/iotaledger/iota-java.svg
[iota-iri]: https://github.com/iotaledger/iri/tree/v1.5.5
[iota-iri-badge]: https://img.shields.io/badge/IOTA%20IRI%20compatibility-v1.5.5-blue.svg
[iota-iri]: https://github.com/iotaledger/iri/tree/v1.6.1
[iota-iri-badge]: https://img.shields.io/badge/IOTA%20IRI%20compatibility-v1.6.1-blue.svg
[iota-api]: https://iota.readme.io/reference
[iota-api-badge]: https://img.shields.io/badge/IOTA%20API%20coverage-15/15%20commands-green.svg
[javadoc]: https://iotaledger.github.io/iota-java/javadoc/
Expand Down
1 change: 1 addition & 0 deletions client.store
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"LXQHWNY9CQOHPNMKFJFIJHGEPAENAOVFRDIBF99PPHDTWJDCGHLYETXT9NPUVSNKT9XDTDYNJKJCPQMZC":{"keyIndex":4,"depositRequests":{"1":{"timeOut":0,"multiUse":false,"expectedAmount":5}},"pendingTransfers":{}}}
Empty file added jota/client_new.store
Empty file.
60 changes: 56 additions & 4 deletions jota/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.iota</groupId>
<artifactId>jota-parent</artifactId>
<version>1.0.0-beta3</version>
<version>1.0.0-beta4</version>
</parent>

<name>JOTA : Library</name>
Expand Down Expand Up @@ -33,14 +33,66 @@
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>net.jadler</groupId>
<artifactId>jadler-all</artifactId>
<scope>test</scope>
</dependency>

<!-- Testing -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
</dependency>

<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</dependency>

<dependency>
<groupId>net.jadler</groupId>
<artifactId>jadler-all</artifactId>
<scope>test</scope>
</dependency>

<!-- Account specific -->
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
</dependency>

<dependency>
<groupId>com.github.kenglxn.qrgen</groupId>
<artifactId>javase</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>

<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver</artifactId>
</dependency>

<dependency>
<groupId>org.mongodb</groupId>
<artifactId>bson</artifactId>
</dependency>
</dependencies>
</project>
12 changes: 0 additions & 12 deletions jota/src/main/java/jota/utils/ExtractJson.java

This file was deleted.

118 changes: 118 additions & 0 deletions jota/src/main/java/org/iota/jota/ApiOptions.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
package org.iota.jota;

import java.util.List;

import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.iota.jota.builder.ApiBuilderSettings;
import org.iota.jota.config.options.ApiConfig;
import org.iota.jota.connection.Connection;
import org.iota.jota.pow.ICurl;

/**
*
* The current instance of API configuration options based on env, file and defaults
* Modifications can be made but will not persist throughout restarts
*
*/
public class ApiOptions implements ApiConfig, ApiBuilderSettings {

private int legacyPort;
private String legacyProtocol;
private String legacyHost;

private ICurl customCurl;
private IotaLocalPoW localPoW;

//Nodes are not active
private List<Connection> nodes;
private int timeout;

public ApiOptions(IotaAPI.Builder builder) {
localPoW = builder.getLocalPoW();
customCurl = builder.getCustomCurl();
legacyProtocol = builder.getProtocol();
legacyHost = builder.getHost();
legacyPort = builder.getPort();
nodes = builder.getNodes();
}


public List<Connection> getNodes() {
return nodes;
}

@Override
public boolean hasNodes() {
return this.nodes != null && this.nodes.size() > 0;
}


public void setNodes(List<Connection> nodes) {
this.nodes = nodes;
}

@Override
public int getLegacyPort() {
return legacyPort;
}


public void setLegacyPort(int legacyPort) {
this.legacyPort = legacyPort;
}

@Override
public String getLegacyProtocol() {
return legacyProtocol;
}


public void setLegacyProtocol(String legacyProtocol) {
this.legacyProtocol = legacyProtocol;
}

@Override
public String getLegacyHost() {
return legacyHost;
}


public void setLegacyHost(String legacyHost) {
this.legacyHost = legacyHost;
}

@Override
public ICurl getCustomCurl() {
return customCurl;
}


public void setCustomCurl(ICurl customCurl) {
this.customCurl = customCurl;
}

@Override
public IotaLocalPoW getLocalPoW() {
return localPoW;
}


public void setLocalPoW(IotaLocalPoW localPoW) {
this.localPoW = localPoW;
}

@Override
public int getConnectionTimeout() {
return timeout;
}

public void setTimeout(int timeout) {
this.timeout = timeout;
}

@Override
public String toString() {
return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString();
}
}
Loading

0 comments on commit b9d025c

Please sign in to comment.