diff --git a/ethereumj-core/pom.xml b/ethereumj-core/pom.xml index e1d3c2b7..6c3310c8 100644 --- a/ethereumj-core/pom.xml +++ b/ethereumj-core/pom.xml @@ -18,8 +18,6 @@ * Install jar with sources to the maven repository mvn install -Dmaven.test.skip=true - * Release to mvn repository in github (settings.xml should be updated with user/pass): - mvn clean deploy -Dmaven.test.skip=true --> diff --git a/ethereumj-core/src/main/java/org/ethereum/facade/Ethereum.java b/ethereumj-core/src/main/java/org/ethereum/facade/Ethereum.java index 34ba6e5e..bf4d6c0a 100644 --- a/ethereumj-core/src/main/java/org/ethereum/facade/Ethereum.java +++ b/ethereumj-core/src/main/java/org/ethereum/facade/Ethereum.java @@ -2,6 +2,7 @@ package org.ethereum.facade; import org.ethereum.core.Block; import org.ethereum.listener.EthereumListener; +import org.ethereum.net.client.ClientPeer; import org.ethereum.net.client.PeerData; import java.net.InetAddress; @@ -24,10 +25,16 @@ public interface Ethereum { public void connect(String ip, int port); public Block getBlockByIndex(long index); + public long getBlockChainSize(); public void addListener(EthereumListener listener); public void loadBlockChain(); + + public ClientPeer getDefaultPeer(); + + public void close(); + } diff --git a/ethereumj-core/src/main/java/org/ethereum/facade/EthereumImpl.java b/ethereumj-core/src/main/java/org/ethereum/facade/EthereumImpl.java index f8b86fb1..a8f05cde 100644 --- a/ethereumj-core/src/main/java/org/ethereum/facade/EthereumImpl.java +++ b/ethereumj-core/src/main/java/org/ethereum/facade/EthereumImpl.java @@ -106,4 +106,24 @@ public class EthereumImpl implements Ethereum { public void loadBlockChain() { WorldManager.getInstance().loadBlockchain(); } + + + @Override + public void close() { + WorldManager.getInstance().close(); + } + + @Override + public ClientPeer getDefaultPeer(){ + + ClientPeer peer = WorldManager.getInstance().getActivePeer(); + if (peer == null){ + + peer = new ClientPeer(); + WorldManager.getInstance().setActivePeer(peer); + } + + return peer; + } + } diff --git a/ethereumj-core/src/main/java/org/ethereum/net/client/ClientPeer.java b/ethereumj-core/src/main/java/org/ethereum/net/client/ClientPeer.java index 67447eee..524fbf5b 100644 --- a/ethereumj-core/src/main/java/org/ethereum/net/client/ClientPeer.java +++ b/ethereumj-core/src/main/java/org/ethereum/net/client/ClientPeer.java @@ -106,6 +106,11 @@ public class ClientPeer { } } + public void setPeerListener(PeerListener peerListener) { + this.peerListener = peerListener; + } + + /* * The wire gets data for signed transactions and * sends it to the net. diff --git a/ethereumj-studio/pom.xml b/ethereumj-studio/pom.xml index ad6b197c..1520d400 100644 --- a/ethereumj-studio/pom.xml +++ b/ethereumj-studio/pom.xml @@ -51,6 +51,12 @@ bintray http://dl.bintray.com/ethereum/maven/ + + + mvn-central + maven + http://repo1.maven.org/maven2 + @@ -68,15 +74,13 @@ - org.ethereum ethereumj - 0.5.6.20140904.1950 + 0.5.6 jar - com.maxmind.geoip2 geoip2 diff --git a/ethereumj-studio/src/main/java/org/ethereum/gui/UIEthereumManager.java b/ethereumj-studio/src/main/java/org/ethereum/gui/UIEthereumManager.java new file mode 100644 index 00000000..f186835d --- /dev/null +++ b/ethereumj-studio/src/main/java/org/ethereum/gui/UIEthereumManager.java @@ -0,0 +1,15 @@ +package org.ethereum.gui; + +import org.ethereum.facade.Ethereum; +import org.ethereum.facade.EthereumImpl; + +/** + * www.ethereumJ.com + * + * @author: Roman Mandeleil + * Created on: 01/09/2014 19:43 + */ + +public class UIEthereumManager { + public static Ethereum ethereum = new EthereumImpl(); +}