update readme

This commit is contained in:
Manfred Karrer 2014-05-19 22:27:49 +02:00
parent 005cca4314
commit 1b5cd9862b
3 changed files with 24 additions and 68 deletions

View file

@ -2,10 +2,10 @@ package io.bitsquare.di;
import com.google.bitcoin.core.NetworkParameters;
import com.google.bitcoin.core.Utils;
import com.google.bitcoin.kits.WalletAppKit;
import com.google.bitcoin.params.MainNetParams;
import com.google.bitcoin.params.RegTestParams;
import com.google.bitcoin.params.TestNet3Params;
import com.google.inject.AbstractModule;
import com.google.inject.Inject;
import com.google.inject.Provider;
@ -22,12 +22,9 @@ import io.bitsquare.trade.orderbook.OrderBook;
import io.bitsquare.trade.orderbook.OrderBookFilter;
import io.bitsquare.user.User;
import io.bitsquare.util.Utilities;
import org.spongycastle.util.encoders.Hex;
import java.io.File;
import static com.google.common.base.Preconditions.checkState;
public class BitSquareModule extends AbstractModule
{
@ -47,9 +44,11 @@ public class BitSquareModule extends AbstractModule
bind(Trading.class).asEagerSingleton();
// bind(String.class).annotatedWith(Names.named("networkType")).toInstance(WalletFacade.MAIN_NET);
//bind(String.class).annotatedWith(Names.named("networkType")).toInstance(WalletFacade.MAIN_NET);
// how to use reg test see description in the readme file
bind(String.class).annotatedWith(Names.named("networkType")).toInstance(WalletFacade.REG_TEST_NET);
// bind(String.class).annotatedWith(Names.named("networkType")).toInstance(WalletFacade.TEST_NET);
//test net not working yet: http://sourceforge.net/p/bitcoin/mailman/message/32349208/
//bind(String.class).annotatedWith(Names.named("networkType")).toInstance(WalletFacade.TEST_NET);
bind(NetworkParameters.class).toProvider(NetworkParametersProvider.class).asEagerSingleton();
bind(WalletAppKit.class).toProvider(WalletAppKitProvider.class).asEagerSingleton();
}
@ -91,7 +90,7 @@ class NetworkParametersProvider implements Provider<NetworkParameters>
result = MainNetParams.get();
break;
case WalletFacade.TEST_NET:
result = TestNet3Params2.get();
result = TestNet3Params.get();
break;
case WalletFacade.REG_TEST_NET:
result = RegTestParams.get();
@ -100,56 +99,3 @@ class NetworkParametersProvider implements Provider<NetworkParameters>
return result;
}
}
/**
* UnknownHostException with testnet-seed.bitcoin.petertodd.org so use testnet-seed.bluematt.me as primary DND seed server
* testnet-seed.bluematt.me delivers 1 dead node, so nothing works yet... ;-(
* http://sourceforge.net/p/bitcoin/mailman/message/32349208/
*/
class TestNet3Params2 extends NetworkParameters
{
public TestNet3Params2()
{
super();
id = ID_TESTNET;
// Genesis hash is 000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943
packetMagic = 0x0b110907;
interval = INTERVAL;
targetTimespan = TARGET_TIMESPAN;
proofOfWorkLimit = Utils.decodeCompactBits(0x1d00ffffL);
port = 18333;
addressHeader = 111;
p2shHeader = 196;
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
dumpedPrivateKeyHeader = 239;
genesisBlock.setTime(1296688602L);
genesisBlock.setDifficultyTarget(0x1d00ffffL);
genesisBlock.setNonce(414098458);
spendableCoinbaseDepth = 100;
subsidyDecreaseBlockCount = 210000;
String genesisHash = genesisBlock.getHashAsString();
checkState(genesisHash.equals("000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943"));
alertSigningKey = Hex.decode("04302390343f91cc401d56d68b123028bf52e5fca1939df127f63c6467cdf9c8e2c14b61104cf817d0b780da337893ecc4aaff1309e536162dabbdb45200ca2b0a");
dnsSeeds = new String[]{
"testnet-seed.bluematt.me"
};
}
private static TestNet3Params2 instance;
public static synchronized TestNet3Params2 get()
{
if (instance == null)
{
instance = new TestNet3Params2();
}
return instance;
}
public String getPaymentProtocolId()
{
return PAYMENT_PROTOCOL_ID_TESTNET;
}
}