Skip to content
This repository has been archived by the owner on Feb 9, 2019. It is now read-only.

Commit

Permalink
New Release: 2.0.4
Browse files Browse the repository at this point in the history
- bugfixes in solo mining capability
- async/sync repairs for frontend (due to new jQuery)
- mariaDB/H2 bootstrap handling in burst.sh (Unix)
- DB robustness (ensuring InnoDB)
  • Loading branch information
rico666 committed Apr 9, 2018
1 parent 9aebed4 commit c9eaeae
Show file tree
Hide file tree
Showing 11 changed files with 119 additions and 39 deletions.
74 changes: 74 additions & 0 deletions burst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ MY_SELF=$0
MY_CMD=$1
MY_ARG=$2

MY_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

function usage() {
cat << EOF
usage: $0 [command] [arguments]
Expand All @@ -14,6 +16,7 @@ usage: $0 [command] [arguments]
help shows the help you just read
compile compile jar and create docs using maven
upgrade upgrade the config files to BRS format
import [mariadb|h2] DELETE current DB, then gets a new mariadb or H2
EOF
}

Expand Down Expand Up @@ -132,6 +135,18 @@ function upgrade_conf () {
fi
}

function exists_or_get {
if [ -f $1 ]; then
echo "$1 already present - won't download"
else
if ! hash wget 2>/dev/null; then
echo "please install wget"
exit 99
fi
wget https://download.cryptoguru.org/burst/wallet/$1
fi
}

