move stuff
This commit is contained in:
48
util/genbuild.sh
Executable file
48
util/genbuild.sh
Executable file
@@ -0,0 +1,48 @@
|
||||
#!/bin/sh
|
||||
# Copyright (c) 2018-2024 The Hush developers
|
||||
# Distributed under the GPLv3 software license, see the accompanying
|
||||
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
if [ $# -gt 1 ]; then
|
||||
cd "$2"
|
||||
fi
|
||||
if [ $# -gt 0 ]; then
|
||||
FILE="$1"
|
||||
shift
|
||||
if [ -f "$FILE" ]; then
|
||||
INFO="$(head -n 1 "$FILE")"
|
||||
fi
|
||||
else
|
||||
echo "Usage: $0 <filename> <srcroot>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DESC=""
|
||||
SUFFIX=""
|
||||
if [ -e "$(which git 2>/dev/null)" -a "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]; then
|
||||
# clean 'dirty' status of touched files that haven't been modified
|
||||
git diff >/dev/null 2>/dev/null
|
||||
|
||||
# if latest commit is tagged and not dirty, then override using the tag name
|
||||
RAWDESC=$(git describe --abbrev=0 2>/dev/null)
|
||||
if [ "$(git rev-parse HEAD)" = "$(git rev-list -1 $RAWDESC 2>/dev/null)" ]; then
|
||||
git diff-index --quiet HEAD -- && DESC=$RAWDESC
|
||||
fi
|
||||
|
||||
# otherwise generate suffix from git, i.e. string like "59887e8-dirty"
|
||||
SUFFIX=$(git rev-parse --short HEAD)
|
||||
git diff-index --quiet HEAD -- || SUFFIX="$SUFFIX-dirty"
|
||||
|
||||
fi
|
||||
|
||||
if [ -n "$DESC" ]; then
|
||||
NEWINFO="#define BUILD_DESC \"$DESC\""
|
||||
elif [ -n "$SUFFIX" ]; then
|
||||
NEWINFO="#define BUILD_SUFFIX $SUFFIX"
|
||||
else
|
||||
NEWINFO="// No build information available"
|
||||
fi
|
||||
|
||||
# only update build.h if necessary
|
||||
if [ "$INFO" != "$NEWINFO" ]; then
|
||||
echo "$NEWINFO" >"$FILE"
|
||||
fi
|
||||
9
util/test_randomx
Executable file
9
util/test_randomx
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# any CLI args given to this script will be passed along
|
||||
# example: ./test_randomx -debug=randomx
|
||||
../src/hushd -ac_randomx_interval=10 -ac_randomx_lag=3 -ac_halving=20 -ac_algo=randomx -ac_name=RANDOMX10 -ac_private=1 -ac_blocktime=20 -ac_reward=500000000 -ac_supply=55555 -gen=1 -genproclimit=1 -testnode=1 $@
|
||||
|
||||
# to run via the debugger
|
||||
# type "run" when gdb prompt appears
|
||||
#gdb --args ./src/hushd -- -ac_algo=randomx -ac_name=RANDOMX -ac_private=1 -ac_blocktime=30 -ac_reward=500000000 -ac_supply=55555 -gen=1 -genproclimit=1 -testnode=1
|
||||
Reference in New Issue
Block a user