From 85a1b10ccfbb5045d0cfe288fe8572aa53b25685 Mon Sep 17 00:00:00 2001 From: Uh Sado Date: Fri, 17 Aug 2018 18:27:20 -0700 Subject: [PATCH 1/3] added dag pre-generation in "gmet.sh init ..." --- metadium/scripts/gmet.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/metadium/scripts/gmet.sh b/metadium/scripts/gmet.sh index c13f7d38434d..6e17c7c1c67c 100755 --- a/metadium/scripts/gmet.sh +++ b/metadium/scripts/gmet.sh @@ -93,7 +93,13 @@ 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 & 1..." + ${GMET} makedag 0 $d/.ethash & + ${GMET} makedag 30000 $d/.ethash & + ${GMET} makedag 60000 $d/.ethash & + ${GMET} makedag 90000 $d/.ethash & + wait } function wipe () From 75a64bb14db47f63c5d4c76f3d54078e357a1f3b Mon Sep 17 00:00:00 2001 From: Uh Sado Date: Fri, 17 Aug 2018 18:29:36 -0700 Subject: [PATCH 2/3] fixed message while pre-generating dag in "gmet.sh init ..." --- metadium/scripts/gmet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadium/scripts/gmet.sh b/metadium/scripts/gmet.sh index 6e17c7c1c67c..bb929cb3f682 100755 --- a/metadium/scripts/gmet.sh +++ b/metadium/scripts/gmet.sh @@ -94,7 +94,7 @@ function init () echo "PORT=${PORT}" > $d/.rc ${GMET} --datadir $d init $d/genesis.json - echo "Generating dags for epoch 0 & 1..." + echo "Generating dags for epoch 0 to 4..." ${GMET} makedag 0 $d/.ethash & ${GMET} makedag 30000 $d/.ethash & ${GMET} makedag 60000 $d/.ethash & From 290da36d63d69466c36e231a8b00c64a0c7daed4 Mon Sep 17 00:00:00 2001 From: Uh Sado Date: Wed, 22 Aug 2018 16:40:02 -0700 Subject: [PATCH 3/3] 1. 'gmet.sh init ...' generates epoch 0 only 2. gmet.sh has start-inner command for docker demo. --- metadium/scripts/gmet.sh | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/metadium/scripts/gmet.sh b/metadium/scripts/gmet.sh index bb929cb3f682..87579ab8dedf 100755 --- a/metadium/scripts/gmet.sh +++ b/metadium/scripts/gmet.sh @@ -94,11 +94,8 @@ function init () echo "PORT=${PORT}" > $d/.rc ${GMET} --datadir $d init $d/genesis.json - echo "Generating dags for epoch 0 to 4..." + echo "Generating dags for epoch 0..." ${GMET} makedag 0 $d/.ethash & - ${GMET} makedag 30000 $d/.ethash & - ${GMET} makedag 60000 $d/.ethash & - ${GMET} makedag 90000 $d/.ethash & wait } @@ -190,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 () @@ -287,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