Install Litecoin

Z Poznámkový blok
Přejít na: navigace, hledání

Prvně vytvoříme soubor "Makefile"

SRC_ROOT=/usr/src
DB4DIR=/usr/local/db4
DB4VERSION=db-4.8.30.NC
DB4FILE=$(DB4VERSION).tar.gz
DB4URL=http://download.oracle.com/berkeley-db/$(DB4FILE)
DB4HASH=12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef

PACKAGES=                      \
  automake                     \
  autotools-dev                \
  bsdmainutils                 \
  build-essential              \
  libboost-chrono-dev          \
  libboost-filesystem-dev      \
  libboost-program-options-dev \
  libboost-system-dev          \
  libboost-test-dev            \
  libboost-thread-dev          \
  libevent-dev                 \
  libminiupnpc-dev             \
  libprotobuf-dev              \
  libqrencode-dev              \
  libqt5core5a                 \
  libqt5dbus5                  \
  libqt5gui5                   \
  libssl-dev                   \
  libtool                      \
  libzmq3-dev                  \
  pkg-config                   \
  protobuf-compiler            \
  qttools5-dev                 \
  qttools5-dev-tools           \

all:
	apt-get -y install $(PACKAGES)
       cd $(SRC_ROOT)
	if [ ! -d $(DB4DIR) ]; then                                                              \
		if [ ! -f $(DB4FILE) ]; then                                                     \
			wget $(DB4URL);                                                          \
		fi                                                                            && \
		echo $(DB4HASH) $(DB4FILE) | sha256sum -c                                     && \
		rm -Rf $(DB4VERSION)                                                          && \
		tar -xzvf $(DB4FILE)                                                          && \
		cd $(DB4VERSION)/build_unix/                                                  && \
		../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$(DB4DIR) && \
		mkdir -p $(DB4DIR)                                                            && \
		make install;                                                                    \
	fi
	if [ ! -d litecoin ]; then                                                               \
		git clone https://github.com/litecoin-project/litecoin.git                    && \
		cd litecoin                                                                   && \
		CURRENT=`git tag | grep -P '^v[\d\.]+$$' | sort --version-sort | tail -1`     && \
		git checkout tags/$$CURRENT -b local-$$CURRENT                                && \
		./autogen.sh                                                                  && \
		./configure --without-gui LDFLAGS="-L$(DB4DIR)/lib/" CPPFLAGS="-I$(DB4DIR)/include/";       \
	fi

install: all
	cd litecoin;     \
	  make install;  \

       LITECOIN_USER_PASSWORD=$(dd if=/dev/urandom bs=1 count=20 2>/dev/null | base64 | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
       LITECOIN_RPC_PASSWORD=$(dd if=/dev/urandom bs=1 count=20 2>/dev/null | base64 | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
         
       sudo adduser litecoin --gecos "litecoin" --disabled-password
       echo "litecoin:${LITECOIN_USER_PASSWORD}" | sudo chpasswd

	rm -rf /home/litecoin/.litecoin
	mkdir /home/litecoin/.litecoin
	echo 'daemon=1' >> /home/litecoin/.litecoin/litecoin.conf
	echo 'server=1' >> /home/litecoin/.litecoin/litecoin.conf
	echo 'gen=0' >> /home/litecoin/.litecoin/litecoin.conf
	echo 'port=9333' >> /home/litecoin/.litecoin/litecoin.conf
	echo 'rpcport=9332' >> /home/litecoin/.litecoin/litecoin.conf
	echo 'rpcallowip=127.0.0.1' >> /home/litecoin/.litecoin/litecoin.conf
	echo 'rpcuser=litecoinuser' >> /home/litecoin/.litecoin/litecoin.conf
	echo "rpcpassword=${VERTCOIN_RPC_PASSWORD}" >> /home/litecoin/.litecoin/litecoin.conf
	echo 'rpcworkqueue=300' >> /home/litecoin/.litecoin/litecoin.conf
	echo 'blockmaxsize=1000000' >> /home/litecoin/.litecoin/litecoin.conf
	echo 'mintxfee=0.00001' >> /home/litecoin/.litecoin/litecoin.conf
	echo 'minrelaytxfee=0.0001' >> /home/litecoin/.litecoin/litecoin.conf
	echo 'maxconnections=200' >> /home/litecoin/.litecoin/litecoin.conf

       ln /home/litecoin/.litecoin/litecoin.conf /home/litecoin/litecoin.conf
       chown litecoin:litecoin -R /home/litecoin/.litecoin

clean:
	rm -Rf litecoin
	rm -Rf $(DB4VERSION)
rm -f $(DB4FILE)


Spustíme jej

make -C Debian_LitecoinCore_install install