Skip to content

Commit

Permalink
Upgrade MMGen to tag version btc_bch; mmlive-node-start,-stop changes
Browse files Browse the repository at this point in the history
* mmlive-node-start: start BCH node with non-standard RPC ports (8442,18442)
  for seamless integration with MMGen scripts.
* new command: mmlive-node-stop
* upgrade MMGen to 'btc_bch' tag version supporting new --coin option and
  correct display of 'BCH' for BCH amounts.
  • Loading branch information
mmgen committed Aug 4, 2017
1 parent 9a9ca20 commit 03633c9
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 20 deletions.
4 changes: 3 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
## ChangeLog

### v0.0.7o
+ Upgrade MMGen to btc_bch tag version

### v0.0.7n
+ Upgrade MMGen to aug1hf tag version
+ Install Bitcoin ABC client with disclaimer

### v0.0.7m
Expand Down
23 changes: 16 additions & 7 deletions home.mmgen/bin/mmlive-node-start
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ TW_FILE='mmgen-tracking-wallet.dat'
DB_CACHE_ARG=
NOLISTEN_ARG=' -listen=0'

while getopts hAa:d:JKos:tTU OPT
while getopts hAa:d:eJKos:tTU OPT
do
case "$OPT" in
h) printf " %-16s Start an MMGen Bitcoin Core node\n" "${PROGNAME^^}:"
h) printf " %-16s Stop a Bitcoin daemon\n" "${PROGNAME^^}:"
echo " USAGE: $PROGNAME"
echo " OPTIONS: '-h' Print this help message"
echo " '-a a' Additional args to be passed to bitcoind (as one arg, quoted)"
echo " '-A' Run the Bitcoin ABC hard-fork client"
echo " '-d c' Set the -dbcache value to 'c' (default: dynamic, based on available memory)"
echo " '-e Run a testnet node"
echo " '-o' Start in offline mode"
echo " '-s n' Try connecting to node 'n'"
echo " '-t' Testing mode. Just print the command that would be executed"
Expand All @@ -24,24 +25,32 @@ do
echo " '-K' Run the Bitcoin ABC client for a dual-node setup (reduced memory, ports 8443/8442)"
exit ;;
a) ADD_ARGS+=" $OPTARG" ;;
K) TWO_DAEMONS=1 ADD_ARGS+=" --bind=127.0.0.1:8443 --rpcbind=localhost:8442 --rpcallowip=127.0.0.1" ;;&
e) TESTNET=1 ADD_ARGS+=" --testnet=1" ;;
K) TWO_DAEMONS=1 ;;&
K|A) echo 'Running Bitcoin ABC hard-fork (BCH) client!'
TW_FILE='mmgen-tracking-wallet-abc.dat'
ADD_ARGS+=" -datadir=$HOME/.bitcoin-abc" EXEC_SUF='-abc' ;;
TW_FILE='mmgen-tracking-wallet-bch.dat'
ABC_ARGS+=" -datadir=$HOME/.bitcoin-abc --rpcbind=127.0.0.1:8442 --rpcallowip=127.0.0.1"
ABC=1 EXEC_SUF='-abc' ;;
d) DB_CACHE_ARG=" -dbcache=$OPTARG" ;;
o) ADD_ARGS+=" -maxconnections=0" ;;
s) ADD_ARGS+=" -addnode=$OPTARG" ;;
t) TESTING=1 ;;
J) TWO_DAEMONS=1 ;;&
J|U) echo 'Running BIP148-UASF-enforcing client!'
EXEC_SUF='-uasfsegwit1.0' ;;
T) ADD_ARGS+=" -onlynet=onion -debug=tor" NOLISTEN_ARG= ;;
T) TOR=1 ADD_ARGS+=" -onlynet=onion -debug=tor" NOLISTEN_ARG= ;;
*) exit ;;
esac
done

shift $((OPTIND-1))

[ "$TOR" -a "$ABC" ] && ADD_ARGS+=" --bind=127.0.0.1:8443"
[ "$TESTNET" -a "$ABC" ] && {
ABC_ARGS=" -datadir=$HOME/.bitcoin-abc --rpcbind=127.0.0.1:18442 --rpcallowip=127.0.0.1"
}

