From 6d496dce71c5369ae12a844d4e815d9a37a892df Mon Sep 17 00:00:00 2001 From: poolman Date: Tue, 7 May 2019 21:13:59 +0300 Subject: [PATCH] Build embedded frontend in deployment script, not from another repository --- deployment/deploy.bash | 4 +--- deployment/leaf.bash | 49 ------------------------------------------ 2 files changed, 1 insertion(+), 52 deletions(-) delete mode 100644 deployment/leaf.bash diff --git a/deployment/deploy.bash b/deployment/deploy.bash index 073fc56..d55b639 100644 --- a/deployment/deploy.bash +++ b/deployment/deploy.bash @@ -41,9 +41,7 @@ npm install -g pm2 openssl req -subj "/C=IT/ST=Pool/L=Daemon/O=Mining Pool/CN=mining.pool" -newkey rsa:2048 -nodes -keyout cert.key -x509 -out cert.pem -days 36500 mkdir ~/pool_db/ sed -r "s/(\"db_storage_path\": ).*/\1\"\/home\/$CURUSER\/pool_db\/\",/" config_example.json > config.json -cd ~ -git clone https://github.com/mesh0000/poolui.git -cd poolui +cd ~/zano-nodejs-pool/frontend npm install ./node_modules/bower/bin/bower update ./node_modules/gulp/bin/gulp.js build diff --git a/deployment/leaf.bash b/deployment/leaf.bash deleted file mode 100644 index 3c7d5eb..0000000 --- a/deployment/leaf.bash +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -echo "This assumes that you are doing a green-field install. If you're not, please exit in the next 15 seconds." -sleep 15 -echo "Continuing install, this will prompt you for your password if you're not already running as root and you didn't enable passwordless sudo. Please do not run me as root!" -if [[ `whoami` == "root" ]]; then - echo "You ran me as root! Do not run me as root!" - exit 1 -fi -CURUSER=$(whoami) -sudo timedatectl set-timezone Etc/UTC -sudo apt-get update -sudo DEBIAN_FRONTEND=noninteractive apt-get -y upgrade -sudo DEBIAN_FRONTEND=noninteractive apt-get -y install git python-virtualenv python3-virtualenv curl ntp build-essential screen cmake pkg-config libboost-all-dev libevent-dev libunbound-dev libminiupnpc-dev libunwind8-dev liblzma-dev libldns-dev libexpat1-dev libgtest-dev libzmq3-dev -cd ~ -git clone https://github.com/Snipa22/nodejs-pool.git # Change this depending on how the deployment goes. -cd /usr/src/gtest -sudo cmake . -sudo make -sudo mv libg* /usr/lib/ -cd ~ -sudo systemctl enable ntp -cd /usr/local/src -sudo git clone https://github.com/monero-project/monero.git -cd monero -sudo git checkout v0.11.0.0 -curl https://raw.githubusercontent.com/Snipa22/nodejs-pool/master/deployment/monero_daemon.patch | sudo git apply -v -sudo make -j$(nproc) -sudo cp ~/nodejs-pool/deployment/monero.service /lib/systemd/system/ -sudo useradd -m monerodaemon -d /home/monerodaemon -BLOCKCHAIN_DOWNLOAD_DIR=$(sudo -u monerodaemon mktemp -d) -sudo -u monerodaemon wget --limit-rate=50m -O $BLOCKCHAIN_DOWNLOAD_DIR/blockchain.raw https://downloads.getmonero.org/blockchain.raw -sudo -u monerodaemon /usr/local/src/monero/build/release/bin/monero-blockchain-import --input-file $BLOCKCHAIN_DOWNLOAD_DIR/blockchain.raw --batch-size 20000 --database lmdb#fastest --verify off --data-dir /home/monerodaemon/.bitmonero -sudo -u monerodaemon rm -rf $BLOCKCHAIN_DOWNLOAD_DIR -sudo systemctl daemon-reload -sudo systemctl enable monero -sudo systemctl start monero -curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash -source ~/.nvm/nvm.sh -nvm install v8.9.3 -cd ~/nodejs-pool -npm install -npm install -g pm2 -openssl req -subj "/C=IT/ST=Pool/L=Daemon/O=Mining Pool/CN=mining.pool" -newkey rsa:2048 -nodes -keyout cert.key -x509 -out cert.pem -days 36500 -cd ~ -sudo env PATH=$PATH:`pwd`/.nvm/versions/node/v8.9.3/bin `pwd`/.nvm/versions/node/v8.9.3/lib/node_modules/pm2/bin/pm2 startup systemd -u $CURUSER --hp `pwd` -sudo chown -R $CURUSER. ~/.pm2 -echo "Installing pm2-logrotate in the background!" -pm2 install pm2-logrotate & -echo "You're setup with a leaf node! Congrats"