mynode/setup/setup_image_free_layer_2.txt
2019-06-15 18:02:44 -05:00

63 lines
1.7 KiB
Plaintext

###
### Setup myNode Free
### Start with <device>_free_layer_1.img
###
##################################################################
# Log in as admin
# More pip install on top of base image
sudo pip3 install requests
# Install Bitcoin
mkdir -p /tmp/download
cd /tmp/download
ARCH="arm-linux-gnueabihf"
uname -a | grep aarch64
if [ $? = 0 ]; then
ARCH="aarch64-linux-gnu"
fi
BTC_UPGRADE_URL=https://bitcoin.org/bin/bitcoin-core-0.18.0/bitcoin-0.18.0-$ARCH.tar.gz
BTC_UPGRADE_URL_FILE=/home/bitcoin/.mynode/.btc_url
wget $BTC_UPGRADE_URL -O bitcoin.tar.gz
tar -xvf bitcoin.tar.gz
mv bitcoin-* bitcoin
sudo install -m 0755 -o root -g root -t /usr/local/bin bitcoin/bin/*
bitcoind --version
sudo su - bitcoin
ln -s /mnt/hdd/mynode/bitcoin /home/bitcoin/.bitcoin
ln -s /mnt/hdd/mynode/lnd /home/bitcoin/.lnd
exit
mkdir /home/admin/.bitcoin
sudo mkdir -p /home/bitcoin/.mynode/
echo $BTC_UPGRADE_URL | sudo tee $BTC_UPGRADE_URL_FILE
sudo chown -R bitcoin:bitcoin /home/bitcoin/.mynode/
# Install Lightning
mkdir -p /tmp/download
cd /tmp/download
LND_UPGRADE_URL=https://github.com/lightningnetwork/lnd/releases/download/v0.6.1-beta/lnd-linux-armv7-v0.6.1-beta.tar.gz
LND_UPGRADE_URL_FILE=/home/bitcoin/.mynode/.lnd_url
wget $LND_UPGRADE_URL -O lnd.tar.gz
tar -xzf lnd.tar.gz
mv lnd-* lnd
sudo install -m 0755 -o root -g root -t /usr/local/bin lnd/*
sudo ln -s /bin/ip /usr/bin/ip
lnd --version
echo $LND_UPGRADE_URL | sudo tee $LND_UPGRADE_URL_FILE
cd ~
sudo chown -R bitcoin:bitcoin /home/bitcoin/.mynode/
sync
### MAKE IMAGE NOW ###
# This prevents auto gen files like certs to be part of the base image
# Must make sure image can boot after this point and fully come up
# Reboot again
sudo reboot