Skip to content

Instantly share code, notes, and snippets.

@ltcnodes
Last active May 31, 2018
Embed
What would you like to do?
Script we use to build our Odroid LTC nodes
#!/bin/bash
#######
# Install litecoin core and set up Odroid C2 to be a super node
# More info: https://www.LTCNodes.com / rob@ltcnodes.com
#
# This script assumes a base install of Ubuntu has been installed.
# ubuntu64-16.04.3-mate-odroid-c2-20170927.img.xz was used as an image for the Odroid C2
# available here: https://odroid.in/ubuntu_16.04lts/ubuntu64-16.04.3-mate-odroid-c2-20170927.img.xz
#
# IMPORTANT:
# Before running this script, you will want to change all instances of 'REPLACEME' below with a good password.
#
# If you find this useful, please consider a donation
# Litecoin Address: LTCNodeP2i8fAimEUgwGfvgybzAKBFj4iK
#######
# Change hostname
/bin/hostname ltcnode
sed -i 's/odroid64/ltcnode/g' /etc/hostname
# Change passwords for root and odroid users
echo "root:REPLACEME" | /usr/sbin/chpasswd
echo "odroid:REPLACEME" | /usr/sbin/chpasswd
# Install dependencies
apt-get update
apt-get -y install git autoconf libtool libdb++-dev libboost-all-dev libssl-dev libevent-dev software-properties-common apache2 libapache2-mod-php php-curl
# Uncomment to be able to enable wallet
#add-apt-repository ppa:bitcoin/bitcoin
#apt-get update
#apt-get install libdb4.8-dev libdb4.8++-dev
# Install latest stable (0.16.0 at this time)
wget https://github.com/litecoin-project/litecoin/archive/master.zip
unzip master.zip
cd litecoin-master
# Create data dir
mkdir /home/litecoin
# Add LTCNodes.com to build name
sed -i 's/CLIENT_NAME("LitecoinCore")/CLIENT_NAME("LTCNodes.com LitecoinCore")/g' ./src/clientversion.cpp
# Create the config file
cat <<EOM >/etc/litecoin.conf
rpcuser=ltcnodes
rpcpassword=REPLACEME
txindex=1
server=1
daemon=1
rpcbind=0.0.0.0
# Next line allows incoming
rpcallowip=0.0.0.0/0
bind=0.0.0.0
EOM
# Create node server shutdown command
cat <<EOM >/usr/local/bin/node-shutdown.sh
#!/bin/bash
litecoin-cli -conf=/etc/litecoin.conf stop
EOM
chmod +x /usr/local/bin/node-shutdown.sh
# Autogen, configure, make (Without wallet)
./autogen.sh
./configure --disable-wallet
# Use this configure line if you want wallet enabled
#./configure
make
make install
# Start litecoind on boot by adding it to cron
crontab -l > /tmp/mycron ; echo "@reboot /usr/local/bin/litecoind -daemon -conf=/etc/litecoin.conf -datadir=/home/litecoin/" >> /tmp/mycron ; crontab /tmp/mycron ; rm -rf /tmp/mycron
# Install Apache interface
# More info: https://github.com/ltcnodes/node-interface
cd /var/www/html/
git clone https://github.com/ltcnodes/node-interface.git
mv node-interface/* .
rm -rf ./node-interface/
mv config-example.php config.php
sed -i 's/rpcuser/ltcnodes/' config.php
sed -i 's/rpcpass/REPLACEME/' config.php
rm -rf /var/www/html/index.html
# Install Vanitygen
apt-get -y install libpcre3-dev
mkdir /home/vanity
cd /home/vanity
git clone https://github.com/samr7/vanitygen.git
cd vanitygen
make
# Reboot the node
/sbin/shutdown -r now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment