January 26, 2026

Capitalizations Index – B ∞/21M

Setup your own Blockchain Explorer on free services without having a full node.

Setup your own blockchain explorer on free services without having a full node.

Setup your own Blockchain Explorer on free services without having a full node.

Setup your own blockchain explorer on free services without having a full node.

In this post we’ll see how to setup a custom bitcoin explorer with spruned and btc-rcp-explorer on a free AWS instance, with free certificates and free dns entry so… 100% costs free 🙂

The first thing we need to do is to setup an AWS free tier instance. 
Sign up and login into AWS console to setup a free instance. It’s 100% costs free.

We have many choices between the Free tier eligible instances, for this guide we’re going to use a debian based.

At the ending of the setup, you should have a free ubuntu VPS with 1 GB RAM and 8GB storage.

Remember to configure your security group, you would allow only the port 443 and 22 to access the instance from the outside world.

Login with SSH into the VPS and we’re ready for the second step.

All the following steps are intended to be run as root

sudo -i

And set up a 1GB swap partition to avoid the kernel killing processes ifout of memory:

sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sudo /sbin/mkswap /var/swap.1
sudo chmod 600 /var/swap.1
sudo /sbin/swapon /var/swap.1

Docker

To have a quick setup we’re going to use Docker. On my dockerhub’s account, they’re already available the containers used in this guide.

First, install docker-ce on the VPS. This is a complete guide to do it, but, TLDR:

apt-get update
apt-get install 
apt-transport-https
ca-certificates
curl
gnupg-agent
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
apt-key fingerprint 0EBFCD88
add-apt-repository 
"deb [arch=amd64] https://download.docker.com/linux/ubuntu
$(lsb_release -cs)
stable"
apt-get update
apt-get install docker-ce docker-ce-cli containerd.io

After doing that, you should be able to run Docker.

First, download the containers:

docker pull gdassori/spruned
docker pull gdassori/btc-rpc-explorer

I’ve built my own btc-rpc-explorer image with an increased timeout, at the time of writing I opened an issue to janoside to avoid that.

root@ip-172-31-26-222:/home/ubuntu# docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
gdassori/spruned latest 0dc85f9e742d 3 hours ago 564MB
gdassori/btc-rpc-explorer latest 73f6a5555133 4 days ago 955MB
root@ip-172-31-26-222:/home/ubuntu#

Since we use docker, we can avoid messing with all the projects dependencies (python3.7, leveldb, nodejs and so on), we can just run the containers with the proper settings.

Run spruned

docker run -d -p=8332:8332 --mount=source=data,target=/root/.spruned gdassori/spruned:latest --mempool-size 50 --cache-size 2000 --keep-blocks 500 --rpcuser rpcuser --rpcpassword rpcpassword

Those parameters for spruned will open the 8332 RPC port, persist the data on

/var/lib/docker/volumes/data/_data/

while keeping a large cache, the latest 500 blocks, and a 50megabytes mempool.

When spruned is up, we should see the listening port

root@ip-172-31-26-222:~# netstat -tapn |grep docker-proxy
tcp6 0 0 :::8332 :::* LISTEN 15624/docker-proxy

And of course we can use bitcoin-cli to check the daemon status! Of course we need it:

cd /tmp
wget https://bitcoincore.org/bin/bitcoin-core-0.17.1/bitcoin-0.17.1-x86_64-linux-gnu.tar.gz
tar xvfz bitcoin-0.17.1-x86_64-linux-gnu.tar.gz
cp bitcoin-0.17.1/bin/bitcoin-cli /usr/local/bin/
rm -rf bitcoin-0.17.1*

Now, configure bitcoin-cli according with spruned settings.

As with a bitcoin full node, you need to do the following step for both root and your instance user, if you wish to use it from both the accounts.

For root:

mkdir /root/.ubuntu
echo -e "rpcuser=rpcusernrpcpassword=rpcpassword" >/root/.bitcoin/bitcoin.conf

If everything went smooth in the previous steps, you should be able to do that:

Congratulations!

You have spruned bitcoin full node emulator up, running and syncing.

To do the same for the ubuntu user (so the next time you’ll log in into the AWS instance you will not have to become root):

cp /root/.bitcoin /home/ubuntu -R
chown ubuntu:ubuntu /home/ubuntu/.bitcoin

Here, then, we leave the root just for a bit, check the API help and go back into the root account:

but let’s move forward. We now have a “full node” interface as needed by btc-rpc-explorer, and we can run the frontend.

Run btc-rpc-explorer

With Docker, to run btc-rpc-explorer is easy as we did with spruned, let’s see:

docker run -p 3002:3002 -e BTCEXP_BITCOIND_URI='bitcoin://rpcuser:rpcpassword@172.31.26.222:8332' -dt gdassori/btc-rpc-explorer

You have to change the IP address here, obviously, 172.32.26.222 won’t fit your needs:

You should be able to see the IP in the shell itself, but if you, for some reasons (I’m not even sure you can when deploying the instance) changed the machine hostname, you won’t see it, so use ifconfig, you should see something similar.

The eth0 IP is your own.

