Merge branch 'dev' into jahway603

This commit is contained in:
jahway603
2023-10-14 22:19:07 -04:00
62 changed files with 1368 additions and 1177 deletions

View File

@@ -4,8 +4,7 @@
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
## Usages:
## ./util/build-debian-package.sh # build amd64 package
## ./util/build-debian-package.sh aarch64 # build aarch64 (ARM64) package
## ./util/build-debian-package.sh arch-type # build package for specific archiecture
## ./util/build-debian-package.sh aarch64 # build package for specific archiecture
ARCH=${1:-amd64}
echo "Let There Be Hush Debian Packages"

View File

@@ -7,16 +7,15 @@ use strict;
# Generate checkpoint data for use in src/chainparams.cpp
my $perday = 1152;
my $hush = "./src/hush-cli";
my $gethash = "$hush getblockhash";
my $cli = "./src/hush-cli";
my $stride = shift || 1000;
if ($stride =~ m/help/) {
print "To generate checkpoint data every 1000 blocks: $0 &> checkpoints.txt\n";
print "To generate checkpoint data every X blocks: $0 X &> checkpoints.txt\n";
print "To generate checkpoint data every X blocks starting at height Y: $0 X Y &> checkpoints.txt\n";
print "To generate checkpoint data every X blocks starting at height Y for -ac_name CHAIN: $0 X Y CHAIN &> checkpoints.txt\n";
exit 0;
}
unless ($stride == int($stride) and $stride >= 0) {
print "Invalid stride! Must be an integer > 0\n";
exit 1;
@@ -28,8 +27,21 @@ unless ($start_height == int($start_height) and $start_height >= 0) {
exit 1;
}
my $acname = shift;
if ($acname) {
# TODO: is acname valid?
$cli .= " -ac_name=$acname";
# HSC's by default have a blocktime of 60s
$perday = 1440;
# Dragonx has a blocktime of 36s
$perday = 2400 if ($acname == 'DRAGONX');
} else {
$acname = 'HUSH3';
}
my $gethash = "$cli getblockhash";
my $count = 0;
my $blocks = qx{$hush getblockcount};
my $blocks = qx{$cli getblockcount};
if($?) {
print "ERROR, exiting...\n";
exit 1;
@@ -53,11 +65,11 @@ while (1) {
chomp $blockhash;
print qq{($block, uint256S("0x$blockhash"))\n};
}
my $time = qx{$hush getblock $last |grep time|cut -d: -f2| sed 's/,//g'};
my $time = qx{$cli getblock $last |grep time|cut -d: -f2| sed 's/,//g'};
chomp($time);
# TODO: This is Linux-only and assumes new (not legacy) dir
my $line1 = qx{grep --text height=$prev ~/.hush/HUSH3/debug.log};
my $line2 = qx{grep --text height=$blocks ~/.hush/HUSH3/debug.log};
my $line1 = qx{grep --text height=$prev ~/.hush/$acname/debug.log};
my $line2 = qx{grep --text height=$blocks ~/.hush/$acname/debug.log};
my $txs_per_day = 2 * $perday; # default estimate is 2 txs per block, on average
my $total_txs = 0;
#print "line1: $line1\n";

View File

@@ -8,7 +8,8 @@ set -x
#hardcode and uncomment if hushd is not running on this machine
#VERSION=3.6.3
VERSION=$(./src/hushd --version|grep version|cut -d' ' -f4|cut -d- -f1|sed 's/v//g')
FILE="hush-$VERSION-linux-amd64.tar"
DIR="hush-$VERSION-linux-amd64"
FILE="$DIR.tar"
TIME=$(perl -e 'print time')
if [ -d "build" ]
@@ -17,14 +18,17 @@ then
echo "Moved existing build/ dir to build.$TIME"
fi
mkdir build
echo "Created new build/ dir"
cp contrib/asmap/asmap.dat build/
cp sapling*.params build/
BUILD="build/$DIR"
mkdir $BUILD
echo "Created new build dir $BUILD"
cp contrib/asmap/asmap.dat $BUILD
cp sapling*.params $BUILD
cd src
cp hushd hush-cli hush-tx hush-smart-chain dragonx-cli dragonxd ../build
cd ../build
cp hushd hush-cli hush-tx hush-smart-chain dragonx-cli dragonxd ../$BUILD
cd ../$BUILD
strip hushd hush-cli hush-tx
tar -f $FILE -c *
cd ..
tar -f $FILE -c hush-$VERSION-linux-amd64/*
gzip -9 $FILE
sha256sum *.gz
du -sh *.gz