Saminnet-Search Article Wiki Forum Piwigo SNS Cloud vtiger Sugar
Bitcoin Network Supporter

  • MySQL
    • MySQL Tunning my.cnf (106) Tue27,10:08am

      最近、ありがたいことにいいねがめちゃめちゃ増えております。正直自分もびっくりしてますので、少し精査した内容のtems/9c5eaee3c986cff6#%E7%8A%B6%E6%B3%81" style="color: #6200ac;">状況 僕が担当したサービスが 秒間5リクエスト でサーバーダウン。今までは ただ波が去るのを待っていた とのこと。そこで設定変更、およびチューニングをした内r: #6200ac;">問題 DBサーバーがダウンしてサービスが止まり、その時間だけ売り上げがゼロ。事業としてだけでなく、関連する全てに迷惑をかけていました。僕が担当…

      Read More...

Bitcoin Network Supporter

There’s a lot of interest at the moment in the Bitcoin Unlimited project and people have been asking how they can help. A great way to help out with the project is to run a Bitcoin Unlimited full node. This article will show you how to set up a full node on a cheap virtual server.

1. Log in to your preferred VPS provider.

I’m using Digital Ocean here so some of the specifics will relate to them but other VPS providers will have similar features. Choose a provider to suit your preferences and budget. The emphasis in this article will be to do things as cheaply as possible so you should be able to pick up a small VPS for around US$10 per month.

2. Create a small “droplet” / VPS.

I suggest a 1GB RAM, 20GB disk “droplet” server or something similar. If you’re really on a budget you can go as low as 512MB RAM but it may swap a fair bit. When you create your VPS I recommend you choose Ubuntu 16.04 as the operating system — it’ll make things easier later on since bitcoin unlimited is easy to install on Ubuntu.

3. Secure your new server.

Log in to your new virtual server as root. The way to do this varies depending on your VPS provider. It’s usually possible to login via ssh or from a remote console window.

Once you’re at the command line the first thing to do is secure it. We’ll start by setting up some firewall rules.

# ufw allow ssh
# ufw allow 8333
# ufw default deny incoming
# ufw default allow outgoing
# ufw enable

These rules tell your machine to ignore any incoming network traffic except bitcoin and remote logins.

4. Install the bitcoin unlimited software.

If you’re using Ubuntu it’s easy:

# apt-get install software-properties-common
# add-apt-repository ppa:bitcoin-unlimited/bu-ppa
# apt-get update
# apt-get install bitcoind

If you’re not using Ubuntu take a look at the installation instructions on this page instead.

5. Create a bitcoin user.

We’ll make a bitcoin user account and give it the ability to use “sudo” so you can do some system administration from the bitcoin user if you want to.

# adduser bitcoin
# usermod -a -G sudo bitcoin

6. Set up log rotation for your bitcoin logs.

This will ensure that your logs don’t grow too big and use up all your disk space.

Create a new log rotation file:

# nano /etc/logrotate.d/bitcoin-debug

Enter into it:

/home/bitcoin/.bitcoin/debug.log
{
rotate 5
copytruncate
daily
missingok
notifempty
compress
delaycompress
sharedscripts
}

7. Configure bitcoin.

We’re going to set up your node as a ‘pruning’ node. This means it doesn’t need to have all 100GB of the blockchain — it’ll only keep the most recent parts of it.

# su - bitcoin
$ mkdir .bitcoin
$ cd .bitcoin
$ nano bitcoin.conf

Add to the file:

prune=15000

Save the file and press control-D to log out of the bitcoin user and become root again.

8. Configure swap space.

Running a full bitcoin node uses a little over 1GB of memory. The node we created only has 1GB so we’ll make some spare “virtual memory” using swap space.

# fallocate -l 1g /swap1.swap
# chmod 0600 /swap1.swap
# mkswap /swap1.swap
# swapon /swap1.swap
# nano /etc/fstab

Add this line at the end of the file:

/swap1.swap  none  swap  sw  0  0

9. Set up the bitcoin daemon to auto-run.

Create a startup file:

# nano /etc/systemd/system/multi-user.target.wants/bitcoind.service

Enter into it:

[Unit]
Description=Bitcoin Server
After=network.target
After=syslog.target

[Install]
WantedBy=multi-user.target
Alias=bitcoind.service

[Service]
User=bitcoin
Group=bitcoin

# Start main service
ExecStart=/usr/bin/bitcoind
ExecStop=/usr/bin/bitcoin-cli stop

Restart=always
PrivateTmp=false

Reload systemd and start bitcoind:

# systemctl daemon-reload
# systemctl restart bitcoind
# systemctl status bitcoind

10. (optional) Set up user logins with ssh

If you want to log directly in to your new server using ssh you may want to set up ssh public key authentication. This guide from Digital Ocean is quite good.

Comments   

 
0 #1 Guest 2019-02-18 21:09
You actually make it seem so easy with your presentation but
I find this matter to be actually something that I think I would never understand.
It seems too complicated and extremely broad for me.
I am looking forward for your next post, I will try to get the hang of it!



my web blog - cheap server
Quote
 

Articles by Date

TweetTweet Share on LinkedInShare on LinkedIn Share on Google+Google+ Submit to RedditReddit Publish on WordPress WordPress Send emailSend email