Part 17: The Casa Node

cryptoskillz
Bitcoin e-commerce development
6 min readJun 23, 2019

Preamble

Whilst we are in the testing mode we would like to give away BTC (via lightning) that is right, free money! If you would like free money “tweet” at us with your lightning address and we will send you some :]

Introduction

This guide aims to program a website to accept “Bitcoin”. In the “previous tutorial”, We tried (and failed) to get a Bitcoin full node up and running with Lightning support to a level that we were happy with.

Bear in mind that we want to use Bitcoin and Lighting in an e-commerce model and this is where we run into the issues as everything (at this point) has been designed to be running locally and for direct one to one payments via lightning channels.

At this point, it seemed like an ideal time to invest in some prebuilt Bitcoin+Lightning nodes to see how they perform. I started with a Casa node

Setup

I am not going to go through the full setup procedure it has been covered in detail in many other tutorials. I recommend this excellent setup video created by Guy Swann if you are having problems setting this up.

Initial thoughts

Our first thought is, we like it. We like it a lot. It is as they promised, plug and play. It literally took 10 minutes to set up and a few hours to sync the blockchains (as per normal). Also when I emailed for supper the “Jameson Lopp” (the CTO) answered the request, how cool is that.

Tweaking the Casa Node

Once you have set it up and has fully synced you will want to make a few tweaks/additions which we have listed below. If you would like to set up your first Lightning channel and make a payment (which is beyond the scope of what we are covering here) use this “guide”.

Casa chrome extension

The next thing you will want to install is the Casa chrome extension which can be found “here”. This basically allows you to access your CASA node via a chrome extension. More information on this can be found “here”. Now (and yes this is a recurring theme) we cannot use the chrome extension externally we can only assume that the TOR support is coming. This is a recurring thing and we get it self sovereignty, security etc but to us, part of financial freedom is being to transact anywhere at any time but CASA is hell-bent on making me do everything from a home network. As constant travellers, this is far from ideal.

Enabling TOR

If you do not want to go through the hassle of port forwarding etc CASA suggest that you set up “TOR” which we did but we also enabled “port forwarding” as we want to be able to connect to it via our server (which does not have TOR support yet)

When you enable TOR support and user a compatible browser. We use “Brave” but feel free to use whatever TOR browser you prefer.

Advanced modifications

WARNING

IF YOU ACCESS YOUR CASA NODE IN THE WAYS DESCRIBED BELOW IT WILL INVALIDATE YOUR WARRANTY. THE CASA NODE WAS DESIGNED TO BU USER-FRIENDLY FOR NON-TECHNICAL PEOPLE — IT’S NOT REALLY DESIGNED TO BE A DEVELOPER NODE, WHICH IS WHY THE SYSTEM ENDED UP WITH BEING PRETTY HARD TO RECONFIGURE FROM THE COMMAND LINE.

Log into the CASA Node

First things first, you will require a keyboard and mouse to do this step. Plug these into the case node. The login info for your casa Node is easy to find if you want it. Send a “Tweet to us or email Casa at “help@team.casa

Now, you can just work from the keyboard and mouse you plugged in the CASA node. This is the most secure method and I guess will not invalidate your warranty. Please check with CASA as we are speculating here. However, we want to be able to access it remotely from wherever we are in the world. So we want to enable SSH which we cover below.

SSH access

Remember if you do the below it will invalidate your warranty so if that kind of thing bothers you then please do not do this, obviously.

ok, let us continue now we are logged into the CASA Node and the good news is SSH is installed so you just have to enable it by using the following commands

sudo systemctl enable ssh
sudo systemctl start ssh

At this point, you should be able to SSH into your box using the IP address in the connection tab as shown below.

Once you have done this open up a terminal window. We use a mac if you use windows use “putty” or whatever you prefer.

type the following command and enter the password when prompted (replace the USERNAME with the one provided to you and the IP with the one in your dashboard)

ssh <USERNAME>@192.168.1.103

If all has gone well you should now be connected the CASA node and we can start to look at the bitcoin.conf file.

Accessing Bitcoin.conf

CASA use docker (which is a good thing) and to access this we will have to go into the docket container

docker exec -it bitcoind bash

and we can make the changes by opening the bitcoin.conf file as shown below. Please note I have not made any changes in the tutorial as I want to gauge the impact on the CASA node, wait for several updates (to test the reapplying process) and also to make sure it does not break anything. In the next tutorial, we will make the necessary changes to allow “ECS” to access it.

nano chains/bitcoind/conf/bitcoin.conf

then exit the docker container (ctrl + c) and then restart it with the following command

docker restart bitcoind

Bitcoin REST API

If you remember from our previous “tutorial” we use the REST API to access the node for a number of functions. this is not enabled by default on the CASA node and though we can enable it every time CASA sends an update it will override our changes.

This is not the end of the world as the updates have to be manually applied to the CASA node, it is however mildly annoying. We have reached out them to ask to add it their dashboard. If they do great if not we will fork the “code and make the changes ourselves.

Access Bitcoin via JSONRPC

Now let us run a simple CURL request to see if it is working. It will ask you for a password. This is the same one that you set when setting up your CASA node that you use to access http://casa-node.local/

curl — user casa — data-binary ‘{“jsonrpc”: “1.0”, “id”:”curltest”, “method”: “getaddr”, “params”: [] }’ -H ‘content-type: text/plain;’ http://192.168.1.103.68:8333

Conclusion

The Casa Node is a breeze to set up and use truly a great product if you are looking for self-sovereignty and the ability to transact one to one to one using the lightning network and this is a great thing but it has the ability to do so much more and for our requirements (at this moment in time it falls short) which is to be able to run an “e-commerce store”. To be fair they never marketed it as a tool to do the above but we know it can with a few small tweaks.

Next time we will use the CASA mode we will see if it is possible to integrate this with “ECS” as well as access the CASA via TOR. Should be fun. Next article we will be playing with Cyphernode.

DISCLAIMERS

1) Lightning is still early and experimental you should not be putting an amount of money into it that you are not comfortable losing.

2) These views are my own DYOR before you make any purchase.

I was not paid by CASA (or anyone) to write this article I bought this node with my own monies and the receipt is shown below.

--

--