Skip to content

Instantly share code, notes, and snippets.

@fametrano
Forked from Zorlin/bc-seedbox-node.MD
Last active July 5, 2023 09:25
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fametrano/9561ebc536ad6027c676ff2ecc21f8f6 to your computer and use it in GitHub Desktop.
Save fametrano/9561ebc536ad6027c676ff2ecc21f8f6 to your computer and use it in GitHub Desktop.
Running Bitcoin Core full nodes on FeralHosting

Running Bitcoin Core full nodes on FeralHosting

Running a full node can help the Bitcoin network significantly.

There's lots of benefits to running your own node and most people can run one at home.

For those who can't, or for those that want to run an extra one, the options are usually limited to virtual private servers (VPS) or dedicated servers (expensive).

Enter seedboxes - usually inexpensive, but provide plenty of disk space and resources to run a full node. This gist provides instructions for setting up a full node on Feral Hosting, but should work just fine on a different seedbox provider or a VPS, dedicated server or AWS instance.

Disclaimer

Security on seedboxes, as with most shared Linux boxes, is usually adequate for most users, but please note that I recommend against using a seedbox with wallets you care about. You can, and most of the time you won't run into issues, but in general you should never put your wallet on a server that other people have access to. Use at your own risk!

Also note that if someone else is running a Bitcoin daemon on the same box as you, you won't be able to run your full node on the default port (8333). You can get around this by setting a custom port. However, having two nodes running on the same box is not particularly useful, as running your node on a non-standard port will greatly limit how many other clients will connect to you.

Instructions

  1. Provision a seedbox from Feral Hosting.
  2. Get your login details and connect to your server - username, password, hostname/address.
  3. Log into the seedbox.
  • On Linux/OS X, use a terminal application and run "ssh youruser@yourserver.com"
  • On Windows10, install SSH functionality to the Windows 10 PowerShell (Settings, Apps, Manage optional features, Add a feature, OpenSSH Client, wait, then reboot)
  1. Create and enter a "bitcoin" directory to hold things.
  • mkdir bitcoin
  • cd bitcoin
  1. Pull down the Bitcoin binaries with wget (check the current link at https://bitcoincore.org/en/download/)
  1. Extract the binaries
  • tar xf bitcoin-0.17.1-x86_64-linux-gnu.tar.gz
  1. Run the Bitcoin daemon for the first time.
  • ./bitcoin-0.17.1/bin/bitcoind -daemon
  1. You'll be given credentials for rpcuser and rpcpassword. Copy them, then open bitcoin.conf with nano.
  • nano ~/.bitcoin/bitcoin.conf
  1. Paste the credentials into nano - Command-V if on OS X, Ctrl-V if on Linux, right-click if on Windows.
  2. Hit Ctrl+X once, then type "Y", then hit enter to save the file in nano.
  3. Change the permissions to the conf file you just created in order to help secure it.
  • chmod 400 ~/.bitcoin/bitcoin.conf
  1. Finally, start the Bitcoin daemon again.
  • ./bin/bitcoind -daemon

It should simply say "Bitcoin server starting" and then fork off to the background. You're done!

Check out your new node

  1. If you want to see the node working, you can see the blockchain getting bigger
  • ./bitcoin-0.17.1/bin/bitcoin-cli getblockcount
  1. Once the block count reach about 570,000 (as of January 2019) your node is fully synced up.
  2. Check connectivity your node
  • Visit https://bitnodes.earn.com/ and go to the bottom left, and enter your seedbox address. Click "check node".
  • If your node is up and reachable, a green bar with your node's IP should pop up.

Troubleshooting

If you're having issues, here are some common problems and solutions.

Checking for existing daemons

You can check for other users running Bitcoin daemons on your box by running this command

  • netstat -anp | grep LISTEN | grep 8333

If that command returns some results, you should ask to be moved to a different box.

Unreachable

If your node is showing as "Unreachable" on the Bitnodes check node tool, you may not have port 8333 open.

To open it, use iptables or equivalent.

  1. sudo iptables -I INPUT -p tcp --dport 8333 -j ACCEPT
  2. sudo service iptables save

Upgrading or changing versions

Changing versions is easy, and in most cases you'll be able to reuse your existing blockchain. Your folders/files may be named differently, so watch for that and change the commands appropriately. Here's how to upgrade, let's say from bitcoin-0.17.0 to bitcoin-0.17.1:

  1. Log into your seedbox
  2. Change to the "bitcoin" directory
  • cd bitcoin
  1. Stop Bitcoin
  • ./bitcoin-0.17.0/bin/bitcoin-cli stop
  1. Remove the old version
  • rm -r bitcoin-0.17.0
  • rm bitcoin-0.17.0-linux64.tar.gz
  1. Download the new version
  1. Extract the new version
  • tar xf bitcoin-0.17.1-x86_64-linux-gnu.tar.gz
  1. Run the new version
  • ./bitcoin-0.17.1/bin/bitcoind -daemon

It should simply say "Bitcoin server starting" and then fork off to the background. You're done (again)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment