Post
Topic
Board Beginners & Help
Re: Bitcoin node - VPN or Tor
by
predic
on 30/06/2017, 08:11:34 UTC
using tor is better option.

if you want tor or bitcoin-cli or bitcoind to start automatically when ubuntu restart, you can try this:
sudo systemctl enable tor.service or update-rc.d tor enable
here is the way to start up bitcoind automatically if your ubuntu restarts/reboot:
Configuration files for upstart are stored under /etc/init/*.conf. this one is for bitcoind:
https://github.com/bitcoin/bitcoin/blob/2d782ab2ce30bf106e34cd3288c9082ac04022f9/contrib/init/bitcoind.conf
so, it should be in your computer here: /etc/init/bitcoind.conf
then run: sudo initctl reload-configuration
sudo service bitcoind start

but generally if you use linux, you can also prevent any process, including bitcoin-cli, to overtake consumption of your CPU and block your computer.

cpulimit is a simple program which attempts to limit the cpu usage of a process (expressed in percentage, not in cpu time).

I just used in debian:  sudo apt-get install cpulimit
but if you can't get it, then:
wget -O cpulimit.zip https://github.com/opsengine/cpulimit/archive/master.zip
unzip and cd cpulimit-xxx
./configure
make
then maybe you need to copy it to /usr/bin

use top or htop to list all processes and find bitcoin-cli, let's say PID is 1234
cpulimit command is:
cpulimit -p 1234 -l 50
this means, bitcoin can use maximum 50% of your CPU.
you can use also the name of the process:
cpulimit -e bitcoin-cli -l 50

you can use tmux to keep proces running in the background even if you close the terminal/console:
sudo apt-get install tmux
tmux #to start tmux session
start bitcoin-cli, I suppose it is sudo service bitcoin-cli start
then you can close terminal running tmux, bitcoin-cli will continue to run, or you can just go out from tmux, bitcoin-cli will continue to run in the backgroung.
you can do the same with cpulimit inside of tmux.
to go out only from tmux: ctrl+b d or ctrl+b :detach