Howdy! This is a guide I wrote with the intent of helping perhaps less skilled folks compile the zercoin library on github so they could perhaps play with and look at the library. I realize that most people don't have a lot of cryptographic or programming skills necessarily, but I am a fan of tinkering and so I put this guide out here in the hopes that one of you may tinker your way into becoming an expert and help the Zerocoin project. I didn't develop the zerocoin library, and I don't have any official permission to publish this guide or anything like that, but I wanted to help the community grow and speed things up for some people perhaps who would like to play with the library and see where they can take it. This guide details how I got the project to compile on various flavors of Linux. If you have any issues with this guide (if you want to add to this guide!), or just want to talk feel free to PM me on reddit. My username is ihatepullups.
Also, sorry about the sort of crappy state of the CSS on this site. I know it's not pretty, but CSS isn't really the point and I don't have time to worry about making it pretty.
This guide has three sections. One section is intended for people who run Arch Linux. The second is for people who run Debian derived distributions(Debian, Ubuntu, Mint, etc), and the third is for Windows and Mac. If you use a Red Hat based distro, Gentoo, LFS, *BSD, etc, I'm sorry. I love you and I hope you can figure it out for yourself. If you use one of those and you manage to get your development environment up and running nicely and you'd like to add a section to this guide, please PM me on reddit. Any help for the community to bring this code into the hands of more people and more people playing with the code is a good thing (plus it'll get zerocoin build faster, I'm impatient).
This section is intended for the more experienced. This is what I had to do to get my development environment good to go on Arch Linux:
First, get the code. If you don't have git installed, open up a terminal emulator and issue a
sudo pacman -S git
Then make a directory or cd into the directory you intend to work in, for example:
mkdir ~/zerocoin && cd ~/zerocoin
Copy the repository down from github:
git clone https://github.com/Zerocoin/libzerocoin.git
Dependencies: You might need ncurses if you don't have that already installed:
sudo pacman -S ncurses
Boost. Boost is a bit of a pain.
sudo pacman -S boost boost-libs boost-build
So when you try to compile the library, boost will complain at you because it uses a multithreaded call and for some reason the arch package doesn't show up when the g++ has the flag
-lboost_system-mt so the workaround I found for this was going in and symlinking the normal package to boost_system-mt. I realize this is a hacky fix. If you know of a better one, let me know. I'm fairly sure this still compiles it with multithreading support for two reasons: A) when I do this the code still compiles and executes without any seeming problems. B) The package for boost is in the x86_64 package repository for Arch, so I figure the multithreading support is there, just the library call and Arch's file structuring don't really play nice or something. In any case, this seems to work and I haven't gotten burned by it, yet, so that's what I've been doing. YMMV.
sudo ln -s /usr/lib/libboost_system.so /usr/lib/libboost_system-mt.so
if you don't already have openssl installed I worry for your future:
sudo pacman -S openssl
And with that you should be good to go!
cd libzerocoin/Build-gcc/ && make all && ./tutorial
Congrats! You've successfully built the library, and you can now edit the source code in the repository and get started with the library!
These instructions have been tested and worked on Crunchbang Linux. YMMV.
First, open a terminal, for windows folks that's (Windows-Key+t) Mac folks, that's (Command+t) everyone else, (Super+t)
Install the necessary components first:
sudo apt-get install openssl git build-essential nano libboost-all-dev libncurses5 libncurses5-dev
apt-get is the name of Debian's package manager. Package managers manage packages! So for example instead of going to 7zip's website and downloading 7zip and installing it yourself, you could just type sudo apt-get install p7zip and the package manager would install it for you. Here we're installing many different packages: openssl is a cryptographic library- it allows you to encrypt data in your programming. Git manages code repositories so that you can share code with friends. Build-essential is a library for building applications. Nano is a newbie friendly command-line text editor (we'll use it later). libboost is a library for C++, required for Zerocoin. Ncurses is a library that allows you to create nicely formatted applications that look nice in the terminal. It's required by Zerocoin.
Make a work directory and copy the repository down from github:
mkdir ~/zerocoin && cd ~/zerocoin && git clone https://github.com/Zerocoin/libzerocoin.git && cd libzerocoin/Build-gcc/ && make all && ./tutorial
The first thing this code does is "creates a folder"(mkdir) called zerocoin. Then it "changes directory" (cd) to that folder, and then copies the code from github to your computer using a command called git clone. Then it changes directory again into the folder where the code was downloaded from github, and "makes" (compiles) the code. The last thing it does is run the executable that the program created by compiling, called tutorial.
Congrats, you're done. You just compiled and ran the executable. You can look at and edit the source files using nano. For example:
cd ../ && nano Tutorial.cpp
This code changes directory up one folder, and opens the file Tutorial.cpp using the text editor nano. cntrl+x exits. (overwriting the buffer saves the file.) You can then change something, and then to compile it and view your changes:
cd Build-gcc/ && make all && ./tutorial
Congratulations! Good luck, I hope you can make something cool! And remember, Google is your FRIEND. Well kinda. More like your semi-creepy big brother. But he knows everything, so don't be afraid to ask when you need help. (Literally. Just paste your question or problem into Google and 9/10 times Google will have a guide somebody made with the answer.)
Congratulations buddy. You're now a programmer.
If you're a windows user the best option is to virtualize linux. If you're mac user, the tools to compile and edit the code natively should exist, but I don't use homebrew or any of those tools. If you figure out how to make it work natively on mac write a quick guide and PM me! In the meantime, let's go over how to install on Windows and Mac using some software called Virtualbox.
It is possible if you have a windows machine, that you will need to have a 64 bit operating system and to enable virtualization in you BIOS. If you don't know how to do that, I can't tell you because it's different from one computer to another. Google the name of your computer type + BIOS. It will involve restarting your computer, holding a special key, typically F12 or Delete or Escape, and configuring some options in the resulting screen.
First, go to the VirtualBox website and download the software for VirtualBox:
Then get Crunchbang Linux. This is a Debian Based Linux Distribution that is pretty simple and easy to use, and most important, is lightweight.
http://crunchbang.org/download (You'll probably need torrenting software to download it)
Open VirtualBox and click the "New" button. Crunchbang will work for the name but it is arbitrary. Type: Linux, Verson: Debian. Next. Allocate approximately half your RAM, assuming you have plenty of RAM (2 gigs is solid). Create a Virtual Hard Drive. VMDK is what you want. Dynamic is what you want. 8 gigs is solid, give it more if you want to use it for more than just this guide!
You may want to tweak some settings, I recommend it. Open the settings window: Then under general, advanced section, Enable bidirectional shared clipboard - this will allow you to copy and paste between windows and Linux. Under boot order, feel free to get rid of the Floppy and CD/DVD boot order. Set pointing device to PS2/Mouse.
You will want to follow these instructions to install guest additions in virtualbox. This will allow you to copy and paste between operating systems, allow the operating system to go full screen nicely, and other nice things.
At this point, you're good to go. Proceed to follow the Debain Linux instructions.
Hope this helped you and you learned things!!