add lamassu-install-bitcoind
This commit is contained in:
parent
097825f33e
commit
4f1de93715
2 changed files with 33 additions and 1 deletions
31
bin/lamassu-install-bitcoind
Executable file
31
bin/lamassu-install-bitcoind
Executable 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."
|
||||
Loading…
Add table
Add a link
Reference in a new issue