Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
4a2cf0f
Use unix newline
spartacusrex99 Oct 21, 2022
50ea9e6
fix CLI in docker
spartacusrex99 Oct 21, 2022
f532b43
don't compact the DB
spartacusrex99 Oct 21, 2022
4b26067
switch to dev docker by default
spartacusrex99 Oct 21, 2022
d5ce3ad
static max
spartacusrex99 Oct 22, 2022
f848ecf
hard close the SQL DB
spartacusrex99 Oct 31, 2022
e73c5d5
Wipe the Archive and TXPoWDB if they have errors.. you can always resync
spartacusrex99 Oct 31, 2022
24e9f85
new dev docker..
spartacusrex99 Oct 31, 2022
780f3b5
rmeove uneeded import
spartacusrex99 Oct 31, 2022
957fc25
static mls
spartacusrex99 Nov 4, 2022
2b047e7
Merge branch 'dev-spartacus-staticmax' into dev-spartacus
spartacusrex99 Nov 4, 2022
7439e8b
Merge branch 'dev-spartacus-staticmls' into dev-spartacus
spartacusrex99 Nov 7, 2022
5c48b98
staticmls function
spartacusrex99 Nov 7, 2022
a311997
check for tree when syncblock
spartacusrex99 Nov 7, 2022
709d0a4
create all remaining default keys
spartacusrex99 Nov 7, 2022
f9e4132
sign and verify any maxima message
spartacusrex99 Nov 7, 2022
027467e
CLI docker
spartacusrex99 Nov 7, 2022
a4034d5
check for NULL on hard close
spartacusrex99 Nov 7, 2022
50b25f5
do RAM clean first
spartacusrex99 Nov 7, 2022
e2575a1
103.22
spartacusrex99 Nov 7, 2022
78bffee
remove bad import
spartacusrex99 Nov 7, 2022
427729e
Merge branch 'dev-spartacus' into dev
spartacusrex99 Nov 7, 2022
3a02d01
23..
spartacusrex99 Nov 7, 2022
a9cd2f4
catch socket esception in MDS
spartacusrex99 Nov 8, 2022
3ded8ac
addpeers on the fly if none available
spartacusrex99 Nov 8, 2022
8a879a8
Check for valid parameters
spartacusrex99 Nov 8, 2022
0f91650
add valid params to functions
spartacusrex99 Nov 8, 2022
f062470
more valid params for functions
spartacusrex99 Nov 8, 2022
a778750
valid params
spartacusrex99 Nov 8, 2022
81a2f0b
check all function params
spartacusrex99 Nov 8, 2022
33587a9
0.103.23
spartacusrex99 Nov 8, 2022
ac7072e
Merge branch 'dev-spartacus' into dev
spartacusrex99 Nov 8, 2022
b3194d1
Full help possible for the CLI functions
spartacusrex99 Nov 9, 2022
7724175
missing @Override
spartacusrex99 Nov 9, 2022
597047d
text clean up
spartacusrex99 Nov 9, 2022
2417bad
Merge branch 'dev-spartacus' into dev
spartacusrex99 Nov 9, 2022
4ee5efc
text change
spartacusrex99 Nov 9, 2022
32baa76
First commit for burn
Jazminima Nov 9, 2022
7b1b44b
tokencreate burn taken out of the Minima used
spartacusrex99 Nov 9, 2022
bf74b22
backup, restore, balance, burn
Jazminima Nov 9, 2022
61ad722
getAddress for balance and new default version
spartacusrex99 Nov 9, 2022
e3a6406
fix getAddress default version
spartacusrex99 Nov 9, 2022
70401f7
send no sign
spartacusrex99 Nov 10, 2022
94ffce5
mine txpow stnchronously on send
spartacusrex99 Nov 10, 2022
5bef548
Don't add searched for TxPoW to the RamDB
spartacusrex99 Nov 10, 2022
0476511
search for onchain txpow
spartacusrex99 Nov 10, 2022
4fedf83
check block itself for txpow
spartacusrex99 Nov 10, 2022
0b5d663
set dynamic magic max kissvm
spartacusrex99 Nov 10, 2022
28816ce
magic numbers
spartacusrex99 Nov 11, 2022
e7ad197
use /bin/sh
spartacusrex99 Nov 11, 2022
a3dc0ad
newline at end
spartacusrex99 Nov 11, 2022
e3f730c
check if archivedb open
spartacusrex99 Nov 11, 2022
c7e9364
healthcheck command
spartacusrex99 Nov 11, 2022
1f0b0cd
backup, balance, coincheck, coinexport, coinimport, cointrack,
Jazminima Nov 11, 2022
06e05a4
Clean SQL DB every 12 hours only
spartacusrex99 Nov 14, 2022
67887c5
add host as valid param
spartacusrex99 Nov 14, 2022
332c35b
Notify contact changes in maxima
spartacusrex99 Nov 14, 2022
25852d5
0.103.24
spartacusrex99 Nov 14, 2022
5fa92aa
remove line delimiters
spartacusrex99 Nov 14, 2022
e537d32
Put the 1 second delay inside the password checker
spartacusrex99 Nov 14, 2022
a6a8561
hash, hashtest, healthcheck, getaddress, incentivecash
Jazminima Nov 14, 2022
ed9aa80
Check host you set for static mls
spartacusrex99 Nov 15, 2022
9dbdbfd
HUB change to look good on mobile
spartacusrex99 Nov 15, 2022
a66ae68
logs, mmrcreate
Jazminima Nov 15, 2022
21f581f
MAX mempool size.. 1 hr of full blocks
spartacusrex99 Nov 15, 2022
59f89d5
minima testnet node class
BarneyChambers Nov 16, 2022
a585828
add missing files that werent pushed with previous commit
BarneyChambers Nov 16, 2022
d165937
Base commands
Jazminima Nov 18, 2022
8428088
add base tests to all CLI command folders
BarneyChambers Nov 18, 2022
329fdaf
Maxima commands
Jazminima Nov 18, 2022
969c9ad
fix params
spartacusrex99 Nov 21, 2022
1d821cb
Merge branch 'dev-fullhelp' into dev-spartacus-mergehelp
spartacusrex99 Nov 21, 2022
75d6e8a
fix hash params
spartacusrex99 Nov 21, 2022
07e7c5d
0.103.25
spartacusrex99 Nov 21, 2022
c45910a
merge with spartacus's dev
BarneyChambers Nov 21, 2022
f1b00e6
fix typo
Nov 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ publishing {
}

