Tested, step-by-step tutorial to run a 21 Bitcoin Computer as a virtual machine
Many thanks to /u/ButtcoinEE and /u/ecafyelims for initial pointers, but if I understood correctly, both users said they hadn't actually tried it themselves. So here comes a tutorial based on something I actually tried. Best of all: You don't even need a Raspberry Pi! We'll run it as a virtual machine.
The first step is to get a Debian 8 (Jessie) installation up and running. You might want to install that inside a VMWare/Virtualbox machine. I'll be using Vagrant here ( http://bit.ly/1QAPdIl ) which makes it easy to manage virtual machines like that and already has a Debian 8 image in the catalog. So get Vagrant for your platform and then do something like this:
vagrant init ARTACK/debian-jessie vagrant up
You should now be able to SSH into the machine:
Now that we have a Debian up and running, let's first get some packages we'll need later:
sudo su # become root apt-get update apt-get upgrade apt-get install apt-transport-https git cython3 python3-setuptools
Add the 21 Debian repository:
echo "deb https://apt.21.co stable main" > /etc/apt/sources.list.d/twentyone.list apt-get update
It'll complain about a missing GPG key, but you can just ignore that.
We should be able to do 'apt-get install two1' now, but it complains about a missing package 'python3-sha256'. The reason for that is probably, that we are doing this on a x86 architecture, where the packages are slightly different than the Raspberry Pi's ARM architecture. So we'll just manually install the package and have it ignore the dependency errors:
aptitude download two1 dpkg -i two1_1.0.0-1_all.deb
Now let it try to fetch as many of the dependencies as possible:
apt-get -f install
And try to install again (had to do this again, not sure why):
dpkg -i two1_1.0.0-1_all.deb
The 21 binary should now be available:
which 21 # => /usr/bin/21
Before we can run it, we'll need that missing python-256 package. We can install it manually from http://bit.ly/1T6OqNT :
git clone http://bit.ly/1QAPdIm cd sha256 python3 setup.py sdist python3 setup.py install
Now try to get a status report via the 21 tool:
If everything worked out, you should see something like:
You do not have a Bitcoin wallet configured. Let's create one. Press any key ...
and will also be asked to pick a username for a 21.co account.
All 21 Bitcoin computers are networked together into a VPN using the tool ZeroTier ( http://bit.ly/1T6OqNU ). Let's also set that up:
wget http://bit.ly/1QAPg78 dpkg -i zerotier-one_1.1.0_amd64.deb
We'll have to extract the credentials for the specific network they use from 21's zerotier package:
mkdir credentials cd credentials wget http://bit.ly/1T6OqNV ar x zerotier-one_1.1.0-1_armhf.deb tar xf data.tar.xz cp var/lib/zerotier-one/updates.d/ZeroTierOneInstaller-linux-armv6l-1_1_0 /var/lib/zerotier-one/updates.d/
Before we join the network, we need to lock down our machine. That's actually a bit tricky, as these Vagrant images aren't really designed with security in mind, but rather only to be used for local testing. I think it should be enough to do:
passwd vagrant rm /home/vagrant/.ssh/authorized_keys
Note that you won't be able to use 'vagrant ssh' any longer afterwards, as we just deleted the standard Vagrant key-based login. You'll have to use 'ssh vagrant@<local ip of your vagrant box>' instead. Now we are ready to join the network:
wget http://bit.ly/1QAPdIp python3 21-join.py python3 21-join.py # might have to try this twice as well ifconfig zt0 # will show your new IP within the VPN
The 21 tools have a concept of both an on-chain balance and an off-chain balance – the latter being managed by 21's server. You can deposit to your on-chain balance, but currently the only way to increase the off-chain balance is by mining or by receiving payments from others. Without the mining chip it's therefore a bit tricky to increase that off-chain balance. I hear that a feature request is being considered, to allow moving funds from on-chain to off-chain.
That's all! If you want to give it a shot, you should probably move fast, as 21 has some DRM in the works, as per this comment: http://bit.ly/1T6OpcK .
This was brought to you by https://coinado.io/ – cloud torrenting for command line fans. Check us out – we are also big on micropayments! 😉
Submitted November 22, 2015 at 04:24AM by coinadoio
via reddit http://bit.ly/1QAPdIs