From 6cd1a74e1b3d79ccfb1b6c1bd9beb941e6485427 Mon Sep 17 00:00:00 2001
From: phahulin
Date: Sat, 8 Jul 2017 20:30:50 +0300
Subject: [PATCH] Run chain-explorer via pm2
---
TestTestNet/bootnode/install.sh | 45 ++++++++++++++++++++++++++-------
1 file changed, 36 insertions(+), 9 deletions(-)
diff --git a/TestTestNet/bootnode/install.sh b/TestTestNet/bootnode/install.sh
index f1a024b..246bf61 100644
--- a/TestTestNet/bootnode/install.sh
+++ b/TestTestNet/bootnode/install.sh
@@ -239,11 +239,11 @@ EOF
echo "<===== install_netstats"
}
-install_etherchain() {
- echo "=====> install_etherchain"
- git clone https://github.com/gobitfly/etherchain-light
- git clone https://github.com/ethereum/solc-bin etherchain-light/utils/solc-bin
- cd etherchain-light
+install_chain_explorer() {
+ echo "=====> install_chain_explorer"
+ git clone https://github.com/oraclesorg/chain-explorer
+ git clone https://github.com/ethereum/solc-bin chain-explorer/utils/solc-bin
+ cd chain-explorer
npm install
cat > config.js < explorer.start < ../logs/explorer.out 2> ../logs/explorer.err"
+#EOF
+
+ cat > app.json << EOF
+[
+ {
+ "name" : "explorer",
+ "script" : "./bin/www",
+ "log_date_format" : "YYYY-MM-DD HH:mm:SS Z",
+ "error_file" : "/home/${ADMIN_USERNAME}/logs/explorer.err",
+ "out_file" : "/home/${ADMIN_USERNAME}/logs/explorer.out",
+ "merge_logs" : false,
+ "watch" : false,
+ "max_restarts" : 100,
+ "exec_interpreter" : "node",
+ "exec_mode" : "fork_mode",
+ "env":
+ {
+ "NODE_ENV" : "production",
+ "PORT": : 4000,
+ }
+ }
+]
EOF
cd ..
- apt-get install -y dtach
cat > explorer.start < ../logs/explorer.out 2> ../logs/explorer.err"
+cd chain-explorer
+pm2 startOrRestart app.json
+cd ..
EOF
chmod +x explorer.start
sudo -u root -E -H ./explorer.start
- echo "<===== install_etherchain"
+ echo "<===== install_chain_explorer"
}
start_docker() {
@@ -346,7 +373,7 @@ main () {
install_dashboard
install_netstats
- install_etherchain
+ install_chain_explorer
}
main