Skip to content

Instantly share code, notes, and snippets.

Last active Jun 24, 2019
What would you like to do?
install clam on Ubuntu 18.10
#curl -L | sh
sudo /etc/init.d/clamd stop
cd ~
mkdir dev
cd dev
rm -rf "clam-$CLAMVERSION/"
curl -L "$CLAMVERSION/clam-$CLAMVERSION-linux64.tar.gz" | tar xvz
cd "clam-$CLAMVERSION/bin"
#setup config
#backup any clam data dirs
cd ~
mv ~/.clam ~/.clam-backup-$(date +%s)
cd ~/.clam/
#install rtorrent
curl -L > ${CLAM_DATA_DIR}/bootstrap.torrent
sudo apt-get install -y rtorrent tmux
#config rtorrent
rm -rf ~/.rtsession
mkdir ~/.rtsession
echo "directory = ${CLAM_DATA_DIR}" > ~/.rtorrent.rc
echo "session = ${USER_HOME_DIR}/.rtsession" >> ~/.rtorrent.rc
echo "schedule = watch_directory_1,10,10,\"load.start_verbose=${CLAM_DATA_DIR}/*.torrent,${CLAM_DATA_DIR}/\"" >> ~/.rtorrent.rc
echo "method.set_key =,clam_touchdown,\"execute=touch,${CLAM_DATA_DIR}/touched\"" >> ~/.rtorrent.rc
echo "port_random = yes" >> ~/.rtorrent.rc
echo "check_hash = yes" >> ~/.rtorrent.rc
echo "dht = auto" >> ~/.rtorrent.rc
echo "dht_port = 6881" >> ~/.rtorrent.rc
#download the bootstrap.dat file
tmux new-session -s rtorrent -d rtorrent
echo downloading bootstrap.dat ..
echo via
echo run -:{
echo tmux a -t rtorrent
echo }:- to watch download
while [ ! -f ${CLAM_DATA_DIR}/touched ]; do sleep 10; done
echo bootstrap.dat download complete
#generate rpc password
echo generating secure password ..
CLAM_RPC_PASS=$(curl -L | bash)
#setup rpc
echo "rpcuser=clamrpc" > ${CLAM_DATA_DIR}/clam.conf
echo "rpcpassword=${CLAM_RPC_PASS}" >> ${CLAM_DATA_DIR}/clam.conf
#provide more useful logs
echo "logtimestamps=1" >> ${CLAM_DATA_DIR}/clam.conf
#help combat blockchain spam attack
echo "mininput=0.01" >> ${CLAM_DATA_DIR}/clam.conf
#setup good settings for staking
echo "combineany=1" >> ${CLAM_DATA_DIR}/clam.conf
echo "splitsize=45" >> ${CLAM_DATA_DIR}/clam.conf
#let the user know what the settings are
echo "${CLAM_DATA_DIR}/clam.conf"
cat ${CLAM_DATA_DIR}/clam.conf
#daemonize clam and run clam on startup
sudo touch /etc/init.d/clamd
curl -L > ~/._tmpclamd
echo "sudo -u ${USER} nohup ${CLAMD} >> /dev/null &" >> ~/._tmpclamd
curl -L >> ~/._tmpclamd
sudo chown root ~/._tmpclamd
sudo mv ${USER_HOME_DIR}/._tmpclamd /etc/init.d/clamd
sudo chmod 755 /etc/init.d/clamd
sudo update-rc.d clamd defaults
cat /etc/init.d/clamd
#install 751 hotfix
curl -L | sh
#start the clam client
sudo /etc/init.d/clamd start
#start the 751 hotfix
sudo /etc/init.d/clamd751 start
echo install finished!
echo clam is running, to view logs type:
echo tail -f ${CLAM_DATA_DIR}/debug.log
echo and
echo tail -f ${CLAM_DATA_DIR}/751debug.log
echo you can now reboot the system with
echo sudo reboot
echo clamd will now start at bootup with 751 hotfix enabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment