Some cleaning
This commit is contained in:
parent
92f2c29f69
commit
25506f3813
|
@ -81,29 +81,13 @@ ext {
|
|||
dependencies {
|
||||
apt 'com.google.dagger:dagger-compiler:2.0'
|
||||
compile 'com.google.dagger:dagger:2.0'
|
||||
//compile 'com.android.support:appcompat-v7:+'
|
||||
compile fileTree(include: ['*.jar'], dir: 'libs')
|
||||
provided 'javax.annotation:javax.annotation-api:1.2'
|
||||
compile 'com.j256.ormlite:ormlite-core:4.48'
|
||||
compile('com.j256.ormlite:ormlite-android:4.48') {
|
||||
exclude group: 'commons-logging', module: 'commons-logging'
|
||||
}
|
||||
/*
|
||||
compile('com.j256.ormlite:ormlite-jdbc:4.48') {
|
||||
exclude group: 'commons-logging', module: 'commons-logging'
|
||||
}
|
||||
*/
|
||||
//compile(name:'android-leveldb', ext:'aar')
|
||||
//compile 'com.snappydb:snappydb-lib:0.5.0'
|
||||
//compile files('./libs/android.jar')
|
||||
|
||||
//compile files('./libs/commons-io-2.4.jar')
|
||||
|
||||
//compile files('./libs/robospring-1.0.7.jar')
|
||||
|
||||
//compile "com.octo.android.robospice:robospice-spring-android:1.4.14"
|
||||
|
||||
//compile 'com.octo.android.robospice:robospice-ormlite:1.4.14'
|
||||
compile('io.netty:netty-all:4.1.0.Beta5') {
|
||||
exclude group: 'commons-logging', module: 'commons-logging'
|
||||
}
|
||||
|
@ -114,8 +98,6 @@ dependencies {
|
|||
|
||||
compile "org.iq80.leveldb:leveldb:${leveldbVersion}"
|
||||
|
||||
//compile "im.amomo.leveldb:leveldb:1.0.1"
|
||||
//compile 'com.google.guava:guava:18.0'
|
||||
compile('com.cedarsoftware:java-util:1.8.0') {
|
||||
exclude group: 'commons-logging', module: 'commons-logging'
|
||||
}
|
||||
|
@ -123,48 +105,22 @@ dependencies {
|
|||
|
||||
//compile 'org.antlr:antlr4-runtime:4.5'
|
||||
|
||||
|
||||
// for serpent compilation
|
||||
|
||||
compile 'com.yuvalshavit:antlr-denter:1.1'
|
||||
|
||||
//compile 'org.javassist:javassist:3.15.0-GA'
|
||||
compile 'org.slf4j:slf4j-android:1.7.12'
|
||||
compile 'de.mindpipe.android:android-logging-log4j:1.0.3'
|
||||
//compile "org.slf4j:slf4j-api:${slf4jVersion}"
|
||||
|
||||
//compile "log4j:log4j:${log4jVersion}"
|
||||
compile 'org.slf4j:slf4j-android:1.7.12'
|
||||
|
||||
compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13'
|
||||
compile 'com.google.code.findbugs:jsr305:3.0.0'
|
||||
compile 'com.fasterxml.jackson.core:jackson-databind:2.2.0'
|
||||
compile 'org.apache.commons:commons-collections4:4.0'
|
||||
//compile 'commons-codec:commons-codec:1.10'
|
||||
compile 'org.hsqldb:hsqldb:1.8.0.10' // best performance - do not upgrade!
|
||||
|
||||
// compile "org.springframework:spring-context:${springVersion}"
|
||||
|
||||
//compile "org.springframework:spring-tx:${springVersion}"
|
||||
|
||||
//compile "org.springframework:spring-orm:${springVersion}"
|
||||
compile 'org.hsqldb:hsqldb:1.8.0.10'
|
||||
// best performance - do not upgrade!
|
||||
compile 'javax.el:javax.el-api:2.2.4'
|
||||
compile 'org.glassfish.web:javax.el:2.2.4'
|
||||
/*
|
||||
compile("org.hibernate:hibernate-core:${hibernateVersion}") {
|
||||
exclude group: 'dom4j', module: 'dom4j'
|
||||
exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.2_spec'
|
||||
}
|
||||
compile("org.hibernate:hibernate-entitymanager:${hibernateVersion}") {
|
||||
exclude group: 'dom4j', module: 'dom4j'
|
||||
exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.2_spec'
|
||||
}
|
||||
*/
|
||||
compile 'javax.persistence:persistence-api:1.0.2'
|
||||
//compile ('commons-dbcp:commons-dbcp:1.4') {
|
||||
|
||||
// exclude group: 'commons-logging', module: 'commons-logging'
|
||||
|
||||
// }
|
||||
compile('redis.clients:jedis:2.6.0') {
|
||||
exclude group: 'org.apache.commons', module: 'commons-pool2'
|
||||
}
|
||||
|
@ -172,12 +128,7 @@ dependencies {
|
|||
exclude group: 'junit', module: 'junit'
|
||||
exclude group: 'xml-apis', module: 'xml-apis'
|
||||
}
|
||||
//optional "org.slf4j:jcl-over-slf4j:${slf4jVersion}"
|
||||
|
||||
//optional "de.mindpipe.android:android-logging-log4j:1.0.2"
|
||||
|
||||
//optional "log4j:apache-log4j-extras:${log4jVersion}"
|
||||
testCompile "junit:junit:${junitVersion}"
|
||||
//testCompile "org.springframework:spring-test:${springVersion}"
|
||||
|
||||
}
|
||||
|
|
|
@ -2,13 +2,8 @@ package org.ethereum.core;
|
|||
|
||||
import org.ethereum.crypto.ECKey;
|
||||
import org.ethereum.facade.Repository;
|
||||
import org.ethereum.manager.WorldManager;
|
||||
import org.ethereum.util.Utils;
|
||||
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.context.annotation.Scope;
|
||||
//import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
@ -21,8 +16,6 @@ import javax.inject.Inject;
|
|||
/**
|
||||
* Representation of an actual account or contract
|
||||
*/
|
||||
//@Component
|
||||
//@Scope("prototype")
|
||||
public class Account {
|
||||
|
||||
private ECKey ecKey;
|
||||
|
|
|
@ -3,7 +3,6 @@ package org.ethereum.core;
|
|||
import org.ethereum.config.Constants;
|
||||
import org.ethereum.crypto.HashUtil;
|
||||
import org.ethereum.db.BlockStore;
|
||||
import org.ethereum.db.RepositoryImpl;
|
||||
import org.ethereum.facade.Blockchain;
|
||||
import org.ethereum.facade.Repository;
|
||||
import org.ethereum.listener.EthereumListener;
|
||||
|
@ -18,10 +17,6 @@ import org.ethereum.vm.ProgramInvokeFactoryImpl;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.spongycastle.util.encoders.Hex;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.beans.factory.annotation.Qualifier;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//import org.springframework.util.FileSystemUtils;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
@ -34,7 +29,7 @@ import java.math.BigDecimal;
|
|||
import java.util.*;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Qualifier;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import static org.ethereum.config.Constants.*;
|
||||
import static org.ethereum.config.SystemProperties.CONFIG;
|
||||
|
@ -72,7 +67,7 @@ import static org.ethereum.core.ImportResult.SUCCESS;
|
|||
* @author Nick Savers
|
||||
* @since 20.05.2014
|
||||
*/
|
||||
//@Component
|
||||
@Singleton
|
||||
public class BlockchainImpl implements Blockchain {
|
||||
|
||||
|
||||
|
@ -83,7 +78,6 @@ public class BlockchainImpl implements Blockchain {
|
|||
private static final long INITIAL_MIN_GAS_PRICE = 10 * SZABO.longValue();
|
||||
|
||||
@Resource
|
||||
//@Qualifier("pendingTransactions")
|
||||
private Set<Transaction> pendingTransactions = new HashSet<>();
|
||||
|
||||
private Repository repository;
|
||||
|
|
|
@ -3,7 +3,6 @@ package org.ethereum.core;
|
|||
import org.ethereum.crypto.ECKey;
|
||||
import org.ethereum.db.ByteArrayWrapper;
|
||||
import org.ethereum.facade.Repository;
|
||||
import org.ethereum.manager.WorldManager;
|
||||
import org.ethereum.net.submit.WalletTransaction;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
|
@ -11,11 +10,6 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
import org.spongycastle.util.encoders.Hex;
|
||||
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.context.ApplicationContext;
|
||||
//import org.springframework.context.annotation.DependsOn;
|
||||
//import org.springframework.stereotype.Component;
|
||||
|
||||
import org.w3c.dom.Attr;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
@ -36,7 +30,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import javax.inject.Provider;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
@ -47,13 +41,14 @@ import javax.xml.transform.dom.DOMSource;
|
|||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Provider;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
/**
|
||||
* The Wallet handles the management of accounts with addresses and private keys.
|
||||
* New accounts can be generated and added to the wallet and existing accounts can be queried.
|
||||
*/
|
||||
//@Component
|
||||
//@DependsOn("worldManager")
|
||||
@Singleton
|
||||
public class Wallet {
|
||||
|
||||
private Logger logger = LoggerFactory.getLogger("wallet");
|
||||
|
|
|
@ -3,7 +3,6 @@ package org.ethereum.db;
|
|||
import org.ethereum.core.AccountState;
|
||||
import org.ethereum.core.Block;
|
||||
import org.ethereum.datasource.KeyValueDataSource;
|
||||
import org.ethereum.datasource.HashMapDB;
|
||||
import org.ethereum.facade.Repository;
|
||||
import org.ethereum.json.EtherObjectMapper;
|
||||
import org.ethereum.json.JSONHelper;
|
||||
|
@ -21,7 +20,6 @@ import org.slf4j.LoggerFactory;
|
|||
import org.spongycastle.util.encoders.Hex;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
//import org.springframework.util.FileSystemUtils;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
|
|
|
@ -141,7 +141,7 @@ public class EthereumModule {
|
|||
|
||||
@Provides
|
||||
MessageCodec provideMessageCodec(EthereumListener listener) {
|
||||
return new MessageCodec();
|
||||
return new MessageCodec(listener);
|
||||
}
|
||||
|
||||
@Provides
|
||||
|
|
|
@ -6,31 +6,28 @@ import org.ethereum.net.shh.ShhHandler;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
//import org.springframework.context.ApplicationContext;
|
||||
//import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
//import org.springframework.stereotype.Component;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
|
||||
/**
|
||||
* @author Roman Mandeleil
|
||||
* @since 13.11.2014
|
||||
*/
|
||||
//@Component
|
||||
@Singleton
|
||||
public class EthereumFactory {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger("general");
|
||||
//public static ApplicationContext context = null;
|
||||
|
||||
public static Ethereum createEthereum() {
|
||||
return createEthereum(DefaultConfig.class);
|
||||
}
|
||||
|
||||
|
||||
public static Ethereum createEthereum(Class clazz) {
|
||||
|
||||
logger.info("capability eth version: [{}]", EthHandler.VERSION);
|
||||
logger.info("capability shh version: [{}]", ShhHandler.VERSION);
|
||||
|
||||
// context = new AnnotationConfigApplicationContext(clazz);
|
||||
return null;//context.getBean(Ethereum.class);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -15,11 +15,7 @@ import org.ethereum.net.submit.TransactionTask;
|
|||
import org.ethereum.util.ByteUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.context.ApplicationContext;
|
||||
//import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.math.BigInteger;
|
||||
import java.net.InetAddress;
|
||||
import java.util.HashSet;
|
||||
|
@ -29,6 +25,7 @@ import java.util.concurrent.Future;
|
|||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Provider;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import static org.ethereum.config.SystemProperties.CONFIG;
|
||||
|
||||
|
@ -36,7 +33,7 @@ import static org.ethereum.config.SystemProperties.CONFIG;
|
|||
* @author Roman Mandeleil
|
||||
* @since 27.07.2014
|
||||
*/
|
||||
//@Component
|
||||
@Singleton
|
||||
public class EthereumImpl implements Ethereum {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger("facade");
|
||||
|
@ -49,7 +46,6 @@ public class EthereumImpl implements Ethereum {
|
|||
|
||||
ChannelManager channelManager;
|
||||
|
||||
|
||||
PeerServer peerServer;
|
||||
|
||||
BlockLoader blockLoader;
|
||||
|
@ -72,7 +68,6 @@ public class EthereumImpl implements Ethereum {
|
|||
this.init();
|
||||
}
|
||||
|
||||
//@PostConstruct
|
||||
public void init() {
|
||||
worldManager.loadBlockchain();
|
||||
if (CONFIG.listenPort() > 0) {
|
||||
|
|
|
@ -6,17 +6,17 @@ import org.ethereum.core.TransactionReceipt;
|
|||
import org.ethereum.net.message.Message;
|
||||
import org.ethereum.net.p2p.HelloMessage;
|
||||
|
||||
//import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
/**
|
||||
* @author Roman Mandeleil
|
||||
* @since 12.11.2014
|
||||
*/
|
||||
//@Component(value = "EthereumListener")
|
||||
@Singleton
|
||||
public class CompositeEthereumListener implements EthereumListener {
|
||||
|
||||
List<EthereumListener> listeners = new ArrayList<>();
|
||||
|
|
|
@ -6,7 +6,6 @@ import org.ethereum.core.TransactionReceipt;
|
|||
import org.ethereum.net.message.Message;
|
||||
import org.ethereum.net.p2p.HelloMessage;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
package org.ethereum.manager;
|
||||
|
||||
//import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
/**
|
||||
* @author Roman Mandeleil
|
||||
* @since 11.12.2014
|
||||
*/
|
||||
//@Component
|
||||
@Singleton
|
||||
public class AdminInfo {
|
||||
|
||||
|
||||
|
@ -23,7 +22,6 @@ public class AdminInfo {
|
|||
this.init();
|
||||
}
|
||||
|
||||
//@PostConstruct
|
||||
public void init() {
|
||||
startupTimeStamp = System.currentTimeMillis();
|
||||
}
|
||||
|
|
|
@ -4,21 +4,17 @@ package org.ethereum.manager;
|
|||
import org.ethereum.core.Block;
|
||||
import org.ethereum.facade.Blockchain;
|
||||
import org.spongycastle.util.encoders.Hex;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.List;
|
||||
import java.util.Scanner;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import static org.ethereum.config.SystemProperties.CONFIG;
|
||||
|
||||
//@Component
|
||||
@Singleton
|
||||
public class BlockLoader {
|
||||
|
||||
private Blockchain blockchain;
|
||||
|
|
|
@ -17,22 +17,15 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
import org.spongycastle.util.encoders.Hex;
|
||||
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static org.ethereum.config.SystemProperties.CONFIG;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.PreDestroy;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
/**
|
||||
* WorldManager is a singleton containing references to different parts of the system.
|
||||
|
@ -40,7 +33,7 @@ import javax.inject.Inject;
|
|||
* @author Roman Mandeleil
|
||||
* @since 01.06.2014
|
||||
*/
|
||||
//@Component
|
||||
@Singleton
|
||||
public class WorldManager {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger("general");
|
||||
|
@ -80,7 +73,6 @@ public class WorldManager {
|
|||
this.init();
|
||||
}
|
||||
|
||||
//@PostConstruct
|
||||
public void init() {
|
||||
byte[] cowAddr = HashUtil.sha3("cow".getBytes());
|
||||
wallet.importKey(cowAddr);
|
||||
|
|
|
@ -7,15 +7,13 @@ import org.ethereum.facade.Blockchain;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.spongycastle.util.encoders.Hex;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.PriorityBlockingQueue;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import static java.lang.Thread.sleep;
|
||||
import static org.ethereum.config.SystemProperties.CONFIG;
|
||||
|
@ -30,7 +28,7 @@ import static org.ethereum.core.ImportResult.SUCCESS;
|
|||
* @author Roman Mandeleil
|
||||
* @since 27.07.2014
|
||||
*/
|
||||
//@Component
|
||||
@Singleton
|
||||
public class BlockQueue {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger("blockqueue");
|
||||
|
@ -60,6 +58,7 @@ public class BlockQueue {
|
|||
|
||||
Blockchain blockchain;
|
||||
|
||||
@Inject
|
||||
public BlockQueue(Blockchain blockchain) {
|
||||
|
||||
this.blockchain = blockchain;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package org.ethereum.net;
|
||||
|
||||
import org.ethereum.listener.EthereumListener;
|
||||
import org.ethereum.manager.WorldManager;
|
||||
import org.ethereum.net.message.Message;
|
||||
import org.ethereum.net.p2p.PingMessage;
|
||||
|
||||
|
@ -10,10 +9,6 @@ import io.netty.channel.ChannelHandlerContext;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.context.annotation.Scope;
|
||||
//import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Queue;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
@ -38,8 +33,6 @@ import static org.ethereum.net.message.StaticMessages.DISCONNECT_MESSAGE;
|
|||
*
|
||||
* @author Roman Mandeleil
|
||||
*/
|
||||
//@Component
|
||||
//@Scope("prototype")
|
||||
public class MessageQueue {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger("net");
|
||||
|
@ -50,7 +43,8 @@ public class MessageQueue {
|
|||
|
||||
EthereumListener listener;
|
||||
boolean hasPing = false;
|
||||
|
||||
|
||||
@Inject
|
||||
public MessageQueue(EthereumListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package org.ethereum.net.client;
|
||||
|
||||
import org.ethereum.listener.EthereumListener;
|
||||
import org.ethereum.manager.WorldManager;
|
||||
import org.ethereum.net.server.ChannelManager;
|
||||
import org.ethereum.net.server.EthereumChannelInitializer;
|
||||
|
||||
|
@ -19,11 +18,6 @@ import org.slf4j.LoggerFactory;
|
|||
import javax.inject.Inject;
|
||||
import javax.inject.Provider;
|
||||
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.context.ApplicationContext;
|
||||
//import org.springframework.context.annotation.Scope;
|
||||
//import org.springframework.stereotype.Component;
|
||||
|
||||
import static org.ethereum.config.SystemProperties.CONFIG;
|
||||
|
||||
/**
|
||||
|
@ -31,8 +25,6 @@ import static org.ethereum.config.SystemProperties.CONFIG;
|
|||
*
|
||||
* @see <a href="http://netty.io">http://netty.io</a>
|
||||
*/
|
||||
//@Component
|
||||
//@Scope("prototype")
|
||||
public class PeerClient {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger("net");
|
||||
|
|
|
@ -7,7 +7,6 @@ import org.ethereum.core.Wallet;
|
|||
import org.ethereum.db.ByteArrayWrapper;
|
||||
import org.ethereum.facade.Blockchain;
|
||||
import org.ethereum.listener.EthereumListener;
|
||||
import org.ethereum.manager.WorldManager;
|
||||
import org.ethereum.net.BlockQueue;
|
||||
import org.ethereum.net.MessageQueue;
|
||||
import org.ethereum.net.message.ReasonCode;
|
||||
|
@ -21,10 +20,6 @@ import io.netty.channel.SimpleChannelInboundHandler;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.context.annotation.Scope;
|
||||
//import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
import java.util.*;
|
||||
|
@ -49,8 +44,6 @@ import static org.ethereum.util.ByteUtil.wrap;
|
|||
* <li>BLOCKS : Send a list of blocks</li>
|
||||
* </ul>
|
||||
*/
|
||||
//@Component
|
||||
//@Scope("prototype")
|
||||
public class EthHandler extends SimpleChannelInboundHandler<EthMessage> {
|
||||
|
||||
public final static byte VERSION = 60;
|
||||
|
|
|
@ -8,8 +8,6 @@ import org.ethereum.util.RLPList;
|
|||
|
||||
import com.google.common.base.Joiner;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.spongycastle.util.encoders.Hex;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -29,9 +27,6 @@ public class HelloMessage extends P2pMessage {
|
|||
* The implemented version of the P2P protocol.
|
||||
*/
|
||||
private byte p2pVersion;
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger("net");
|
||||
|
||||
/**
|
||||
* The underlying client. A user-readable string.
|
||||
*/
|
||||
|
@ -62,11 +57,9 @@ public class HelloMessage extends P2pMessage {
|
|||
this.listenPort = listenPort;
|
||||
this.peerId = peerId;
|
||||
this.parsed = true;
|
||||
logger.info("Hello Message");
|
||||
}
|
||||
|
||||
private void parse() {
|
||||
logger.info("Hello message parse");
|
||||
RLPList paramsList = (RLPList) RLP.decode2(encoded).get(0);
|
||||
|
||||
byte[] p2pVersionBytes = paramsList.get(0).getRLPData();
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
package org.ethereum.net.p2p;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import org.ethereum.core.Block;
|
||||
import org.ethereum.core.Transaction;
|
||||
import org.ethereum.listener.EthereumListener;
|
||||
import org.ethereum.manager.WorldManager;
|
||||
import org.ethereum.net.MessageQueue;
|
||||
import org.ethereum.net.client.Capability;
|
||||
import org.ethereum.net.eth.EthHandler;
|
||||
|
@ -15,7 +13,6 @@ import org.ethereum.net.message.ReasonCode;
|
|||
import org.ethereum.net.message.StaticMessages;
|
||||
import org.ethereum.net.peerdiscovery.PeerDiscovery;
|
||||
import org.ethereum.net.peerdiscovery.PeerInfo;
|
||||
import org.ethereum.net.rlpx.FrameCodec;
|
||||
import org.ethereum.net.server.Channel;
|
||||
import org.ethereum.net.shh.ShhHandler;
|
||||
import org.ethereum.net.shh.ShhMessageCodes;
|
||||
|
@ -26,12 +23,6 @@ import io.netty.channel.SimpleChannelInboundHandler;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.spongycastle.util.encoders.Hex;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.context.annotation.Scope;
|
||||
//import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.InetSocketAddress;
|
||||
|
||||
|
@ -60,8 +51,6 @@ import static org.ethereum.net.message.StaticMessages.*;
|
|||
* <li>PONG : Confirm that they themselves are still alive</li>
|
||||
* </ul>
|
||||
*/
|
||||
//@Component
|
||||
//@Scope("prototype")
|
||||
public class P2pHandler extends SimpleChannelInboundHandler<P2pMessage> {
|
||||
|
||||
public final static byte VERSION = 4;
|
||||
|
|
|
@ -7,7 +7,6 @@ import io.netty.channel.socket.nio.NioSocketChannel;
|
|||
import io.netty.handler.timeout.ReadTimeoutHandler;
|
||||
|
||||
import org.ethereum.listener.EthereumListener;
|
||||
import org.ethereum.manager.WorldManager;
|
||||
import org.ethereum.net.MessageQueue;
|
||||
import org.ethereum.net.client.Capability;
|
||||
import org.ethereum.net.eth.EthHandler;
|
||||
|
@ -18,10 +17,6 @@ import org.ethereum.net.shh.ShhHandler;
|
|||
import org.ethereum.net.wire.MessageCodec;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.context.ApplicationContext;
|
||||
//import org.springframework.context.annotation.Scope;
|
||||
//import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
@ -35,8 +30,6 @@ import static org.ethereum.config.SystemProperties.CONFIG;
|
|||
*
|
||||
* @see <a href="http://netty.io">http://netty.io</a>
|
||||
*/
|
||||
//@Component
|
||||
//@Scope("prototype")
|
||||
public class DiscoveryChannel {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger("net");
|
||||
|
|
|
@ -5,10 +5,6 @@ import org.ethereum.net.p2p.Peer;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.context.ApplicationContext;
|
||||
//import org.springframework.stereotype.Component;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
|
@ -30,6 +26,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Provider;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import static org.ethereum.config.SystemProperties.CONFIG;
|
||||
|
||||
|
@ -37,7 +34,7 @@ import static org.ethereum.config.SystemProperties.CONFIG;
|
|||
* @author Roman Mandeleil
|
||||
* @since 22.05.2014
|
||||
*/
|
||||
//@Component
|
||||
@Singleton
|
||||
public class PeerDiscovery {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger("peerdiscovery");
|
||||
|
|
|
@ -3,11 +3,6 @@ package org.ethereum.net.peerdiscovery;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.context.ApplicationContext;
|
||||
//import org.springframework.context.annotation.Scope;
|
||||
//import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
@ -17,8 +12,6 @@ import javax.inject.Provider;
|
|||
* @author Roman Mandeleil
|
||||
* @since 22.05.2014
|
||||
*/
|
||||
//@Component
|
||||
//@Scope("prototype")
|
||||
public class WorkerThread implements Runnable {
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger("peerdiscovery");
|
||||
|
|
|
@ -14,9 +14,6 @@ import org.ethereum.net.shh.ShhHandler;
|
|||
import org.ethereum.net.wire.MessageCodec;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.context.annotation.Scope;
|
||||
//import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigInteger;
|
||||
|
@ -30,8 +27,6 @@ import static org.ethereum.net.message.StaticMessages.HELLO_MESSAGE;
|
|||
* @author Roman Mandeleil
|
||||
* @since 01.11.2014
|
||||
*/
|
||||
//@Component
|
||||
//@Scope("prototype")
|
||||
public class Channel {
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger("net");
|
||||
|
|
|
@ -4,13 +4,10 @@ import org.ethereum.core.Block;
|
|||
import org.ethereum.core.Transaction;
|
||||
import org.ethereum.db.ByteArrayWrapper;
|
||||
import org.ethereum.listener.EthereumListener;
|
||||
import org.ethereum.manager.WorldManager;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
@ -21,14 +18,14 @@ import java.util.Map;
|
|||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
/**
|
||||
* @author Roman Mandeleil
|
||||
* @since 11.11.2014
|
||||
*/
|
||||
//@Component
|
||||
@Singleton
|
||||
public class ChannelManager {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger("net");
|
||||
|
|
|
@ -8,10 +8,6 @@ import io.netty.handler.timeout.ReadTimeoutHandler;
|
|||
import org.ethereum.facade.Blockchain;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.context.ApplicationContext;
|
||||
//import org.springframework.context.annotation.Scope;
|
||||
//import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
@ -23,8 +19,6 @@ import static org.ethereum.config.SystemProperties.CONFIG;
|
|||
* @author Roman Mandeleil
|
||||
* @since 01.11.2014
|
||||
*/
|
||||
//@Component
|
||||
//@Scope("prototype")
|
||||
public class EthereumChannelInitializer extends ChannelInitializer<NioSocketChannel> {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger("net");
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package org.ethereum.net.server;
|
||||
|
||||
import org.ethereum.listener.EthereumListener;
|
||||
import org.ethereum.manager.WorldManager;
|
||||
|
||||
import io.netty.bootstrap.ServerBootstrap;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
|
@ -15,9 +14,8 @@ import io.netty.handler.logging.LoggingHandler;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.stereotype.Component;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import static org.ethereum.config.SystemProperties.CONFIG;
|
||||
|
||||
|
@ -28,7 +26,7 @@ import static org.ethereum.config.SystemProperties.CONFIG;
|
|||
* @author Roman Mandeleil
|
||||
* @since 01.11.2014
|
||||
*/
|
||||
//@Component
|
||||
@Singleton
|
||||
public class PeerServer {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger("net");
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package org.ethereum.net.shh;
|
||||
|
||||
import org.ethereum.listener.EthereumListener;
|
||||
import org.ethereum.manager.WorldManager;
|
||||
import org.ethereum.net.MessageQueue;
|
||||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
|
@ -12,17 +11,11 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
import javax.inject.Inject;
|
||||
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.context.annotation.Scope;
|
||||
//import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* Process the messages between peers with 'shh' capability on the network.
|
||||
*
|
||||
* Peers with 'shh' capability can send/receive:
|
||||
*/
|
||||
//@Component
|
||||
//@Scope("prototype")
|
||||
public class ShhHandler extends SimpleChannelInboundHandler<ShhMessage> {
|
||||
|
||||
public final static byte VERSION = 1;
|
||||
|
|
|
@ -8,7 +8,6 @@ import io.netty.handler.codec.ByteToMessageCodec;
|
|||
import org.ethereum.crypto.ECIESCoder;
|
||||
import org.ethereum.crypto.ECKey;
|
||||
import org.ethereum.listener.EthereumListener;
|
||||
import org.ethereum.manager.WorldManager;
|
||||
import org.ethereum.net.eth.EthMessageCodes;
|
||||
import org.ethereum.net.message.Message;
|
||||
import org.ethereum.net.message.MessageFactory;
|
||||
|
@ -21,9 +20,6 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
import org.spongycastle.math.ec.ECPoint;
|
||||
import org.spongycastle.util.encoders.Hex;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.context.annotation.Scope;
|
||||
//import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
@ -35,8 +31,6 @@ import static org.ethereum.net.rlpx.FrameCodec.Frame;
|
|||
/**
|
||||
* The PacketDecoder parses every valid Ethereum packet to a Message object
|
||||
*/
|
||||
//@Component
|
||||
//@Scope("prototype")
|
||||
public class MessageCodec extends ByteToMessageCodec<Message> {
|
||||
|
||||
private static final Logger loggerWire = LoggerFactory.getLogger("wire");
|
||||
|
@ -82,7 +76,7 @@ public class MessageCodec extends ByteToMessageCodec<Message> {
|
|||
super.userEventTriggered(ctx, evt);
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
||||
EthereumListener listener;
|
||||
|
||||
@Inject
|
||||
|
@ -90,7 +84,6 @@ public class MessageCodec extends ByteToMessageCodec<Message> {
|
|||
super();
|
||||
this.listener = listener;
|
||||
}
|
||||
*/
|
||||
@Override
|
||||
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
|
||||
if (!isHandshakeDone)
|
||||
|
|
|
@ -21,7 +21,6 @@ import static java.lang.System.getProperty;
|
|||
import static org.ethereum.config.SystemProperties.CONFIG;
|
||||
import static org.ethereum.util.BIUtil.*;
|
||||
import static org.ethereum.util.ByteUtil.EMPTY_BYTE_ARRAY;
|
||||
//import static org.springframework.util.StringUtils.isEmpty;
|
||||
|
||||
/**
|
||||
* @author Roman Mandeleil
|
||||
|
|
Loading…
Reference in New Issue