Skip to content

Commit

Permalink
#9 write console output to logfile;
Browse files Browse the repository at this point in the history
changed version to 0.4.2-SNAPSHOT;
updated copyright and other cleanup;
step forward with description in jminer.default.properties;
removed unused sources, some bugfixes;
  • Loading branch information
de-luxe committed Feb 20, 2016
1 parent 8164b5e commit 3f64dfb
Show file tree
Hide file tree
Showing 61 changed files with 165 additions and 1,192 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
90 changes: 59 additions & 31 deletions jminer.default.properties
Original file line number Diff line number Diff line change
@@ -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 ----------------------------------------------------------------------
# -----------------------------------------------------------------------------------
Expand Down Expand Up @@ -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.
Expand All @@ -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=

5 changes: 1 addition & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>burstcoin</groupId>
<artifactId>burstcoin-jminer</artifactId>
<version>0.4.1-SNAPSHOT</version>
<version>0.4.2-SNAPSHOT</version>
<packaging>jar</packaging>

<name>burstcoin-jminer</name>
Expand Down Expand Up @@ -94,9 +94,6 @@
<resource>
<directory>src/main/java</directory>
<includes>
<include>burstcoin/jminer/gui/**/*.fxml</include>
<include>burstcoin/jminer/gui/**/*.css</include>
<include>burstcoin/jminer/gui/**/*.jpg</include>
<include>burstcoin/jminer/core/**/*.cl</include>
</includes>
</resource>
Expand Down
25 changes: 14 additions & 11 deletions src/main/java/burstcoin/jminer/CommandLineRunner.java
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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'");
}
}
});

Expand All @@ -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() + "'.");
}
});

Expand All @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/burstcoin/jminer/core/CoreConfig.java
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/burstcoin/jminer/core/CoreProperties.java
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/burstcoin/jminer/core/checker/Checker.java
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
18 changes: 14 additions & 4 deletions src/main/java/burstcoin/jminer/core/checker/util/OCLChecker.java
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
26 changes: 3 additions & 23 deletions src/main/java/burstcoin/jminer/core/checker/util/package-info.java
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion src/main/java/burstcoin/jminer/core/network/Network.java
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Loading

0 comments on commit 3f64dfb

Please sign in to comment.