if [ -z `which java 2>/dev/null` ]; then
echo "please install java from eg. https://java.com/download/"
exit 1
Expand Down Expand Up @@ -176,6 +191,65 @@ if [[ $# -gt 0 ]] ; then
upgrade_conf nxt-default.properties
upgrade_conf nxt.properties
;;
"import")
if ! hash unzip 2>/dev/null; then
echo "please install unzip"
exit 99
fi
read -p "Do you want to remove the current databases, download and import new one? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
if [[ $2 == "mariadb" ]]; then
echo
echo "Please enter your connection details"
read -rp "Host (localhost) : " P_HOST
read -rp "Database (brs_master): " P_DATA
read -rp "Username (brs_user) : " P_USER
read -rsp "Password empty : " P_PASS
[ -z $P_HOST ] && P_HOST="localhost"
[ -z $P_USER ] && P_USER="brs_user"
[ -z $P_DATA ] && P_DATA="brs_master"
[ -z $P_PASS ] || P_PASS="-p$P_PASS"
echo

if exists_or_get brs.mariadb.zip ; then
if unzip brs.mariadb.zip ; then
if mysql -u$P_USER $P_PASS -h$P_HOST -e "DROP DATABASE if EXISTS $P_DATA; CREATE DATABASE $P_DATA CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"; then
if mysql -u$P_USER $P_PASS -h$P_HOST -D $P_DATA < "$MY_DIR/init-mysql.sql"; then
if mysql -u$P_USER $P_PASS -h$P_HOST -D $P_DATA < brs.mariadb.sql ; then
echo "import successful - please remove brs.mariadb.zip"
rm brs.mariadb.sql
exit
fi
fi
fi
else
echo "unpacking mariadb archive failed"
fi
else
echo "getting mariadb archive failed"
fi
elif [[ $2 == "h2" ]]; then
if exists_or_get brs.h2.zip ; then
mkdir -p "$MY_DIR/burst_db"
rm -f burst_db/burst.trace.db
if unzip brs.h2.zip ; then
if mv burst.mv.db "$MY_DIR/burst_db"; then
echo "import successful - please remove brs.h2.zip"
exit
fi
else
echo "unpacking H2 archive failed"
fi
else
echo "getting H2 archive failed"
fi
fi
echo "DB import did not succeed"
else
echo "cancelling DB import by user request"
fi
;;
"h2shell")
java -cp burst.jar org.h2.tools.Shell
;;
Expand Down
2 changes: 1 addition & 1 deletion html/ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@
</ul>
</li>
<li class="treeview" id="sidebar_crowdfunding">
<a href="#" class="crowdfunding-link-active" data-page="crowdfunding"><i class="fa fa-money"></i> <span data-i18n="crowdfunding_page">Crowdfunding</span><i class="fa pull-right fa-angle-right" style="padding-top:3px"></i></a>
<a href="#" data-page="crowdfunding"><i class="fa fa-money"></i> <span data-i18n="crowdfunding_page">Crowdfunding</span><i class="fa pull-right fa-angle-right" style="padding-top:3px"></i></a>
<ul class="treeview-menu" style="display: none;">
<li><a href="#" class="crowdfunding-link-active"><i class="glyphicon glyphicon-flash"></i> Active</a></li>
<li><a href="#" class="crowdfunding-link-funded"><i class='glyphicon glyphicon-ok-circle'></i> Funded</a></li>
Expand Down
2 changes: 1 addition & 1 deletion html/ui/js/brs.contacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ var BRS = (function(BRS, $, undefined) {
BRS.exportContacts = function() {
if (BRS.contacts && (Object.keys(BRS.contacts).length > 0)) {
var contacts_download = document.createElement('a');
contacts_download.href = 'data:attachment/json,' + JSON.stringify( BRS.contacts );
contacts_download.href = 'data:attachment/json,' + encodeURIComponent(JSON.stringify( BRS.contacts ));
contacts_download.target = '_blank';
contacts_download.download = 'contacts.json';
document.body.appendChild(contacts_download);
Expand Down
16 changes: 13 additions & 3 deletions html/ui/js/brs.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,24 @@ var BRS = (function(BRS, $, undefined) {
if (requestType == "broadcastTransaction") {
type = "POST";
}

async = (async === undefined ? true : async);
if(async == false){
url += "&" + $.param(data);
var client = new XMLHttpRequest();
client.open("GET", url, false);
client.setRequestHeader("Content-Type", "text/plain;charset=UTF-8");
client.data = data;
client.send();
var response = JSON.parse(client.responseText);
callback(response,data);
}else{
ajaxCall({
url: url,
crossDomain: true,
dataType: "json",
type: type,
timeout: 30000,
async: (async === undefined ? true : async),
async: true,
currentPage: currentPage,
currentSubPage: currentSubPage,
shouldRetry: (type == "GET" ? 2 : undefined),
Expand Down Expand Up @@ -427,7 +437,7 @@ var BRS = (function(BRS, $, undefined) {
}
});
}

}
BRS.verifyAndSignTransactionBytes = function(transactionBytes, signature, requestType, data) {
var transaction = {};

Expand Down
4 changes: 2 additions & 2 deletions html/ui/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@
"error_server_connect": "Impossible de se connecter au serveur.",
"error_dgs_listing": "Une erreur inconnue s'est produite ! L'annonce sur le marché pourrait ne pas avoir été créée.",
"error_asset_or_account_id_required": "L'ID du compte ou de l'actif est obligatoire.",
"x_confirmations": "__X__ confirmations",
"x_confirmations": "__x__ confirmations",
"error_amount_price_required": "Veuillez indiquer un montant et un prix.",
"total_memory": "Mémoire totale",
"confirm_order_cancellation": "Confirmer l'annulation de la commande",
Expand Down Expand Up @@ -636,7 +636,7 @@
"error_create_poll": "Une erreur inconnue s'est produite ! L'actif pourrait ne pas avoir été créé.",
"no_account_q_create_account": "Vous n'avez pas encore de compte ? Cliquez ici pour en créer un !",
"Bid Order": "Ordre d'achat",
"x_lessor_lease_plural": "__X__ bailleurs vous ont confié leur solde effectif.",
"x_lessor_lease_plural": "__x__ bailleurs vous ont confié leur solde effectif.",
"show_console_log_button": "Afficher le bouton de la console de log",
"delete_my_item": "Supprimer mon article",
"stop_forging_confirmation_passphrase": "Si vous êtes sûr de vouloir arrêter de forger, entrez votre phrase de passe pour confirmer.",
Expand Down
6 changes: 0 additions & 6 deletions init-mysql.sql
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
DROP DATABASE if EXISTS brs_master;
CREATE DATABASE brs_master
CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
USE brs_master;


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>burstcoin</groupId>
<artifactId>burstcoin</artifactId>
<version>2.0.3</version>
<version>2.0.4</version>
<name>Burstcoin Reference Software</name>
<url>https://github.com/PoC-Consortium/burstcoin</url>

Expand Down
1 change: 1 addition & 0 deletions src/brs/BlockchainProcessorImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,7 @@ public void generateBlock(String secretPhrase, byte[] publicKey, Long nonce)
block.sign(secretPhrase);
blockService.setPrevious(block, previousBlock);
try {
blockService.preVerify(block);
pushBlock(block);
blockListeners.notify(block, Event.BLOCK_GENERATED);
logger.debug("Account " + Convert.toUnsignedLong(block.getGeneratorId()) + " generated block "
Expand Down
2 changes: 1 addition & 1 deletion src/brs/Burst.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

public final class Burst {

public static final String VERSION = "2.0.3";
public static final String VERSION = "2.0.4";
public static final String APPLICATION = "BRS";
public static final String LEGACY_APP = "NRS";
public static final String LEGACY_VER = "1.2";
Expand Down
Loading

0 comments on commit c9eaeae

Please sign in to comment.