Again, if everything was smooth, we can see that docker-proxy is listening on another port:

Nice! We have the btc-rpc-explorer up and running. But if we did our homework properly with the security group, we shouldn’t be to connect to it.

Setup a free Dynamic DNS service

We are going to use the free service FreeDNS by Josh to do that.

Setup an account on https://www.afraid.org (Josh have many aliases, but this is my favorite since the 90s when I had my first authoritative DNS on a 33.6kbps dialup 🙂 )

You can select many free domains from FreeDNS (I guess more than 10 thousands of public domains) but the most reliable are strangled.net and mooo.com, owned by FreeDNS itself.

Once logged in, set up an A record on the subdomains section:

We could set the IP of the AWS instance here, but we chose to set 127.0.0.1 as the A record destination because we want to ensure the next steps we’re going to deploy are working properly (auto update).

Once the record is saved, go to the “Dynamic DNS” section and download the crontab entry for the record you just created.

Open the “quick cron example” and copy the last two lines, something like that, according to your hostname and API keys:

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
1,6,11,16,21,26,31,36,41,46,51,56 * * * * sleep 29 ; wget -O - http://freedns.afraid.org/dynamic/update.php?VlqKQ01gaDddYU93RVaxaG9tOVY6MTgxNTc5NjI= >> /tmp/freedns_your-explorer_mooo_com.log 2>&1 &

Go back to the AWS shell and hit the command

crontab -e

For your convenience select the option 1 “nano”, to edit the crontab, unless you know what you are doing.

Copypaste the crontab entry at the end of file then hit:

Ctrl+o to save the file
Ctrl+x to quit nano editor

In the console, you should see:

root@ip-172-31-26-222:~# crontab -e
crontab: installing new crontab
root@ip-172-31-26-222:~#

Nice! It’s just a matter of time before the crontab will run the update script, and after 5–10 minutes at most, you should be able to see something similar, using the “host” command, which resolves hostnames to IPs.

root@ip-172–31–26–222:~# host btcrpcexplorer.chickenkiller.com.
your-explorer.mooo.com has address 52.192.153.33
root@ip-172–31–26–222:~#

If you still see 127.0.0.1 something is going wrong, you can wait a bit more, but you can also check the logs in the /tmp folder.

cat /tmp/freedns_your-explorer_mooo_com.log

Will show why the update is not working. We assume it will work, anyway 🙂

First steps recap

  • We have set up a free AWS machine
  • We installed docker
  • We installed the spruned and btc-rpc-explorer containers, we have them up and running
  • We just configured a Dynamic DNS entry, so we will be able to reach the AWS container even if Amazon changes the IP (with free tier stuff this could happen, AFAIK).

Let’s move forward! We are still missing a couple of tools before being able to use our blocks explorer.

Nginx with free SSL certificate

Install nginx:

apt-get install nginx

And certbot:

sudo apt-get install software-properties-common
sudo add-apt-repository universe
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install certbot python-certbot-nginx

Edit the Nginx default config file named

/etc/nginx/sites-enabled/default

And paste the following data (change the server_name according to your)

server 
listen 80;
listen [::]:80;
}

Then, run certbot to configure the SSL:

certbot --nginx

And, after everything is set up, the default Nginx file should have changed, and should look similar to the following:

server 
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/your-explorer.mooo.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/your-explorer.mooo.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server # managed by Certbot
listen 80;
listen [::]:80;
server_name your-explorer.mooo.com;
return 404; # managed by Certbot
}

Well, we are done, and Nginx is up and running, working as a reverse proxy for the btc-rpc-explorer app.

The last thing to do is just open the browser and try it:

Done!

Don’t expect a blazing fast explorer like btc-rpc-explorer with a full node as backend on decent hardware.

This is intended to show the possibilities of spruned, or used as a swiss army knife, and not to be browsed by an audience.

Known issues are:

  • 504 timeouts, when btc-rpc-explorer is requesting a lot of non-cached data, simply reloading the page should fix.
  • Slow! Don’t expect a blazingly fast experience, for that use Blockstream.info 🙂

Privacy concerns

We can assume that nearly all the queries to raw transactions are sent to electrum servers, this setup — for simplicity — is made without the usage of Tor. If you’re cool with Electrum Public Servers Privacy, you are cool with this guide.

In the next posts we’ll see how to:

  • Increase privacy using spruned behind Tor
  • Setup the explorer also as a hidden service
  • Setup CLightning + Spark wallet along with what we did here 🙂

References

BTC-RPC-Explorer on Github
spruned Bitcoin client on Github
– spruned documentation

$ whoami

Guido Dassori, BitcoinFOSS developer. 
Author of spruned bitcoin client
https://twitter.com/KHS9NE

Support sPRUNED!

  • Donate BTC to 3FVGopUDc6tyAP6t4P8f3GkYTJ5JD5tPwV

Published at Sat, 06 Apr 2019 13:47:30 +0000

Previous Article

Close to Half a Billion Dollars Worth of ETH Now Locked in Dapps

Next Article

Peter Brandt: Bitcoin Price Could Be Entering A New Parabolic Advance

You might be interested in …