From 1b5cd9862b22374571d703eaf50fd78691502f02 Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Mon, 19 May 2014 22:27:49 +0200 Subject: [PATCH] update readme --- README.md | 18 ++++- .../java/io/bitsquare/di/BitSquareModule.java | 66 ++----------------- .../bitsquare/gui/util/ConfidenceDisplay.java | 8 +-- 3 files changed, 24 insertions(+), 68 deletions(-) diff --git a/README.md b/README.md index 2f48d28cc6..c5022ff48c 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,13 @@ It is not at all production code style (no tests, verifications missing, very li The project use Java 8 and Maven. We use the bitcoinj library and TomP2P for DHT and messaging. +Test net is currently not working with bitcoinj as the DNS seed servers are not setup correctly (See: http://sourceforge.net/p/bitcoin/mailman/message/32349208/). +To use the RegTest mode you need to set regtest=1 in the bitcoin.config file inside the bitcoin data directory (https://en.bitcoin.it/wiki/Running_Bitcoin). +Then you can generate coins on demand with the Bitcoin qt client with that command in the console: setgenerate true 101 (101 only for the first start because the coin maturity of 100 blocks). +See: https://bitcoinj.github.io/testing +You can change the network mode in the guice module: BitSquareModule.java + + ### Implemented (prototype level): * Orderbook with filtering offers by amount, price, order type, trading account(buy, sell) * Create offer @@ -31,7 +38,7 @@ We use the bitcoinj library and TomP2P for DHT and messaging. * Start development of production version -### Screenshots of basic screens: +### Screenshots of basic the use cases: * [Registration screen 1](https://github.com/bitsquare/bitsquare/tree/master/screenshots/registration_3.png) * [Registration screen 2](https://github.com/bitsquare/bitsquare/tree/master/screenshots/registration_bank_account.png) * [Orderbook screen 1](https://github.com/bitsquare/bitsquare/tree/master/screenshots/orderbook1.png) @@ -44,6 +51,15 @@ We use the bitcoinj library and TomP2P for DHT and messaging. * [More screenshots](https://github.com/bitsquare/bitsquare/tree/master/screenshots) +### Transactions of a test trade on main net: +Offerer registration tx: https://blockchain.info/de/tx/06ea3c2a5fb79f622d3e3def7c6a20274274fcbf9ec69b95bdfe9b347bbbdf76 +Taker registration tx: https://blockchain.info/tx/8352ab9fe78593f48ef70d414d494ebd614d99fab147d0342910525e9284ba8f +Create offer fee tx: https://blockchain.info/tx/24f4d229edace44d9123628363a16cd7041f5d34ba6bef812807b9be03a64692 +Take offer fee tx: https://blockchain.info/tx/06ea3c2a5fb79f622d3e3def7c6a20274274fcbf9ec69b95bdfe9b347bbbdf76 +Deposit tx: https://blockchain.info/de/tx/98c6ae55963022871216a6a124c1e1ed7f6308560e76b72617b6b54cf50ef412 +Payout tx: https://blockchain.info/tx/498e2c299ca991b27f61b63fb6ee457819ee9e33ee5a1d250fde47eb15199adc + + ### Links: * Web: http://bitsquare.io * Whitepaper: https://docs.google.com/document/d/1d3EiWZdaM89-P6MVhS53unXv2-pDpSFsN3W4kCGXKgY/edit?pli=1 diff --git a/src/main/java/io/bitsquare/di/BitSquareModule.java b/src/main/java/io/bitsquare/di/BitSquareModule.java index cafc23c0e9..b06001ceab 100644 --- a/src/main/java/io/bitsquare/di/BitSquareModule.java +++ b/src/main/java/io/bitsquare/di/BitSquareModule.java @@ -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 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 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; - } -} diff --git a/src/main/java/io/bitsquare/gui/util/ConfidenceDisplay.java b/src/main/java/io/bitsquare/gui/util/ConfidenceDisplay.java index 3ebb777761..3c2b65352d 100644 --- a/src/main/java/io/bitsquare/gui/util/ConfidenceDisplay.java +++ b/src/main/java/io/bitsquare/gui/util/ConfidenceDisplay.java @@ -162,8 +162,7 @@ public class ConfidenceDisplay public void destroy() { - boolean wasInList = wallet.removeEventListener(walletEventListener); - log.trace("ConfidenceDisplay.destroy wasInList = " + wasInList); + wallet.removeEventListener(walletEventListener); progressIndicator.setProgress(0); confirmationLabel.setText(""); if (balanceTextField != null) @@ -211,12 +210,7 @@ public class ConfidenceDisplay private void updateConfidence(Transaction tx) { - log.debug("updateConfidence: " + this.toString()); - log.debug("tx: " + tx.getHashAsString()); TransactionConfidence confidence = tx.getConfidence(); - log.debug("ConfidenceType: " + confidence.getConfidenceType().toString()); - log.debug("numBroadcastPeers: " + confidence.numBroadcastPeers()); - log.debug("getDepthInBlocks: " + confidence.getDepthInBlocks()); double progressIndicatorSize = 50; switch (confidence.getConfidenceType()) {