docker {
name 'minimaglobal/minima:latest'
name 'minimaglobal/minima:dev'
dockerfile project.file('docker/Dockerfile')

//buildx true
//push true
//platform 'linux/amd64,linux/arm64,linux/arm/v7'
buildx true
push true
platform 'linux/amd64,linux/arm64,linux/arm/v7'

files tasks.shadowJar, "$rootDir/docker/dapps"
copySpec.from("$buildDir/lib/minima-all.jar",).into(".")
Expand Down
5 changes: 3 additions & 2 deletions docker/minima
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
#!/bin/sh

java -cp /usr/local/minima/minima.jar org.minima.utils.MinimaRPCClient
#Start the docker container Minima RPC Client
java -cp /usr/local/minima/minima.jar org.minima.utils.MinimaRPCClient
Empty file modified gradlew
100755 → 100644
Empty file.
Binary file renamed jar/minima-0.103.20.apk → jar/minima-0.103.22.apk
Binary file not shown.
Binary file modified jar/minima-nolibs.jar
Binary file not shown.
Binary file modified jar/minima.jar
Binary file not shown.
Empty file modified lib/junit-4.13.jar
100755 → 100644
Empty file.
120 changes: 120 additions & 0 deletions mds/code/testhub/index.html

Large diffs are not rendered by default.

Binary file not shown.
Binary file added mydaatafolder/0.103/databases/cascade.db
Binary file not shown.
Binary file added mydaatafolder/0.103/databases/chaintree.db
Binary file not shown.
Binary file not shown.
Binary file added mydaatafolder/0.103/databases/mdssql/mds.mv.db
Binary file not shown.
Binary file added mydaatafolder/0.103/databases/p2p.db
Binary file not shown.
Binary file not shown.
Binary file added mydaatafolder/0.103/databases/userprefs.db
Binary file not shown.
Binary file not shown.
12 changes: 12 additions & 0 deletions mydaatafolder/0.103/databases/walletsql/wallet.trace.db
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
2022-11-14 12:55:25 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "SCRIPT TO '/mnt/c/Users/user/Documents/Oscar's work folder/Minima-dev/Minima-dev/mydaatafolder/0.103/backup/wallet.sql[*]'"; SQL statement:
SCRIPT TO '/mnt/c/Users/user/Documents/Oscar's work folder/Minima-dev/Minima-dev/mydaatafolder/0.103/backup/wallet.sql' [42000-200]
2022-11-14 12:55:25 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "SCRIPT TO '/mnt/c/Users/user/Documents/Oscar's work folder/Minima-dev/Minima-dev/mydaatafolder/0.103/backup/wallet.sql[*]'"; SQL statement:
SCRIPT TO '/mnt/c/Users/user/Documents/Oscar's work folder/Minima-dev/Minima-dev/mydaatafolder/0.103/backup/wallet.sql' [42000-200]
2022-11-14 13:58:03 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "SCRIPT TO '/mnt/c/Users/user/Documents/Oscar's work folder/Minima-dev/Minima-dev - Copy/mydaatafolder/0.103/backup/wallet.sql[*]'"; SQL statement:
SCRIPT TO '/mnt/c/Users/user/Documents/Oscar's work folder/Minima-dev/Minima-dev - Copy/mydaatafolder/0.103/backup/wallet.sql' [42000-200]
2022-11-14 13:58:03 jdbc[4]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "SCRIPT TO '/mnt/c/Users/user/Documents/Oscar's work folder/Minima-dev/Minima-dev - Copy/mydaatafolder/0.103/backup/wallet.sql[*]'"; SQL statement:
SCRIPT TO '/mnt/c/Users/user/Documents/Oscar's work folder/Minima-dev/Minima-dev - Copy/mydaatafolder/0.103/backup/wallet.sql' [42000-200]
Empty file modified scripts/multihtop.sh
100755 → 100644
Empty file.
59 changes: 54 additions & 5 deletions src/org/minima/database/MinimaDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.minima.database.wallet.Wallet;
import org.minima.system.network.p2p.P2PDB;
import org.minima.system.params.GeneralParams;
import org.minima.utils.MiniFile;
import org.minima.utils.MinimaLogger;

public class MinimaDB {
Expand Down Expand Up @@ -188,7 +189,31 @@ public void loadAllDB() {

//Set the Archive folder
File archsqlfolder = new File(basedb,"archivesql");
mArchive.loadDB(new File(archsqlfolder,"archive"));
try {

//Try and load the Archive DB
mArchive.loadDB(new File(archsqlfolder,"archive"));

// throw new Exception("TEST CRASH ARCHIVEDB!");

}catch(Exception exc) {

//Log the complete error
MinimaLogger.log(exc);

//There wqas an issue.. wipe it.. and resync..
MinimaLogger.log("ERROR loading ArchiveDB.. WIPE and RESYNC.. ");

//Close the DB
mArchive.hardCloseDB();

//Delete the ArchiveDB folder
MiniFile.deleteFileOrFolder(archsqlfolder.getAbsolutePath(), archsqlfolder);

//And reload..
mArchive = new ArchiveManager();
mArchive.loadDB(new File(archsqlfolder,"archive"));
}

//Are we Storing in a MySQL..
if(!GeneralParams.MYSQL_HOST.equals("")) {
Expand All @@ -199,14 +224,38 @@ public void loadAllDB() {
GeneralParams.MYSQL_PASSWORD);
}

//Load the SQL DB
File txpowsqlfolder = new File(basedb,"txpowsql");
try {

//Try and load the Archive DB
mTxPoWDB.loadSQLDB(new File(txpowsqlfolder,"txpow"));

// throw new Exception("TEST CRASH TXPOWDB!");

}catch(Exception exc) {

//Log the complete error
MinimaLogger.log(exc);

//There wqas an issue.. wipe it.. and resync..
MinimaLogger.log("ERROR loading TxPoWSQLDB.. WIPE and RESYNC.. ");

//Close the DB
mTxPoWDB.hardCloseSQLDB();

//Delete the ArchiveDB folder
MiniFile.deleteFileOrFolder(txpowsqlfolder.getAbsolutePath(), txpowsqlfolder);

//And reload..
mTxPoWDB = new TxPoWDB();
mTxPoWDB.loadSQLDB(new File(txpowsqlfolder,"txpow"));
}

//Load the wallet
File walletsqlfolder = new File(basedb,"walletsql");
mWallet.loadDB(new File(walletsqlfolder,"wallet"));

//Load the SQL DB
File txpowsqlfolder = new File(basedb,"txpowsql");
mTxPoWDB.loadSQLDB(new File(txpowsqlfolder,"txpow"));

//Load the MaximaDB
File maxsqlfolder = new File(basedb,"maximasql");
mMaximaDB.loadDB(new File(maxsqlfolder,"maxima"));
Expand Down
183 changes: 99 additions & 84 deletions src/org/minima/database/archive/ArchiveManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.minima.objects.base.MiniNumber;
import org.minima.system.Main;
import org.minima.system.params.GeneralParams;
import org.minima.utils.MiniFile;
import org.minima.utils.MinimaLogger;
import org.minima.utils.SqlDB;
import org.minima.utils.json.JSONObject;
Expand Down Expand Up @@ -160,6 +161,9 @@ protected void createSQL() throws SQLException {
public synchronized int getSize() {
try {

//Make sure..
checkOpen();

//Run the query
ResultSet rs = SQL_TOTAL_COUNT.executeQuery();

Expand All @@ -178,48 +182,42 @@ public synchronized int getSize() {
}

public synchronized boolean saveBlock(TxBlock zBlock) throws SQLException {
// try {

//get the MiniData version..
MiniData syncdata = MiniData.getMiniDataVersion(zBlock);

//Get the Query ready
SQL_INSERT_SYNCBLOCK.clearParameters();

//Set main params
SQL_INSERT_SYNCBLOCK.setString(1, zBlock.getTxPoW().getTxPoWID());
SQL_INSERT_SYNCBLOCK.setLong(2, zBlock.getTxPoW().getBlockNumber().getAsLong());
SQL_INSERT_SYNCBLOCK.setLong(3, System.currentTimeMillis());

//And finally the actual bytes
SQL_INSERT_SYNCBLOCK.setBytes(4, syncdata.getBytes());

//Do it.
SQL_INSERT_SYNCBLOCK.execute();
//Make sure..
checkOpen();

//get the MiniData version..
MiniData syncdata = MiniData.getMiniDataVersion(zBlock);

//Do we MySQL
if(mStoreMySQL) {
mMySQL.saveBlock(zBlock);
}

return true;

// } catch (SQLException e) {
// MinimaLogger.log(e);
// }
//
// return false;
}
//Get the Query ready
SQL_INSERT_SYNCBLOCK.clearParameters();

public synchronized TxBlock loadBlock(String zTxPoWID) {
//Set main params
SQL_INSERT_SYNCBLOCK.setString(1, zBlock.getTxPoW().getTxPoWID());
SQL_INSERT_SYNCBLOCK.setLong(2, zBlock.getTxPoW().getBlockNumber().getAsLong());
SQL_INSERT_SYNCBLOCK.setLong(3, System.currentTimeMillis());

//And finally the actual bytes
SQL_INSERT_SYNCBLOCK.setBytes(4, syncdata.getBytes());

//Are we shutting down..
if(Main.getInstance().isShuttingDown()) {
return new TxBlock(new TxPoW());
//Do it.
SQL_INSERT_SYNCBLOCK.execute();

//Do we MySQL
if(mStoreMySQL) {
mMySQL.saveBlock(zBlock);
}

return true;
}

public synchronized TxBlock loadBlock(String zTxPoWID) {

try {

//Make sure..
checkOpen();

//Set search params
SQL_FIND_SYNCBLOCK.clearParameters();
SQL_FIND_SYNCBLOCK.setString(1, zTxPoWID);
Expand Down Expand Up @@ -251,13 +249,11 @@ public synchronized TxBlock loadBlock(String zTxPoWID) {

public synchronized TxBlock loadLastBlock() {

//Are we shutting down..
if(Main.getInstance().isShuttingDown()) {
return new TxBlock(new TxPoW());
}

try {

//Make sure..
checkOpen();

//Set search params
SQL_SELECT_LAST.clearParameters();

Expand Down Expand Up @@ -288,15 +284,13 @@ public synchronized TxBlock loadLastBlock() {

public synchronized JSONObject loadLastBlockJSON() {

//Are we shutting down..
if(Main.getInstance().isShuttingDown()) {
return new JSONObject();
}

JSONObject ret = new JSONObject();

try {

//Make sure..
checkOpen();

//Set search params
SQL_SELECT_LAST.clearParameters();

Expand Down Expand Up @@ -331,6 +325,9 @@ public synchronized ArrayList<TxBlock> loadSyncBlockRange(MiniNumber zStartBlock

try {

//Make sure..
checkOpen();

//Set Search params
SQL_SELECT_SYNC_LIST.clearParameters();
SQL_SELECT_SYNC_LIST.setLong(1,zStartBlock.getAsLong());
Expand Down Expand Up @@ -384,6 +381,8 @@ public int compare(TxBlock zBlk1, TxBlock zBlk2) {
public synchronized MiniNumber exists(String zTxPoWID) {

try {
//Make sure..
checkOpen();

//Set search params
SQL_EXISTS_SYNCBLOCK.clearParameters();
Expand Down Expand Up @@ -413,6 +412,9 @@ public synchronized ArrayList<TxBlock> loadBlockRange(MiniNumber zStartBlock, Mi

try {

//Make sure..
checkOpen();

//Set Search params
SQL_SELECT_RANGE.clearParameters();
SQL_SELECT_RANGE.setLong(1,zStartBlock.getAsLong());
Expand Down Expand Up @@ -456,6 +458,9 @@ public synchronized TxBlock loadFirstBlock() {

try {

//Make sure..
checkOpen();

//Set search params
SQL_SELECT_FIRST.clearParameters();

Expand Down Expand Up @@ -486,6 +491,9 @@ public synchronized TxBlock loadFirstBlock() {

public synchronized int cleanDB() {
try {
//Make sure..
checkOpen();

//Set search params
SQL_SELECT_FIRST.clearParameters();

Expand Down Expand Up @@ -528,50 +536,57 @@ public synchronized int cleanDB() {
return 0;
}

public void hackShut() throws SQLException {
mSQLConnection.close();
}

public static void main(String[] zArgs) throws SQLException {

File testdbfolder = new File(System.getProperty("user.home"),"testfolder");
File testdb = new File(testdbfolder,"sqlsync");

//Wipe the old..
MiniFile.deleteFileOrFolder(testdbfolder.getAbsolutePath(), testdbfolder);

ArchiveManager arch = new ArchiveManager();
arch.loadDB(testdb);

//test insert..
TxPoW txp = new TxPoW();
txp.setBlockNumber(MiniNumber.ONE);
txp.setTimeMilli();
txp.calculateTXPOWID();
txp.setSuperParent(0, new MiniData("0xFFEEFF"));

arch.hackShut();

//Create a SyncBlock
TxBlock sb = new TxBlock(txp);

arch.saveBlock(sb);

arch.hackShut();

int rows = arch.getSize();

System.out.println("DB Size : "+rows);

arch.hackShut();

String txpid = sb.getTxPoW().getTxPoWID();

TxBlock lsb = arch.loadBlock(txpid);

arch.hackShut();

System.out.println("Sync Loaded : "+lsb.getTxPoW().toString());

//Load a range..
ArrayList<TxBlock> blocks = arch.loadBlockRange(MiniNumber.ZERO, MiniNumber.ONE);
System.out.println("Sync Range : "+blocks.size());

// long timenow = System.currentTimeMillis();
// System.out.println(new Date(timenow));
// long timethen = timenow - arch.MAX_SQL_MILLI;
// System.out.println(new Date(1662646695127L));

// File testdbfolder = new File(System.getProperty("user.home"),"testfolder");
// File testdb = new File(testdbfolder,"sqlsync");
//
// ArchiveManager arch = new ArchiveManager();
// arch.loadDB(testdb);
//
// //test insert..
// TxPoW txp = new TxPoW();
// txp.setBlockNumber(MiniNumber.ONE);
// txp.setTimeMilli();
// txp.calculateTXPOWID();
// txp.setSuperParent(0, new MiniData("0xFFEEFF"));
//
// //Create a SyncBlock
// TxBlock sb = new TxBlock(txp);
//
// arch.saveBlock(sb);
// arch.saveBlock(sb);
//
// int rows = arch.getSize();
//
// System.out.println("DB Size : "+rows);
//
// String txpid = sb.getTxPoW().getTxPoWID();
//
// TxBlock lsb = arch.loadBlock(txpid);
//
// System.out.println("Sync Loaded : "+lsb.getTxPoW().toString());
//
// //Load a range..
// ArrayList<TxBlock> blocks = arch.loadBlockRange(MiniNumber.ZERO, MiniNumber.ONE);
// System.out.println("Sync Range : "+blocks.size());
//
// //Shut down
// arch.saveDB();
//Shut down
arch.saveDB();
}


Expand Down
Loading