# ADD_ARGS+=" --bind=127.0.0.1:8443"
if [ ! "$DB_CACHE_ARG" ]; then
M=$(cat /proc/meminfo | grep MemAvailable | awk '{ print $2 }')
M=$(((M / 1024) - 3000))
Expand All @@ -51,7 +60,7 @@ if [ ! "$DB_CACHE_ARG" ]; then
[ "$M" ] && DB_CACHE_ARG=" -dbcache=$M"
fi

CMD="bitcoind$EXEC_SUF -daemon -wallet=$TW_FILE$DB_CACHE_ARG$NOLISTEN_ARG$ADD_ARGS"
CMD="bitcoind$EXEC_SUF -daemon -wallet=$TW_FILE$DB_CACHE_ARG$NOLISTEN_ARG$ADD_ARGS$ABC_ARGS"
if [ "$TESTING" ]; then MSG='Would execute'; else MSG='Executing'; fi
echo "$MSG: $CMD"
[ ! "$TESTING" ] && eval $CMD
34 changes: 34 additions & 0 deletions home.mmgen/bin/mmlive-node-stop
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

PROGNAME=`basename $0`
DESC='Bitcoin Core'

while getopts hAet OPT
do
case "$OPT" in
h) printf " %-16s Stop an MMGen bitcoind node\n" "${PROGNAME^^}:"
echo " USAGE: $PROGNAME"
echo " OPTIONS: '-h' Print this help message"
echo " '-e' Stop a testnet node"
echo " '-A' Stop the Bitcoin ABC hard-fork client"
echo " '-t' Testing mode. Just print the command that would be executed"
exit ;;
A) ABC=1 DESC='Bitcoin ABC hard-fork (BCH)' PORT_ARG=' --rpcport=8442' ;;
e) TESTNET=1 ADD_ARGS+=' --rpcconnect=127.0.0.1' PORT_ARG=' --rpcport=18332' ;;
t) TESTING=1 ;;
*) exit ;;
esac
done

shift $((OPTIND-1))

[ "$TESTNET" -a "$ABC" ] && PORT_ARG=' --rpcport=18442'

CMD="bitcoin-cli$ADD_ARGS$PORT_ARG stop"

if [ "$TESTING" ]; then
echo "Would execute: $CMD"
else
echo "Stopping the $DESC client!"
eval $CMD
fi
12 changes: 0 additions & 12 deletions upgrade/0.0.7/upgrade-n.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
#!/bin/bash
#:REV: 0.0.7n
#:DESC: Upgrade MMGen to aug1hf tag version
#:DESC: Install Bitcoin ABC client with disclaimer

set -e

function upgrade_mmgen {
echo "Upgrading MMGen to version '$VER'"
(
cd /setup/git/MMGenLive/
eval "$BUILD_SYSTEM chroot_install_mmgen_user_at_commit 'IN_MMLIVE_SYSTEM=1' 'MMGEN_COMMIT=$VER'"
)
}

VER='aug1hf'
[ -d ~mmgen/src/mmgen-$VER ] || upgrade_mmgen

VERSION='0.14.6'
SUBVERSION='-abc'
CHKSUM='9f37b8ec36a37944b016bbbf07340adb8ba644abb897b2d2e0edeb99ccf709c0'
Expand Down
18 changes: 18 additions & 0 deletions upgrade/0.0.7/upgrade-o.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
#:REV: 0.0.7o
#:DESC: Upgrade MMGen to btc_bch tag version

set -e

function upgrade_mmgen {
echo "Upgrading MMGen to version '$VER'"
(
cd /setup/git/MMGenLive/
eval "$BUILD_SYSTEM chroot_install_mmgen_user_at_commit 'IN_MMLIVE_SYSTEM=1' 'MMGEN_COMMIT=$VER'"
)
}

VER='btc_bch'
[ -d ~mmgen/src/mmgen-$VER ] || upgrade_mmgen

exit 0

0 comments on commit 03633c9

Please sign in to comment.