diff --git a/LICENSE.md b/LICENSE.md index a7a0f2d..d1334da 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 +Copyright (c) 2015-2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/jminer.default.properties b/jminer.default.properties index 2e2599f..88d7475 100644 --- a/jminer.default.properties +++ b/jminer.default.properties @@ -1,22 +1,31 @@ # ----------------------------------------------------------------------------------- -# - BURST JMINER ------------- THIS IS EXPERIMENTAL SOFTWARE, USE ON YOUR OWN RISK! - +# - BURSTCOIN JMINER --------- THIS IS EXPERIMENTAL SOFTWARE, USE ON YOUR OWN RISK! - # ----------------------------------------------------------------------------------- -# -# JMiner is a POC miner with GPU support for Burstcoin (BURST) +# jminer is a PoC (Proof of Capacity) miner with GPU support for Burstcoin (BURST) +# (openCL will also work with CPU in needed) # # Requirements: -# - Java8 + openCL -# +# - Java8 (64bit recommend to use more memory) +# - openCL 1.2 or 2.0 # # PLEASE DONATE # -# JMiner would not be possible without openCL kernels and java code provided by burstDev, -# he really deserves some tips for that! -# BurstDev: BURST-QHCJ-9HB5-PTGC-5Q8J9 +# jminer would not be possible without openCL kernels and java code provided by 'burstDev', he really deserves some tips for that! +# BURST-QHCJ-9HB5-PTGC-5Q8J9 # -# Feel free to support future development. +# Feel free to support future development of mining engine ... # BURST-LUXE-RED2-G6JW-H4HG5 -# +# ----------------------------------------------------------------------------------- + + + +# ----------------------------------------------------------------------------------- +# NOTICE: your 'jminer.properties' hasn't got to contain all properties listed here +# as long there is a default/fallback defined, mentioned in here. +# ----------------------------------------------------------------------------------- + + + # ----------------------------------------------------------------------------------- # - PLOT-FILES ---------------------------------------------------------------------- # ----------------------------------------------------------------------------------- @@ -129,11 +138,42 @@ deviceId= # ----------------------------------------------------------------------------------- # - MINING ENGINE ------------------------------------------------------------------- # ----------------------------------------------------------------------------------- -# restartInterval - the mining engine can restart itself, specify the interval in minutes! -# (default:240) without issues, just set it to a high number, to avoid restarting -# NOTICE: on restart the last block will be mined again. +# restartInterval - the mining engine can restart itself, specify the interval in minutes! +# (default:240) without issues, just set it to a high number, to avoid restarting +# NOTICE: on restart the last block will be mined again. # +# refreshInterval - interval of asking wallet/pool for mining info (in ms), +# (default:2000) to check for new block # +# connectionTimeout - increase the 'connectionTimeout' on network problems. +# (default:12000) this timeout is used for all network requests. +# if you use pool or online-wallet, the 12 sec. default may +# cause timeout on committing nonces or getting mining info etc. +# ----------------------------------------------------------------------------------- +restartInterval= + +refreshInterval=2000 +connectionTimeout=12000 + +# ----------------------------------------------------------------------------------- +# - MINING ENGINE - APPEARANCE ------------------------------------------------------ +# ----------------------------------------------------------------------------------- +# readProgressPerRound - defines how often the mining progress is shown per round +# (default:9) thats the 'xx% done ...' info. +# +# byteUnitDecimal - switch between decimal units (true): TB/GB/MB (divided by 1000), +# (default:true) or binary units (false) TiB/GiB/MiB (divided by 1024) - https://en.wikipedia.org/wiki/Byte +# +# showDriveInfo - set this to 'true' to show info about every drive on finish reading it, +# (default:false) this is useful to find the slow ones ... can help to optimize your setup. +# ----------------------------------------------------------------------------------- +readProgressPerRound= +byteUnitDecimal= +showDriveInfo= + +# ----------------------------------------------------------------------------------- +# - MINING ENGINE - MEMORY USAGE ---------------------------------------------------- +# ----------------------------------------------------------------------------------- # chunkPartNonces - staggerSize defines number of nonces per chunk. # (default:320000) the miner will split chunks in smaller pieces called chunkParts. # this makes sense, to save memory and optimize speed. @@ -146,24 +186,12 @@ deviceId= # without 'optDevPool' (witch is not implemented, yet) # consider using low chunkPartNonces size, to commit more. # (guess, there will not be multiple dl below target in small chunkPart) +# +# readerThreads - normally '0' means, the miner takes one thread per drive (plotPath) this is recommend. +# (default:0) choosing a other number of 'readerThreads' can be useful on memory issues. +# For example, if you mine on 4 drives (plotPaths), you can reduce the memory usage +# by setting 'readerThreads=2', this will reduce mining speed but save memory. # ----------------------------------------------------------------------------------- -restartInterval= chunkPartNonces= - -# interval of asking wallet/pool for mining info, to check for new block (default:2000) - 2 seconds -refreshInterval=2000 -# timeout for all network requests (default:6000) - 6 seconds -connectionTimeout=12000 -# number of logged read progress infos per round -readProgressPerRound=9 - -# (default:true) switch between decimal units: TB/GB/MB (divided by 1000), or binary units TiB/GiB/MiB (divided by 1024) - https://en.wikipedia.org/wiki/Byte -byteUnitDecimal=true - -# (default:false) shows info about every drive on finish reading it, useful to find the slow ones ... -showDriveInfo=false - -# (default:0) 0 -> number of plotPaths is taken (one thread per drive) this is recommend, choosing a lower number can be useful on memory issues. (a higher number is useless) -readerThreads=0 - +readerThreads= diff --git a/pom.xml b/pom.xml index cd65018..5a0d05e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ burstcoin burstcoin-jminer - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT jar burstcoin-jminer @@ -94,9 +94,6 @@ src/main/java - burstcoin/jminer/gui/**/*.fxml - burstcoin/jminer/gui/**/*.css - burstcoin/jminer/gui/**/*.jpg burstcoin/jminer/core/**/*.cl diff --git a/src/main/java/burstcoin/jminer/CommandLineRunner.java b/src/main/java/burstcoin/jminer/CommandLineRunner.java index 959e9d1..1655bde 100644 --- a/src/main/java/burstcoin/jminer/CommandLineRunner.java +++ b/src/main/java/burstcoin/jminer/CommandLineRunner.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, @@ -227,7 +227,7 @@ public void onApplicationEvent(ReaderProgressChangedEvent event) long effDoneBytes = previousRemainingCapacity - event.getRemainingCapacity(); // calculate current reading speed (since last info) - long effBytesPerMs = (effDoneBytes / 4096) / (event.getElapsedTime()-previousElapsedTime); + long effBytesPerMs = (effDoneBytes / 4096) / (event.getElapsedTime() - previousElapsedTime); effMBPerSec = (effBytesPerMs * 1000) / SIZE_DIVISOR / SIZE_DIVISOR; } @@ -318,15 +318,18 @@ public void onApplicationEvent(ReaderCorruptFileEvent event) @Override public void onApplicationEvent(ReaderDriveFinishEvent event) { - // calculate capacity - long doneBytes = event.getSize(); - long doneTB = doneBytes / SIZE_DIVISOR / SIZE_DIVISOR / SIZE_DIVISOR / SIZE_DIVISOR; - long doneGB = doneBytes / SIZE_DIVISOR / SIZE_DIVISOR / SIZE_DIVISOR % SIZE_DIVISOR; + if(blockNumber == event.getBlockNumber()) + { + // calculate capacity + long doneBytes = event.getSize(); + long doneTB = doneBytes / SIZE_DIVISOR / SIZE_DIVISOR / SIZE_DIVISOR / SIZE_DIVISOR; + long doneGB = doneBytes / SIZE_DIVISOR / SIZE_DIVISOR / SIZE_DIVISOR % SIZE_DIVISOR; - long s = event.getTime() / 1000; - long ms = event.getTime() % 1000; + long s = event.getTime() / 1000; + long ms = event.getTime() % 1000; - LOG.info("read '"+event.getDirectory()+ "' (" + doneTB + T_UNIT + " " + doneGB + G_UNIT + ") in '" + s + "s " + ms + "ms'"); + LOG.info("read '" + event.getDirectory() + "' (" + doneTB + T_UNIT + " " + doneGB + G_UNIT + ") in '" + s + "s " + ms + "ms'"); + } } }); @@ -335,7 +338,7 @@ public void onApplicationEvent(ReaderDriveFinishEvent event) @Override public void onApplicationEvent(ReaderDriveInterruptedEvent event) { - LOG.info("stopped '" + event.getDirectory() + "' for block '" + event.getBlockNumber() + "'."); + LOG.debug("stopped '" + event.getDirectory() + "' for block '" + event.getBlockNumber() + "'."); } }); @@ -344,7 +347,7 @@ public void onApplicationEvent(ReaderDriveInterruptedEvent event) LOG.info(" __ __ GPU assisted PoC-Miner"); LOG.info(" |__| _____ |__| ____ ___________ "); LOG.info(" version | |/ \\| |/ \\_/ __ \\_ __ \\"); - LOG.info(" 0.4.1 | | Y Y \\ | | \\ ___/| | \\/"); + LOG.info(" 0.4.2 | | Y Y \\ | | \\ ___/| | \\/"); LOG.info(" /\\__| |__|_| /__|___| /\\___ >__| "); LOG.info(" \\______| \\/ \\/ \\/"); LOG.info(" mining engine: BURST-LUXE-RED2-G6JW-H4HG5"); diff --git a/src/main/java/burstcoin/jminer/core/CoreConfig.java b/src/main/java/burstcoin/jminer/core/CoreConfig.java index d6a1d13..803e91a 100644 --- a/src/main/java/burstcoin/jminer/core/CoreConfig.java +++ b/src/main/java/burstcoin/jminer/core/CoreConfig.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, @@ -51,7 +51,7 @@ public ThreadPoolTaskExecutor readerPool() ThreadPoolTaskExecutor pool = new ThreadPoolTaskExecutor(); pool.setThreadPriority(Thread.NORM_PRIORITY); // false-> triggers interrupt exception at shutdown - pool.setWaitForTasksToCompleteOnShutdown(false); + pool.setWaitForTasksToCompleteOnShutdown(true); return pool; } diff --git a/src/main/java/burstcoin/jminer/core/CoreProperties.java b/src/main/java/burstcoin/jminer/core/CoreProperties.java index a7280dd..6623474 100644 --- a/src/main/java/burstcoin/jminer/core/CoreProperties.java +++ b/src/main/java/burstcoin/jminer/core/CoreProperties.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/checker/Checker.java b/src/main/java/burstcoin/jminer/core/checker/Checker.java index fc4606a..7607d8a 100644 --- a/src/main/java/burstcoin/jminer/core/checker/Checker.java +++ b/src/main/java/burstcoin/jminer/core/checker/Checker.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/checker/event/CheckerDevResultEvent.java b/src/main/java/burstcoin/jminer/core/checker/event/CheckerDevResultEvent.java index 954cd8a..b604675 100644 --- a/src/main/java/burstcoin/jminer/core/checker/event/CheckerDevResultEvent.java +++ b/src/main/java/burstcoin/jminer/core/checker/event/CheckerDevResultEvent.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/checker/event/CheckerResultEvent.java b/src/main/java/burstcoin/jminer/core/checker/event/CheckerResultEvent.java index 8d3e81f..5f7083d 100644 --- a/src/main/java/burstcoin/jminer/core/checker/event/CheckerResultEvent.java +++ b/src/main/java/burstcoin/jminer/core/checker/event/CheckerResultEvent.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/checker/task/OCLCheckerFindAllBelowTargetTask.java b/src/main/java/burstcoin/jminer/core/checker/task/OCLCheckerFindAllBelowTargetTask.java index ba5395e..3216cf3 100644 --- a/src/main/java/burstcoin/jminer/core/checker/task/OCLCheckerFindAllBelowTargetTask.java +++ b/src/main/java/burstcoin/jminer/core/checker/task/OCLCheckerFindAllBelowTargetTask.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/checker/task/OCLCheckerTask.java b/src/main/java/burstcoin/jminer/core/checker/task/OCLCheckerTask.java index 38454da..f9087d2 100644 --- a/src/main/java/burstcoin/jminer/core/checker/task/OCLCheckerTask.java +++ b/src/main/java/burstcoin/jminer/core/checker/task/OCLCheckerTask.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/checker/util/OCLChecker.java b/src/main/java/burstcoin/jminer/core/checker/util/OCLChecker.java index c63b8cb..4c76560 100644 --- a/src/main/java/burstcoin/jminer/core/checker/util/OCLChecker.java +++ b/src/main/java/burstcoin/jminer/core/checker/util/OCLChecker.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, @@ -105,8 +105,18 @@ public void initChecker(int platformId, int deviceId) context = clCreateContext(contextProperties, 1, new cl_device_id[]{devices[deviceId]}, null, null, null); - // org. queue = clCreateCommandQueue(context, devices[deviceId], 0, null); - queue = clCreateCommandQueueWithProperties(context, devices[deviceId], new cl_queue_properties(), null); + boolean openCl2 = true; + try + { + // openCL 2.0 + queue = clCreateCommandQueueWithProperties(context, devices[deviceId], new cl_queue_properties(), null); + } + catch(UnsupportedOperationException e) + { + // org. - fallback for openCL 1.2 + openCl2 = false; + queue = clCreateCommandQueue(context, devices[deviceId], 0, null); + } String kernelSource; try @@ -144,7 +154,7 @@ public void initChecker(int platformId, int deviceId) gensigMem = clCreateBuffer(context, CL_MEM_READ_ONLY, 32, null, null); bestMem = clCreateBuffer(context, CL_MEM_WRITE_ONLY, 400, null, null); // org 400 // tested 5000 - LOG.info("success ... started openCL context!"); + LOG.info("success ... started openCL " + (openCl2 ? "2.0" : "1.2") + " context!"); } public void reset(int platformId, int deviceId) diff --git a/src/main/java/burstcoin/jminer/core/checker/util/package-info.java b/src/main/java/burstcoin/jminer/core/checker/util/package-info.java index abf128d..6a7c591 100644 --- a/src/main/java/burstcoin/jminer/core/checker/util/package-info.java +++ b/src/main/java/burstcoin/jminer/core/checker/util/package-info.java @@ -1,26 +1,6 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, - * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software - * is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies - * or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - /** - * Org. OCLChecker code and the used openCL kernels are provided by 'burst dev'. Please donate: BURST-QHCJ-9HB5-PTGC-5Q8J9 + * Org. OCLChecker code and the used openCL kernels are provided by 'burst dev'. + * + * Please donate: BURST-QHCJ-9HB5-PTGC-5Q8J9 */ package burstcoin.jminer.core.checker.util; \ No newline at end of file diff --git a/src/main/java/burstcoin/jminer/core/network/Network.java b/src/main/java/burstcoin/jminer/core/network/Network.java index 439f596..3bdd4b9 100644 --- a/src/main/java/burstcoin/jminer/core/network/Network.java +++ b/src/main/java/burstcoin/jminer/core/network/Network.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/network/event/NetworkDevResultConfirmedEvent.java b/src/main/java/burstcoin/jminer/core/network/event/NetworkDevResultConfirmedEvent.java index 7663403..7f3114e 100644 --- a/src/main/java/burstcoin/jminer/core/network/event/NetworkDevResultConfirmedEvent.java +++ b/src/main/java/burstcoin/jminer/core/network/event/NetworkDevResultConfirmedEvent.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/network/event/NetworkLastWinnerEvent.java b/src/main/java/burstcoin/jminer/core/network/event/NetworkLastWinnerEvent.java index cfab117..14c9f4b 100644 --- a/src/main/java/burstcoin/jminer/core/network/event/NetworkLastWinnerEvent.java +++ b/src/main/java/burstcoin/jminer/core/network/event/NetworkLastWinnerEvent.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/network/event/NetworkResultConfirmedEvent.java b/src/main/java/burstcoin/jminer/core/network/event/NetworkResultConfirmedEvent.java index 89079ff..f387019 100644 --- a/src/main/java/burstcoin/jminer/core/network/event/NetworkResultConfirmedEvent.java +++ b/src/main/java/burstcoin/jminer/core/network/event/NetworkResultConfirmedEvent.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/network/event/NetworkResultErrorEvent.java b/src/main/java/burstcoin/jminer/core/network/event/NetworkResultErrorEvent.java index 7c8dce4..ea780db 100644 --- a/src/main/java/burstcoin/jminer/core/network/event/NetworkResultErrorEvent.java +++ b/src/main/java/burstcoin/jminer/core/network/event/NetworkResultErrorEvent.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/network/event/NetworkStateChangeEvent.java b/src/main/java/burstcoin/jminer/core/network/event/NetworkStateChangeEvent.java index baa57b5..478d341 100644 --- a/src/main/java/burstcoin/jminer/core/network/event/NetworkStateChangeEvent.java +++ b/src/main/java/burstcoin/jminer/core/network/event/NetworkStateChangeEvent.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/network/model/Block.java b/src/main/java/burstcoin/jminer/core/network/model/Block.java index b5d1216..47b5b04 100644 --- a/src/main/java/burstcoin/jminer/core/network/model/Block.java +++ b/src/main/java/burstcoin/jminer/core/network/model/Block.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/network/model/BlockchainStatus.java b/src/main/java/burstcoin/jminer/core/network/model/BlockchainStatus.java index 6e48d3e..ba16cd7 100644 --- a/src/main/java/burstcoin/jminer/core/network/model/BlockchainStatus.java +++ b/src/main/java/burstcoin/jminer/core/network/model/BlockchainStatus.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/network/model/DevPoolResult.java b/src/main/java/burstcoin/jminer/core/network/model/DevPoolResult.java index ed7d18b..58f304f 100644 --- a/src/main/java/burstcoin/jminer/core/network/model/DevPoolResult.java +++ b/src/main/java/burstcoin/jminer/core/network/model/DevPoolResult.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/network/model/MiningInfoResponse.java b/src/main/java/burstcoin/jminer/core/network/model/MiningInfoResponse.java index 925f139..d837557 100644 --- a/src/main/java/burstcoin/jminer/core/network/model/MiningInfoResponse.java +++ b/src/main/java/burstcoin/jminer/core/network/model/MiningInfoResponse.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/network/model/SubmitResultResponse.java b/src/main/java/burstcoin/jminer/core/network/model/SubmitResultResponse.java index 3436edb..a73acbc 100644 --- a/src/main/java/burstcoin/jminer/core/network/model/SubmitResultResponse.java +++ b/src/main/java/burstcoin/jminer/core/network/model/SubmitResultResponse.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/network/task/NetworkRequestLastWinnerTask.java b/src/main/java/burstcoin/jminer/core/network/task/NetworkRequestLastWinnerTask.java index dd583f7..e4cae6f 100644 --- a/src/main/java/burstcoin/jminer/core/network/task/NetworkRequestLastWinnerTask.java +++ b/src/main/java/burstcoin/jminer/core/network/task/NetworkRequestLastWinnerTask.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/network/task/NetworkRequestMiningInfoTask.java b/src/main/java/burstcoin/jminer/core/network/task/NetworkRequestMiningInfoTask.java index 05db281..40ad37d 100644 --- a/src/main/java/burstcoin/jminer/core/network/task/NetworkRequestMiningInfoTask.java +++ b/src/main/java/burstcoin/jminer/core/network/task/NetworkRequestMiningInfoTask.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/network/task/NetworkSubmitDevPoolNoncesTask.java b/src/main/java/burstcoin/jminer/core/network/task/NetworkSubmitDevPoolNoncesTask.java index 51cc256..88d8042 100644 --- a/src/main/java/burstcoin/jminer/core/network/task/NetworkSubmitDevPoolNoncesTask.java +++ b/src/main/java/burstcoin/jminer/core/network/task/NetworkSubmitDevPoolNoncesTask.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/network/task/NetworkSubmitPoolNonceTask.java b/src/main/java/burstcoin/jminer/core/network/task/NetworkSubmitPoolNonceTask.java index a498ad3..226a90d 100644 --- a/src/main/java/burstcoin/jminer/core/network/task/NetworkSubmitPoolNonceTask.java +++ b/src/main/java/burstcoin/jminer/core/network/task/NetworkSubmitPoolNonceTask.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/network/task/NetworkSubmitSoloNonceTask.java b/src/main/java/burstcoin/jminer/core/network/task/NetworkSubmitSoloNonceTask.java index a3c7813..04b34d5 100644 --- a/src/main/java/burstcoin/jminer/core/network/task/NetworkSubmitSoloNonceTask.java +++ b/src/main/java/burstcoin/jminer/core/network/task/NetworkSubmitSoloNonceTask.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/reader/Reader.java b/src/main/java/burstcoin/jminer/core/reader/Reader.java index da2a1e5..db52b2f 100644 --- a/src/main/java/burstcoin/jminer/core/reader/Reader.java +++ b/src/main/java/burstcoin/jminer/core/reader/Reader.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, @@ -80,7 +80,7 @@ public class Reader private boolean scanPathsEveryRound; // data - private long blockNumber; + public static volatile long blockNumber; private Plots plots; private Map capacityLookup; private long remainingCapacity; @@ -139,17 +139,18 @@ protected void postConstruct() */ public void read(long previousBlockNumber, long blockNumber, int scoopNumber, long lastBestCommittedDeadline) { - this.blockNumber = blockNumber; + Reader.blockNumber = blockNumber; // ensure plots are initialized plots = plots == null ? getPlots() : plots; if(readerPool.getActiveCount() > 0) { - readerPool.shutdown(); + // todo shutdown still needed?! +// readerPool.shutdown(); long elapsedTime = new Date().getTime() - readerStartTime; publisher.publishEvent(new ReaderStoppedEvent(previousBlockNumber, capacity, remainingCapacity, elapsedTime, lastBestCommittedDeadline)); - readerPool.initialize(); +// readerPool.initialize(); } // update reader thread count @@ -166,7 +167,6 @@ public void read(long previousBlockNumber, long blockNumber, int scoopNumber, lo readerStartTime = new Date().getTime(); - // todo why use a threadPool in case we have one thread per drive anyway for(PlotDrive plotDrive : plots.getPlotDrives()) { ReaderLoadDriveTask readerLoadDriveTask = context.getBean(ReaderLoadDriveTask.class); @@ -186,8 +186,12 @@ public Plots getPlots() public void freeResources() { - readerPool.setCorePoolSize(1); - readerPool.setMaxPoolSize(1); + // if no read thread running, pool will be increased on next round + if(readerPool.getActiveCount() == 0) + { + readerPool.setCorePoolSize(1); + readerPool.setMaxPoolSize(1); + } } @Override @@ -206,7 +210,7 @@ public void handleMessage(ReaderLoadedPartEvent event) } else { - LOG.error("Error: ReaderPartLoadedEvent for unknown chunkPartStartNonce: '"+event.getChunkPartStartNonce()+"'!" + LOG.error("Error: ReaderPartLoadedEvent for unknown chunkPartStartNonce: '" + event.getChunkPartStartNonce() + "'!" + " Please check for plot-file duplicate or overlapping plots e.g. use https://bchain.info/BURST/tools/overlap"); } } diff --git a/src/main/java/burstcoin/jminer/core/reader/data/PlotDrive.java b/src/main/java/burstcoin/jminer/core/reader/data/PlotDrive.java index fc9b1b5..46bad29 100644 --- a/src/main/java/burstcoin/jminer/core/reader/data/PlotDrive.java +++ b/src/main/java/burstcoin/jminer/core/reader/data/PlotDrive.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/reader/data/PlotFile.java b/src/main/java/burstcoin/jminer/core/reader/data/PlotFile.java index c9369be..fa7800b 100644 --- a/src/main/java/burstcoin/jminer/core/reader/data/PlotFile.java +++ b/src/main/java/burstcoin/jminer/core/reader/data/PlotFile.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/reader/data/Plots.java b/src/main/java/burstcoin/jminer/core/reader/data/Plots.java index 4f8fe5a..467af7d 100644 --- a/src/main/java/burstcoin/jminer/core/reader/data/Plots.java +++ b/src/main/java/burstcoin/jminer/core/reader/data/Plots.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/reader/event/ReaderCorruptFileEvent.java b/src/main/java/burstcoin/jminer/core/reader/event/ReaderCorruptFileEvent.java index 3f4ae78..b9085ea 100644 --- a/src/main/java/burstcoin/jminer/core/reader/event/ReaderCorruptFileEvent.java +++ b/src/main/java/burstcoin/jminer/core/reader/event/ReaderCorruptFileEvent.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/reader/event/ReaderDriveFinishEvent.java b/src/main/java/burstcoin/jminer/core/reader/event/ReaderDriveFinishEvent.java index d2215cf..f28cadd 100644 --- a/src/main/java/burstcoin/jminer/core/reader/event/ReaderDriveFinishEvent.java +++ b/src/main/java/burstcoin/jminer/core/reader/event/ReaderDriveFinishEvent.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, @@ -31,14 +31,16 @@ public class ReaderDriveFinishEvent private String directory; private long size; private long time; + private long blockNumber; - public ReaderDriveFinishEvent(String directory, long size, long time) + public ReaderDriveFinishEvent(String directory, long size, long time, long blockNumber) { super(directory); this.directory = directory; this.size = size; this.time = time; + this.blockNumber = blockNumber; } public long getTime() @@ -55,4 +57,9 @@ public long getSize() { return size; } + + public long getBlockNumber() + { + return blockNumber; + } } diff --git a/src/main/java/burstcoin/jminer/core/reader/event/ReaderDriveInterruptedEvent.java b/src/main/java/burstcoin/jminer/core/reader/event/ReaderDriveInterruptedEvent.java index 82580ff..200de7a 100644 --- a/src/main/java/burstcoin/jminer/core/reader/event/ReaderDriveInterruptedEvent.java +++ b/src/main/java/burstcoin/jminer/core/reader/event/ReaderDriveInterruptedEvent.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/reader/event/ReaderLoadedPartEvent.java b/src/main/java/burstcoin/jminer/core/reader/event/ReaderLoadedPartEvent.java index a5b0b09..5a09134 100644 --- a/src/main/java/burstcoin/jminer/core/reader/event/ReaderLoadedPartEvent.java +++ b/src/main/java/burstcoin/jminer/core/reader/event/ReaderLoadedPartEvent.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/reader/event/ReaderProgressChangedEvent.java b/src/main/java/burstcoin/jminer/core/reader/event/ReaderProgressChangedEvent.java index d462055..eb35c1b 100644 --- a/src/main/java/burstcoin/jminer/core/reader/event/ReaderProgressChangedEvent.java +++ b/src/main/java/burstcoin/jminer/core/reader/event/ReaderProgressChangedEvent.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/reader/event/ReaderStoppedEvent.java b/src/main/java/burstcoin/jminer/core/reader/event/ReaderStoppedEvent.java index 5f3542b..65e0a89 100644 --- a/src/main/java/burstcoin/jminer/core/reader/event/ReaderStoppedEvent.java +++ b/src/main/java/burstcoin/jminer/core/reader/event/ReaderStoppedEvent.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/reader/task/ReaderLoadDriveTask.java b/src/main/java/burstcoin/jminer/core/reader/task/ReaderLoadDriveTask.java index 3870416..7e61610 100644 --- a/src/main/java/burstcoin/jminer/core/reader/task/ReaderLoadDriveTask.java +++ b/src/main/java/burstcoin/jminer/core/reader/task/ReaderLoadDriveTask.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, @@ -24,6 +24,7 @@ import burstcoin.jminer.core.CoreProperties; +import burstcoin.jminer.core.reader.Reader; import burstcoin.jminer.core.reader.data.PlotDrive; import burstcoin.jminer.core.reader.data.PlotFile; import burstcoin.jminer.core.reader.event.ReaderDriveFinishEvent; @@ -81,7 +82,7 @@ public void run() { long startTime = showDriveInfo ? new Date().getTime() : 0; Iterator iterator = plotDrive.getPlotFiles().iterator(); - while(iterator.hasNext() && !Thread.currentThread().isInterrupted()) + while(iterator.hasNext() && Reader.blockNumber == blockNumber) { PlotFile plotPathInfo = iterator.next(); if(plotPathInfo.getStaggeramt() % plotPathInfo.getNumberOfParts() > 0) @@ -95,13 +96,13 @@ public void run() if(showDriveInfo) { - if(Thread.currentThread().isInterrupted()) + if(Reader.blockNumber != blockNumber) { publisher.publishEvent(new ReaderDriveInterruptedEvent(blockNumber, plotDrive.getDirectory())); } else { - publisher.publishEvent(new ReaderDriveFinishEvent(plotDrive.getDirectory(), plotDrive.getSize(), new Date().getTime() - startTime)); + publisher.publishEvent(new ReaderDriveFinishEvent(plotDrive.getDirectory(), plotDrive.getSize(), new Date().getTime() - startTime, blockNumber)); } } } @@ -121,17 +122,17 @@ private void load(PlotFile plotFile) sbc.position(currentScoopPosition + currentChunkPosition); for(int partNumber = 0; partNumber < plotFile.getNumberOfParts(); partNumber++) { - sbc.read(partBuffer); - if(Thread.currentThread().isInterrupted()) + if(Reader.blockNumber != blockNumber) { // todo never reached?! - LOG.debug("loadDriveThread interrupted!"); + LOG.debug("loadDriveThread stopped!"); // make sure to stop reading and clean up chunkNumber += plotFile.getNumberOfChunks(); partNumber += plotFile.getNumberOfParts(); } else { + sbc.read(partBuffer); long chunkPartStartNonce = plotFile.getStartnonce() + (chunkNumber * plotFile.getStaggeramt()) + (partNumber * partSize); final byte[] scoops = partBuffer.array(); publisher.publishEvent(new ReaderLoadedPartEvent(blockNumber, scoops, chunkPartStartNonce)); diff --git a/src/main/java/burstcoin/jminer/core/round/Round.java b/src/main/java/burstcoin/jminer/core/round/Round.java index ad3da01..3a96871 100644 --- a/src/main/java/burstcoin/jminer/core/round/Round.java +++ b/src/main/java/burstcoin/jminer/core/round/Round.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, @@ -393,15 +393,15 @@ private void onRoundFinish(long blockNumber) finishedBlockNumber = blockNumber; long elapsedRoundTime = new Date().getTime() - roundStartDate.getTime(); triggerGarbageCollection(); - reader.freeResources(); timer.schedule(new TimerTask() { @Override public void run() { + reader.freeResources(); fireEvent(new RoundFinishedEvent(blockNumber, bestCommittedDeadline, elapsedRoundTime)); } - }, 200); // fire deferred + }, 250); // fire deferred } private void commitDevPoolNonces(long blockNumber) diff --git a/src/main/java/burstcoin/jminer/core/round/event/RoundFinishedEvent.java b/src/main/java/burstcoin/jminer/core/round/event/RoundFinishedEvent.java index 43baf72..24d7cab 100644 --- a/src/main/java/burstcoin/jminer/core/round/event/RoundFinishedEvent.java +++ b/src/main/java/burstcoin/jminer/core/round/event/RoundFinishedEvent.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/round/event/RoundSingleResultEvent.java b/src/main/java/burstcoin/jminer/core/round/event/RoundSingleResultEvent.java index ff1c51f..3d0a169 100644 --- a/src/main/java/burstcoin/jminer/core/round/event/RoundSingleResultEvent.java +++ b/src/main/java/burstcoin/jminer/core/round/event/RoundSingleResultEvent.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/round/event/RoundSingleResultSkippedEvent.java b/src/main/java/burstcoin/jminer/core/round/event/RoundSingleResultSkippedEvent.java index 29140cb..0daa08c 100644 --- a/src/main/java/burstcoin/jminer/core/round/event/RoundSingleResultSkippedEvent.java +++ b/src/main/java/burstcoin/jminer/core/round/event/RoundSingleResultSkippedEvent.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/round/event/RoundStartedEvent.java b/src/main/java/burstcoin/jminer/core/round/event/RoundStartedEvent.java index ae8204c..f9dc25c 100644 --- a/src/main/java/burstcoin/jminer/core/round/event/RoundStartedEvent.java +++ b/src/main/java/burstcoin/jminer/core/round/event/RoundStartedEvent.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/round/event/RoundStoppedEvent.java b/src/main/java/burstcoin/jminer/core/round/event/RoundStoppedEvent.java index 5203264..876cb26 100644 --- a/src/main/java/burstcoin/jminer/core/round/event/RoundStoppedEvent.java +++ b/src/main/java/burstcoin/jminer/core/round/event/RoundStoppedEvent.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/core/round/task/RoundFireEventTask.java b/src/main/java/burstcoin/jminer/core/round/task/RoundFireEventTask.java index 4e0a16e..ab83d05 100644 --- a/src/main/java/burstcoin/jminer/core/round/task/RoundFireEventTask.java +++ b/src/main/java/burstcoin/jminer/core/round/task/RoundFireEventTask.java @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 + * Copyright (c) 2016 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/src/main/java/burstcoin/jminer/gui/JMiner.java b/src/main/java/burstcoin/jminer/gui/JMiner.java deleted file mode 100644 index 98dc45b..0000000 --- a/src/main/java/burstcoin/jminer/gui/JMiner.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, - * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software - * is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies - * or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -package burstcoin.jminer.gui; - -import burstcoin.jminer.gui.mining.MiningController; -import javafx.application.Application; -import javafx.fxml.FXMLLoader; -import javafx.scene.Node; -import javafx.stage.Stage; -import org.springframework.stereotype.Component; - -import java.io.IOException; - -@Component -public class JMiner - extends Application -{ - private JMinerView view; - private MiningController miningController; - - @Override - public void stop() - throws Exception - { - - super.stop(); - System.exit(0); - } - - @Override - public void start(Stage primaryStage) - throws Exception - { -// ConfigurableApplicationContext applicationContext = SpringApplication.run(CommandLineRunner.class, ""); - - // that means i can just fire within spring context and gui will receive that! -// applicationContext.addApplicationListener(new ApplicationListener() -// { -// @Override -// public void onApplicationEvent(NetworkResultConfirmedEvent event) -// { -// -// } -// }); - - // that means i can just fire within spring context and gui will receive that! -// applicationContext.addApplicationListener(new ApplicationListener() -// { -// @Override -// public void onApplicationEvent(CheckerResultEvent checkerResultEvent) -// { -// -// } -// }); - - view = new JMinerView(new JMinerView.Action() - { - @Override - public void onTabSelect(String name) - { -// System.out.println(name); - } - }); - - initializeMiner(); - - view.addTo(primaryStage); - - } - - private void initializeMiner() - { - - FXMLLoader loader = new FXMLLoader(); - // set fxml location - loader.setLocation(getClass().getResource("mining/mining.fxml")); - // load and add - Node node = null; - try - { - node = loader.load(); - } - catch(IOException e) - { - e.printStackTrace(); - } - String uuid = view.addContent("mining", node); - // get controller from loader - miningController = loader.getController(); - - view.showTab(uuid); - } -} diff --git a/src/main/java/burstcoin/jminer/gui/JMinerView.java b/src/main/java/burstcoin/jminer/gui/JMinerView.java deleted file mode 100644 index e4ec1e9..0000000 --- a/src/main/java/burstcoin/jminer/gui/JMinerView.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, - * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software - * is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies - * or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -package burstcoin.jminer.gui; - -import javafx.event.Event; -import javafx.event.EventHandler; -import javafx.geometry.NodeOrientation; -import javafx.scene.Node; -import javafx.scene.Scene; -import javafx.scene.control.Label; -import javafx.scene.control.Tab; -import javafx.scene.control.TabPane; -import javafx.scene.control.ToolBar; -import javafx.scene.layout.BorderPane; -import javafx.scene.layout.StackPane; -import javafx.stage.Stage; - -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - - -public class JMinerView - extends BorderPane -{ - protected static interface Action - { - void onTabSelect(String name); - } - - private final TabPane tabPane; - - private Tab currentTab; - private Map tabLookup; - - private Action action; - - public JMinerView(Action action) - { - tabLookup = new HashMap<>(); - this.action = action; - ToolBar mainBar = new ToolBar(); - Label appLabel = new Label("burstcoin-jminer"); - mainBar.getItems().add(appLabel); - - tabPane = new TabPane(); - - ToolBar statusBar = new ToolBar(); - statusBar.setNodeOrientation(NodeOrientation.RIGHT_TO_LEFT); - statusBar.getItems().add(new Label("Version: 0.4.0-SNAPSHOT")); - - setTop(mainBar); - setCenter(tabPane); - setBottom(statusBar); - } - - public void setCurrentTab(Tab currentTab) - { - this.currentTab = currentTab; - } - - public void showTab(String tabName) - { - - Tab tab = tabLookup.get(tabName); - - if(tab != null) - { - - tabPane.getSelectionModel().select(tab); - } - - } - - public String addContent(final String name, Node content) - { - - Tab tab = new Tab(name); - tab.setClosable(false); - - tab.setContent(content); - tab.setOnSelectionChanged(new EventHandler() - { - @Override - public void handle(Event event) - { - if(!event.getTarget().equals(currentTab)) - { - setCurrentTab((Tab) event.getTarget()); - - if(action != null) - { - action.onTabSelect(tab.getText()); - } - } - } - }); - tabPane.getTabs().add(tab); - String tabKey = UUID.randomUUID().toString(); - tabLookup.put(tabKey, tab); - - return tabKey; - } - - public void addTo(Stage primaryStage) - { - primaryStage.setTitle("BURST"); - StackPane root = new StackPane(); - root.getChildren().add(this); - - Scene scene = new Scene(root, 900, 650); - - primaryStage.setScene(scene); - primaryStage.show(); - } - - public Tab getTab(String uuid) - { - return tabLookup.get(uuid); - } -} diff --git a/src/main/java/burstcoin/jminer/gui/mining/CommittedController.java b/src/main/java/burstcoin/jminer/gui/mining/CommittedController.java deleted file mode 100644 index cc6c794..0000000 --- a/src/main/java/burstcoin/jminer/gui/mining/CommittedController.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, - * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software - * is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies - * or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -package burstcoin.jminer.gui.mining; - -import javafx.fxml.Initializable; - -import java.net.URL; -import java.util.ResourceBundle; - -public class CommittedController - implements Initializable -{ - @Override - public void initialize(URL location, ResourceBundle resources) - { - - } -} diff --git a/src/main/java/burstcoin/jminer/gui/mining/MiningController.java b/src/main/java/burstcoin/jminer/gui/mining/MiningController.java deleted file mode 100644 index 0487e5b..0000000 --- a/src/main/java/burstcoin/jminer/gui/mining/MiningController.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, - * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software - * is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies - * or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -package burstcoin.jminer.gui.mining; - -import javafx.fxml.FXMLLoader; -import javafx.fxml.Initializable; -import javafx.scene.Node; -import javafx.scene.control.SplitPane; -import javafx.scene.layout.BorderPane; - -import java.io.IOException; -import java.net.URL; -import java.util.ResourceBundle; - -public class MiningController - implements Initializable -{ - public SplitPane roundAndCommittedContainer; - public SplitPane roundsContainer; - public BorderPane borderPane; - - private CommittedController committedController; - private RoundController roundController; - private RoundsController roundsController; - private NetworkController networkController; - - @Override - public void initialize(URL location, ResourceBundle resources) - { - initializeNetwork(); - initializeRounds(); - initializeRound(); - initializeCommitted(); - } - - private void initializeRound() - { - FXMLLoader loader = new FXMLLoader(); - // set fxml location - loader.setLocation(getClass().getResource("round.fxml")); - // load and add - Node roundNode = null; - try - { - roundNode = loader.load(); - } - catch(IOException e) - { - e.printStackTrace(); - } - // get controller from loader - roundController = loader.getController(); - roundAndCommittedContainer.getItems().add(roundNode); - } - - private void initializeRounds() - { - FXMLLoader loader = new FXMLLoader(); - // set fxml location - loader.setLocation(getClass().getResource("rounds.fxml")); - // load and add - Node roundsNode = null; - try - { - roundsNode = loader.load(); - } - catch(IOException e) - { - e.printStackTrace(); - } - // get controller from loader - roundsController = loader.getController(); - roundsContainer.getItems().add(0, roundsNode); - } - - private void initializeCommitted() - { - FXMLLoader loader = new FXMLLoader(); - // set fxml location - loader.setLocation(getClass().getResource("committed.fxml")); - // load and add - Node committedNode = null; - try - { - committedNode = loader.load(); - } - catch(IOException e) - { - e.printStackTrace(); - } - // get controller from loader - committedController = loader.getController(); - roundAndCommittedContainer.getItems().add(committedNode); - } - - private void initializeNetwork() - { - FXMLLoader loader = new FXMLLoader(); - // set fxml location - loader.setLocation(getClass().getResource("network.fxml")); - // load and add - Node networkNode = null; - try - { - networkNode = loader.load(); - } - catch(IOException e) - { - e.printStackTrace(); - } - // get controller from loader - networkController = loader.getController(); - borderPane.setTop(networkNode); - } - - public CommittedController getCommittedController() - { - return committedController; - } - - public RoundController getRoundController() - { - return roundController; - } - - public RoundsController getRoundsController() - { - return roundsController; - } - - public NetworkController getNetworkController() - { - return networkController; - } -} diff --git a/src/main/java/burstcoin/jminer/gui/mining/NetworkController.java b/src/main/java/burstcoin/jminer/gui/mining/NetworkController.java deleted file mode 100644 index 76dc263..0000000 --- a/src/main/java/burstcoin/jminer/gui/mining/NetworkController.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, - * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software - * is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies - * or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -package burstcoin.jminer.gui.mining; - -import javafx.fxml.Initializable; - -import java.net.URL; -import java.util.ResourceBundle; - -public class NetworkController - implements Initializable -{ - @Override - public void initialize(URL location, ResourceBundle resources) - { - - } -} diff --git a/src/main/java/burstcoin/jminer/gui/mining/RoundController.java b/src/main/java/burstcoin/jminer/gui/mining/RoundController.java deleted file mode 100644 index 02fc7ef..0000000 --- a/src/main/java/burstcoin/jminer/gui/mining/RoundController.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, - * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software - * is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies - * or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -package burstcoin.jminer.gui.mining; - -import javafx.fxml.Initializable; - -import java.net.URL; -import java.util.ResourceBundle; - -/** - * - */ -public class RoundController - implements Initializable -{ - @Override - public void initialize(URL location, ResourceBundle resources) - { - - } -} diff --git a/src/main/java/burstcoin/jminer/gui/mining/RoundsController.java b/src/main/java/burstcoin/jminer/gui/mining/RoundsController.java deleted file mode 100644 index b73b365..0000000 --- a/src/main/java/burstcoin/jminer/gui/mining/RoundsController.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, - * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software - * is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies - * or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -package burstcoin.jminer.gui.mining; - -import burstcoin.jminer.gui.mining.model.MiningRound; -import javafx.fxml.FXML; -import javafx.fxml.Initializable; -import javafx.scene.control.TableView; - -import java.net.URL; -import java.util.ResourceBundle; - -/** - * select round/block from list of historic and current round/block - */ -public class RoundsController - implements Initializable -{ - @FXML - private TableView roundsTableView; - - @Override - public void initialize(URL location, ResourceBundle resources) - { - roundsTableView.setTableMenuButtonVisible(true); - - } -} diff --git a/src/main/java/burstcoin/jminer/gui/mining/committed.fxml b/src/main/java/burstcoin/jminer/gui/mining/committed.fxml deleted file mode 100644 index 119d9e6..0000000 --- a/src/main/java/burstcoin/jminer/gui/mining/committed.fxml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/java/burstcoin/jminer/gui/mining/mining.fxml b/src/main/java/burstcoin/jminer/gui/mining/mining.fxml deleted file mode 100644 index 89810d9..0000000 --- a/src/main/java/burstcoin/jminer/gui/mining/mining.fxml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- -
\ No newline at end of file diff --git a/src/main/java/burstcoin/jminer/gui/mining/model/MiningRound.java b/src/main/java/burstcoin/jminer/gui/mining/model/MiningRound.java deleted file mode 100644 index 29a2025..0000000 --- a/src/main/java/burstcoin/jminer/gui/mining/model/MiningRound.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2015 by luxe - https://github.com/de-luxe - BURST-LUXE-RED2-G6JW-H4HG5 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, - * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software - * is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies - * or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -package burstcoin.jminer.gui.mining.model; - -import javafx.beans.property.SimpleIntegerProperty; -import javafx.beans.property.SimpleLongProperty; -import javafx.beans.property.SimpleStringProperty; - - -/** - * The type Mining round. - */ -public class MiningRound -{ - // id - private SimpleLongProperty blockNumber; - private SimpleIntegerProperty scoopNumber; - - private SimpleStringProperty deadline; - private SimpleStringProperty elapsedTime; - private SimpleStringProperty percentDone; - - private SimpleStringProperty effectiveReadSpeed; - private SimpleStringProperty winner; - - /** - * Instantiates a new Mining round. - */ - public MiningRound() - { - } - - /** - * Gets block number. - * - * @return the block number - */ - public long getBlockNumber() - { - return blockNumber.get(); - } - - /** - * Block number property. - * - * @return the simple long property - */ - public SimpleLongProperty blockNumberProperty() - { - return blockNumber; - } - - /** - * Sets block number. - * - * @param blockNumber the block number - */ - public void setBlockNumber(long blockNumber) - { - this.blockNumber.set(blockNumber); - } - - /** - * Gets scoop number. - * - * @return the scoop number - */ - public int getScoopNumber() - { - return scoopNumber.get(); - } - - /** - * Scoop number property. - * - * @return the simple integer property - */ - public SimpleIntegerProperty scoopNumberProperty() - { - return scoopNumber; - } - - /** - * Sets scoop number. - * - * @param scoopNumber the scoop number - */ - public void setScoopNumber(int scoopNumber) - { - this.scoopNumber.set(scoopNumber); - } - - /** - * Gets deadline. - * - * @return the deadline - */ - public String getDeadline() - { - return deadline.get(); - } - - /** - * Deadline property. - * - * @return the simple string property - */ - public SimpleStringProperty deadlineProperty() - { - return deadline; - } - - /** - * Sets deadline. - * - * @param deadline the deadline - */ - public void setDeadline(String deadline) - { - this.deadline.set(deadline); - } - - /** - * Gets elapsed time. - * - * @return the elapsed time - */ - public String getElapsedTime() - { - return elapsedTime.get(); - } - - /** - * Elapsed time property. - * - * @return the simple string property - */ - public SimpleStringProperty elapsedTimeProperty() - { - return elapsedTime; - } - - /** - * Sets elapsed time. - * - * @param elapsedTime the elapsed time - */ - public void setElapsedTime(String elapsedTime) - { - this.elapsedTime.set(elapsedTime); - } - - /** - * Gets percent done. - * - * @return the percent done - */ - public String getPercentDone() - { - return percentDone.get(); - } - - /** - * Percent done property. - * - * @return the simple string property - */ - public SimpleStringProperty percentDoneProperty() - { - return percentDone; - } - - /** - * Sets percent done. - * - * @param percentDone the percent done - */ - public void setPercentDone(String percentDone) - { - this.percentDone.set(percentDone); - } - - /** - * Gets effective read speed. - * - * @return the effective read speed - */ - public String getEffectiveReadSpeed() - { - return effectiveReadSpeed.get(); - } - - /** - * Effective read speed property. - * - * @return the simple string property - */ - public SimpleStringProperty effectiveReadSpeedProperty() - { - return effectiveReadSpeed; - } - - /** - * Sets effective read speed. - * - * @param effectiveReadSpeed the effective read speed - */ - public void setEffectiveReadSpeed(String effectiveReadSpeed) - { - this.effectiveReadSpeed.set(effectiveReadSpeed); - } - - /** - * Gets winner. - * - * @return the winner - */ - public String getWinner() - { - return winner.get(); - } - - /** - * Winner property. - * - * @return the simple string property - */ - public SimpleStringProperty winnerProperty() - { - return winner; - } - - /** - * Sets winner. - * - * @param winner the winner - */ - public void setWinner(String winner) - { - this.winner.set(winner); - } -} diff --git a/src/main/java/burstcoin/jminer/gui/mining/network.fxml b/src/main/java/burstcoin/jminer/gui/mining/network.fxml deleted file mode 100644 index 73835ec..0000000 --- a/src/main/java/burstcoin/jminer/gui/mining/network.fxml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/java/burstcoin/jminer/gui/mining/round.fxml b/src/main/java/burstcoin/jminer/gui/mining/round.fxml deleted file mode 100644 index 97bde05..0000000 --- a/src/main/java/burstcoin/jminer/gui/mining/round.fxml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/java/burstcoin/jminer/gui/mining/rounds.fxml b/src/main/java/burstcoin/jminer/gui/mining/rounds.fxml deleted file mode 100644 index 1948929..0000000 --- a/src/main/java/burstcoin/jminer/gui/mining/rounds.fxml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 1eb5af5..1e8852c 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,3 +1,4 @@ logging.level.burstcoin.jminer.core=INFO logging.level.org.eclipse.jetty.util.log=WARN -logging.level.org.springframework=WARN \ No newline at end of file +logging.level.org.springframework=WARN +logging.file=jminer.logs.txt \ No newline at end of file