Skip to content

Commit

Permalink
Merged in coinplugin/go-metadium (pull request #5)
Browse files Browse the repository at this point in the history
Master

Approved-by: Uh Sado <sadoc@metadium.com>
  • Loading branch information
sadoci committed Aug 22, 2018
2 parents a70d3e8 + 290da36 commit 12637f5
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions metadium/scripts/gmet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ function init ()
[ $? = 0 ] || return $?

echo "PORT=${PORT}" > $d/.rc
${GMET} --datadir ${PWD} init $d/genesis.json
${GMET} --datadir $d init $d/genesis.json
echo "Generating dags for epoch 0..."
${GMET} makedag 0 $d/.ethash &
wait
}

function wipe ()
Expand Down Expand Up @@ -184,11 +187,22 @@ function start ()
METADIUM_OPTS="--consensusmethod ${CONSENSUS_METHOD} --fixedgaslimit ${FIXED_GAS_LIMIT} --maxidleblockinterval ${MAX_IDLE_BLOCK_INTERVAL} --blocksperturn ${BLOCKS_PER_TURN} --metadiumabi ${METADIUM_ABI}"

cd $d
$GMET --datadir ${PWD} --ethash.dagdir ${PWD}/.ethash --nodiscover \
${CHAIN_ID_OPT} ${MINE_OPT} --metrics ${PORT_OPT} ${RPC_PORT_OPT} \
${TXPOOL_OPTS} ${TARGET_GAS_LIMIT_OPT} ${METADIUM_OPTS} \
--gasprice ${GAS_PRICE} ${RCJS} 2>&1 \
| ${LOGROT} ${d}/logs/log 10M 5 &
if [ ! "$2" = "inner" ]; then
$GMET --datadir ${PWD} --ethash.dagdir ${PWD}/.ethash \
--nodiscover ${CHAIN_ID_OPT} ${MINE_OPT} --metrics \
${PORT_OPT} ${RPC_PORT_OPT} ${TXPOOL_OPTS} \
${TARGET_GAS_LIMIT_OPT} ${METADIUM_OPTS} \
--gasprice ${GAS_PRICE} ${RCJS} 2>&1 \
| ${LOGROT} ${d}/logs/log 10M 5 &
else
exec > >(${LOGROT} ${d}/logs/log 10M 5)
exec 2>&1
exec $GMET --datadir ${PWD} --ethash.dagdir ${PWD}/.ethash \
--nodiscover ${CHAIN_ID_OPT} ${MINE_OPT} --metrics \
${PORT_OPT} ${RPC_PORT_OPT} ${TXPOOL_OPTS} \
${TARGET_GAS_LIMIT_OPT} ${METADIUM_OPTS} \
--gasprice ${GAS_PRICE} ${RCJS}
fi
}

function start_all ()
Expand Down Expand Up @@ -281,6 +295,14 @@ case "$1" in
fi
;;

"start-inner")
if [ "$2" = "" ]; then
usage;
else
start $2 inner
fi
;;

"restart")
if [ ! "$2" = "" ]; then
$0 stop $2
Expand Down

0 comments on commit 12637f5

Please sign in to comment.