From eff74badf07d7686e08a5bdb5578f9d6fd2b7f66 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Robert=20Martin-Leg=C3=A8ne?= <robert@nic.ar>
Date: Mon, 30 Jul 2018 18:19:38 -0300
Subject: [PATCH] Adding maymine

---
 bin/maymine.js |  4 ----
 bin/maymine.sh |  2 +-
 bin/start.sh   |  3 ++-
 src/js.maymine | 10 ++++++++++
 4 files changed, 13 insertions(+), 6 deletions(-)
 delete mode 100644 bin/maymine.js
 create mode 100644 src/js.maymine

diff --git a/bin/maymine.js b/bin/maymine.js
deleted file mode 100644
index cb05823..0000000
--- a/bin/maymine.js
+++ /dev/null
@@ -1,4 +0,0 @@
-var signer
-signer = (clique.getSigners().indexOf(eth.accounts[0]) > -1)
-if (signer) miner.start() else miner.stop()
-console.log( signer )
diff --git a/bin/maymine.sh b/bin/maymine.sh
index 1a180f4..953201d 100755
--- a/bin/maymine.sh
+++ b/bin/maymine.sh
@@ -4,7 +4,7 @@
 if [ -z "${BFAHOME}" ]; then echo "\$BFAHOME not set. Did you source bfa/bin/env ?" >&2; exit 1; fi
 source ${BFAHOME}/bin/libbfa.sh || exit 1
 
-res=$( geth_execjs "${BFAHOME}/bin/maymine.js" )
+res=$( geth_exec_js "${BFAHOME}/src/js.maymine" )
 
 if [ "$res" = "true" ]
 then
diff --git a/bin/start.sh b/bin/start.sh
index 1fd7c88..9fcdbc4 100755
--- a/bin/start.sh
+++ b/bin/start.sh
@@ -35,7 +35,7 @@ function miner
 {
     if [ -e "${BFANODEDIR}/miner" ]
     then
-	echo -- "--miner"
+	echo "--mine"
     fi
 }
 
@@ -73,6 +73,7 @@ function miner
             --txpool.accountqueue 512       \
             --txpool.globalqueue 8192       \
             --extradata "${BFAEXTRADATA}"   \
+            --gcmode archive                \
 	    --cache 512		            \
 	    --verbosity 3			&
         set +x
diff --git a/src/js.maymine b/src/js.maymine
new file mode 100644
index 0000000..d1857d7
--- /dev/null
+++ b/src/js.maymine
@@ -0,0 +1,10 @@
+// vim:syntax:filetype=javascript:ai:sm
+// vim:expandtab:backspace=indent,eol,start:softtabstop=4
+
+var signer
+signer = (clique.getSigners().indexOf(eth.accounts[0]) > -1)
+if (signer)
+    miner.start()
+else
+    miner.stop()
+signer
-- 
GitLab