Install Litecoin: Porovnání verzí
Z Poznámkový blok
Řádka 4: | Řádka 4: | ||
Pro instalaci postupujeme: | Pro instalaci postupujeme: | ||
+ | apt-get install make | ||
cd /usr/src | cd /usr/src | ||
git clone https://github.com/PadsterH2012/Debian_LitecoinCore_install | git clone https://github.com/PadsterH2012/Debian_LitecoinCore_install |
Verze z 27. 5. 2018, 13:12
Pro instalaci postupujeme:
apt-get install make cd /usr/src git clone https://github.com/PadsterH2012/Debian_LitecoinCore_install make -C Debian_LitecoinCore_install install
Po instalaci vytvoříme uživatele litecoin a připravíme konfig soubor:
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=${LITECOIN_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 /root/.litecoin/litecoin.conf chown litecoin:litecoin -R /home/litecoin/.litecoin
V adresáři /etc/init.d/ vytvoříme skript pro spuštění Litecoinu:
nano /etc/int.d/litecoind
Do něž vložíme:
#!/bin/bash ### BEGIN INIT INFO # Provides: litecoin # Required-Start: $local_fs $remote_fs $network $time # Required-Stop: $local_fs $remote_fs $network $time # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: vertcoind ### END INIT INFO start() { echo "starting lotecoin" /sbin/runuser -l litecoin -c '/usr/bin/screen -L -S litecointd -m -d /usr/local/bin/litecoind --server -printtoconsole' sleep 5 echo "litecoind started with PID of $(ps fax | grep litecoind | grep -v grep | head -1 | awk '{print $1}')" echo "started litecoind ["$(tput setaf 2)OK$(tput sgr0)"]" } stop() { echo "stopping litecoind" /sbin/runuser -l litecoin -c '/usr/bin/screen -X -S litecoind quit' sleep 2 echo "vlitecoind stopped ["$(tput setaf 2)OK$(tput sgr0)"]" } case "$1" in start) start ;; stop) stop;; *) echo "usage $0 start|stop" >&2 exit 1 ;; esac
Zajistíme aby se skript spuštěl při startu.
chmod a+x /etc/init.d/litecoind update-rc.d litecoind defaults
Povoleni firevalu:
sudo iptables -I INPUT 1 -j ACCEPT -p tcp --dport 5555 # Litecoin p2pool second network - for the miner sudo iptables -I INPUT 1 -j ACCEPT -p tcp --dport 9333 # Litecoin sudo iptables -I INPUT 1 -j ACCEPT -p tcp --dport 9332 # Litecoin rpc (Local)