Author

Topic: [ TUTORIAL ] Run BITCOIN Server on VPS - BitcoinCLI and BitcoinD (Read 314 times)

full member
Activity: 515
Merit: 202
in BTC we trust!
Useful information.
It's called Bitcoin full node.
Could you make script for autorun bitcoin daemon after start VPS?


I will create a docker image and a shell script to start all node.

Thanks for idea. Smiley
full member
Activity: 198
Merit: 130
Some random software engineer
Could you make script for autorun bitcoin daemon after start VPS?
You can probably just use cron for this... it has settings that allow you to run commands after startup.

The best is still to make use of the provided bitcoind.service file for systemd.

Most likely it is already bundled in the ubuntu's bitcoind package.

As root, the following should work:

Code:
# cp bitcoind.service /lib/systemd/system/bitcoind.service
# systemctl enable bitcoind
# systemctl start bitcoind
# systemctl status bitcoind

It will register it in systemd & making it as a service to start at boot. There is no need of a third party script.
jr. member
Activity: 59
Merit: 5
Many people will not be happy about the vim section ;-)
 
 Nevertheless, good tutorial. I would not allow rpc for external ips, instead just connect via ssh and send your commands on the server. In addition it is recommended to allow incoming traffic (for rpc or ssh) only from your ip (if you have a static ip).
HCP
legendary
Activity: 2086
Merit: 4361
Could you make script for autorun bitcoin daemon after start VPS?
You can probably just use cron for this... it has settings that allow you to run commands after startup.

Also, given that a lot of VPS services charge based on the storage/bandwidth being used... running a Bitcoin Node on a VPS could get quite expensive given the current size of the blockchain Tongue
sr. member
Activity: 1330
Merit: 258
Useful information.
It's called Bitcoin full node.
Could you make script for autorun bitcoin daemon after start VPS?
full member
Activity: 515
Merit: 202
in BTC we trust!
Hello guys, just sharing with you , how setup a bitcoind and bitcoin-cli on a simple ubuntu VPS on a cloud.

Tip: not use windows...,you can use ubuntu on amazon aws, digital ocean, interserver.net, and others cloud VPS.


Ubuntu is better to run, but xubuntu and others debians based you can run also.


*** BTC update and OS and install bitcoind together cli . BTC ***


Open The terminal and execute :


sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install libtool autotools-dev autoconf
sudo apt-get install libssl-dev
sudo apt-get install libboost-all-dev
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install bitcoind
mkdir ~/.bitcoin/ && cd ~/.bitcoin/

******* BTC Adding conf using vim BTC *****


vim bitcoind.conf

with vim open, you will using text terminal, follow next steps:

give a space
copy  TEXT* of next lines
execute  SHIFT + I or  SHIFIT + INSERT ( this will paste yor text on vim)
go to first line on vim and remove the extra space, inserted before (normal backspace)
press ESC ,you will see ":" , then yoou press wq after enter
this will save the file


******* BTC Config  btcd TEXT* BTC*******



rpcuser=username
rpcpassword=password
testnet=1
rpcport=8332
rpcallowip=127.0.0.1
rpcallowip=EXTERNAL IP*
server=1



The EXTERNAL IP is your ip address external of your vps, you can found it on yoour control panel of your vps


**** BTC Starting service Bitcoind BTC*****


bitcoind &  

(this comand will run bitcoind )


if you close the terminal (the & unlock execution), you can typing more comands using this letter


bitcoind --daemon

(this command above will run on background, you need choose the first with & or the second with --daemon )


---------

Tip, if you want to know if the process is running ?

run this :
 
ps -e | grep bitcoind

( with one line with PID text show , that is running )

----------

BTC Running bitcoin-cli using your bitcoind BTC


bitcoin-cli getblockchaininfo


if everything is fine you will see something like that :



Remenber the command  getinfo is deprecated.

now you can use these comands , if you have success here, just need run a command to see/use blockchain:

- getblockchaininfo: blocks, difficulty, chain
- getnetworkinfo: version, protocolversion, timeoffset, connections, proxy, relayfee, warnings
- getwalletinfo: balance, keypoololdest, keypoolsize, paytxfee, unlocked_until, walletversion



Anything need just ask
Im am a "normal" developer , and can help with configuration if you need


Running on ubuntu July 2018
Jump to: