diff --git a/.gitignore b/.gitignore
index 72bb3ff..b3377c7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,4 +7,6 @@ target/
# Project-specific patterns
logs/
-cloc_analysis_14122015.txt
\ No newline at end of file
+cloc_analysis_14122015.txt
+
+.idea/
diff --git a/README.md b/README.md
index 872d968..8336991 100644
--- a/README.md
+++ b/README.md
@@ -36,6 +36,10 @@ Other dependencies:
If you want to test locally (i.e. not checking in changes to github and doing a jitpack release), run `mvn install`, which will publish jars to your local maven repo as such:
"com.github.bitsoex.btcd-cli4j:btcd-cli4j-core:1.0-SNAPSHOT"
+```
+Make sure about setting the SDK 8 version for the project when using maven install from IDEA or set your JAVA_HOME to Java 1.8 when using it from terminal
+```
+
In your code depending upon this library, change your dependency to this snapshot version. You might need to instruct your gradle to search your local maven, so add this to your build.gradle file:
repositories {
diff --git a/core/pom.xml b/core/pom.xml
index 9146f3c..202a184 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -1,48 +1,53 @@
- 4.0.0
-
- com.github.bitsoex.btcd-cli4j
- btcd-cli4j-parent
- 1.0-SNAPSHOT
-
- btcd-cli4j-core
- jar
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ 4.0.0
+
+ com.github.bitsoex.btcd-cli4j
+ btcd-cli4j-parent
+ 1.0-SNAPSHOT
+
+ btcd-cli4j-core
+ jar
- btcd-cli4j Core
- A set of tools for working with the JSON-RPC API provided by Bitcoin Core
+ btcd-cli4j Core
+ A set of tools for working with the JSON-RPC API provided by Bitcoin Core
-
-
- org.apache.httpcomponents
- httpclient
- 4.3.6
-
-
- com.fasterxml.jackson.core
- jackson-core
- ${jackson.version}
-
-
- com.fasterxml.jackson.core
- jackson-annotations
- ${jackson.version}
-
-
- com.fasterxml.jackson.core
- jackson-databind
- ${jackson.version}
-
-
- org.slf4j
- slf4j-api
- ${slf4j.version}
-
-
- org.apache.commons
- commons-lang3
- ${commons-lang.version}
-
-
-
\ No newline at end of file
+
+
+ com.github.bitsoex.btcd-cli4j
+ btcd-cli4j-proto
+ ${project.parent.version}
+
+
+ org.apache.httpcomponents
+ httpclient
+ 4.3.6
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+ ${jackson.version}
+
+
+ com.fasterxml.jackson.core
+ jackson-annotations
+ ${jackson.version}
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ ${jackson.version}
+
+
+ org.slf4j
+ slf4j-api
+ ${slf4j.version}
+
+
+ org.apache.commons
+ commons-lang3
+ ${commons-lang.version}
+
+
+
diff --git a/core/src/main/java/com/neemre/btcdcli4j/core/client/BtcdClient.java b/core/src/main/java/com/neemre/btcdcli4j/core/client/BtcdClient.java
index 3a45cf5..e9745aa 100644
--- a/core/src/main/java/com/neemre/btcdcli4j/core/client/BtcdClient.java
+++ b/core/src/main/java/com/neemre/btcdcli4j/core/client/BtcdClient.java
@@ -4,8 +4,10 @@
import java.math.BigInteger;
import java.util.List;
import java.util.Map;
+import java.util.Optional;
import java.util.Properties;
+import com.bitso.model.BtcdServiceProto;
import com.neemre.btcdcli4j.core.BitcoindException;
import com.neemre.btcdcli4j.core.CommunicationException;
import com.neemre.btcdcli4j.core.domain.Account;
@@ -167,6 +169,8 @@ List extends Object> getRawMemPool(Boolean isDetailed) throws BitcoindExceptio
String getRawTransaction(String txId) throws BitcoindException, CommunicationException;
+ Optional getRawTransactionResponse(String txId);
+
Object getRawTransaction(String txId, Integer verbosity) throws BitcoindException,
CommunicationException;
diff --git a/core/src/main/java/com/neemre/btcdcli4j/core/client/BtcdClientImpl.java b/core/src/main/java/com/neemre/btcdcli4j/core/client/BtcdClientImpl.java
index d0531e6..3e2154a 100644
--- a/core/src/main/java/com/neemre/btcdcli4j/core/client/BtcdClientImpl.java
+++ b/core/src/main/java/com/neemre/btcdcli4j/core/client/BtcdClientImpl.java
@@ -5,9 +5,13 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import java.util.Optional;
import java.util.Properties;
+import com.bitso.model.BtcdServiceProto;
+import com.neemre.btcdcli4j.core.NodeProperties;
import com.neemre.btcdcli4j.core.domain.*;
+import com.neemre.btcdcli4j.core.grpc.BtcdGrpcClient;
import org.apache.http.impl.client.CloseableHttpClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -28,37 +32,39 @@ public class BtcdClientImpl implements BtcdClient {
private ClientConfigurator configurator;
private JsonRpcClient rpcClient;
-
+ private BtcdGrpcClient grpcClient;
public BtcdClientImpl(Properties nodeConfig) throws BitcoindException, CommunicationException {
this(null, nodeConfig);
}
- public BtcdClientImpl(CloseableHttpClient httpProvider, Properties nodeConfig)
+ public BtcdClientImpl(CloseableHttpClient httpProvider, Properties nodeConfig)
throws BitcoindException, CommunicationException {
initialize();
- rpcClient = new JsonRpcClientImpl(configurator.checkHttpProvider(httpProvider),
+ grpcClient = new BtcdGrpcClient(nodeConfig.getProperty(NodeProperties.RPC_HOST.getDefaultValue()),
+ Integer.parseInt(NodeProperties.RPC_PORT.getDefaultValue()));
+ rpcClient = new JsonRpcClientImpl(configurator.checkHttpProvider(httpProvider),
configurator.checkNodeConfig(nodeConfig));
configurator.checkNodeVersion(getNetworkInfo().getVersion());
configurator.checkNodeHealth((Block)getBlock(getBestBlockHash(), true));
}
- public BtcdClientImpl(String rpcUser, String rpcPassword) throws BitcoindException,
+ public BtcdClientImpl(String rpcUser, String rpcPassword) throws BitcoindException,
CommunicationException {
this(null, null, rpcUser, rpcPassword);
}
- public BtcdClientImpl(CloseableHttpClient httpProvider, String rpcUser, String rpcPassword)
+ public BtcdClientImpl(CloseableHttpClient httpProvider, String rpcUser, String rpcPassword)
throws BitcoindException, CommunicationException {
this(httpProvider, null, null, rpcUser, rpcPassword);
}
- public BtcdClientImpl(String rpcHost, Integer rpcPort, String rpcUser, String rpcPassword)
+ public BtcdClientImpl(String rpcHost, Integer rpcPort, String rpcUser, String rpcPassword)
throws BitcoindException, CommunicationException {
this((String)null, rpcHost, rpcPort, rpcUser, rpcPassword);
}
- public BtcdClientImpl(CloseableHttpClient httpProvider, String rpcHost, Integer rpcPort,
+ public BtcdClientImpl(CloseableHttpClient httpProvider, String rpcHost, Integer rpcPort,
String rpcUser, String rpcPassword) throws BitcoindException, CommunicationException {
this(httpProvider, null, rpcHost, rpcPort, rpcUser, rpcPassword);
}
@@ -69,36 +75,36 @@ public BtcdClientImpl(String rpcProtocol, String rpcHost, Integer rpcPort, Strin
}
public BtcdClientImpl(CloseableHttpClient httpProvider, String rpcProtocol, String rpcHost,
- Integer rpcPort, String rpcUser, String rpcPassword) throws BitcoindException,
+ Integer rpcPort, String rpcUser, String rpcPassword) throws BitcoindException,
CommunicationException {
this(httpProvider, rpcProtocol, rpcHost, rpcPort, rpcUser, rpcPassword, null);
}
- public BtcdClientImpl(String rpcProtocol, String rpcHost, Integer rpcPort, String rpcUser,
- String rpcPassword, String httpAuthScheme) throws BitcoindException,
+ public BtcdClientImpl(String rpcProtocol, String rpcHost, Integer rpcPort, String rpcUser,
+ String rpcPassword, String httpAuthScheme) throws BitcoindException,
CommunicationException {
this(null, rpcProtocol, rpcHost, rpcPort, rpcUser, rpcPassword, httpAuthScheme);
}
public BtcdClientImpl(CloseableHttpClient httpProvider, String rpcProtocol, String rpcHost,
- Integer rpcPort, String rpcUser, String rpcPassword, String httpAuthScheme)
+ Integer rpcPort, String rpcUser, String rpcPassword, String httpAuthScheme)
throws BitcoindException, CommunicationException {
- this(httpProvider, new ClientConfigurator().toProperties(rpcProtocol, rpcHost, rpcPort,
+ this(httpProvider, new ClientConfigurator().toProperties(rpcProtocol, rpcHost, rpcPort,
rpcUser, rpcPassword, httpAuthScheme));
}
@Override
- public String addMultiSigAddress(Integer minSignatures, List addresses)
+ public String addMultiSigAddress(Integer minSignatures, List addresses)
throws BitcoindException, CommunicationException {
List