Adapting for Ethereym as a library style:

+ BlockChain screen adapted
  + ConnectionConsole screen adapted
  + ToolBar Screen adapted
This commit is contained in:
romanman 2014-09-04 21:39:47 +03:00
parent 7f3c44e514
commit d2c29c07f3
6 changed files with 54 additions and 5 deletions

View File

@ -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
-->
<developers>

View File

@ -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();
}

View File

@ -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;
}
}

View File

@ -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.

View File

@ -51,6 +51,12 @@
<name>bintray</name>
<url>http://dl.bintray.com/ethereum/maven/</url>
</repository>
<repository>
<id>mvn-central</id>
<name>maven</name>
<url> http://repo1.maven.org/maven2</url>
</repository>
</repositories>
@ -68,15 +74,13 @@
<dependencies>
<dependency>
<groupId>org.ethereum</groupId>
<artifactId>ethereumj</artifactId>
<version>0.5.6.20140904.1950</version>
<version>0.5.6</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.maxmind.geoip2</groupId>
<artifactId>geoip2</artifactId>

View File

@ -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();
}