add lamassu-install-bitcoind

This commit is contained in:
Josh Harvey 2017-04-12 19:30:19 +03:00
parent 097825f33e
commit 4f1de93715
2 changed files with 33 additions and 1 deletions

31
bin/lamassu-install-bitcoind Executable file
View file

@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -e
if [ "$(whoami)" != "root" ]; then
echo -e "This script has to be run as \033[1mroot\033[0m user"
exit 3
fi
export LOG_FILE=/tmp/install.log
ufw allow 8333/tcp >> $LOG_FILE 2>&1
CONFIG_DIR=$HOME/.bitcoin
CONFIG=$CONFIG_DIR/bitcoin.conf
mkdir -p $CONFIG_DIR
PASS=$(openssl rand -hex 32)
cat > $CONFIG <<EOF
server=1
connections=40
rpcuser=lamassu
rpcpassword=$PASS
keypool=10000
prune=4000
daemon=0
EOF
pm2 start bitcoind >> $LOG_FILE 2>&1
pm2 save >> $LOG_FILE 2>&1
echo "Success."

View file

@ -56,7 +56,8 @@
"lamassu-admin-server": "./bin/lamassu-admin-server", "lamassu-admin-server": "./bin/lamassu-admin-server",
"lamassu-apply-defaults": "./bin/lamassu-apply-defaults", "lamassu-apply-defaults": "./bin/lamassu-apply-defaults",
"hkdf": "./bin/hkdf", "hkdf": "./bin/hkdf",
"lamassu-backup-pg": "./bin/lamassu-backup-pg" "lamassu-backup-pg": "./bin/lamassu-backup-pg",
"lamassu-install-bitcoind": "./bin/lamassu-install-bitcoind"
}, },
"scripts": { "scripts": {
"test": "ava" "test": "ava"