New releases of Truffle & TestRPC. Now easier to install.

I have mentioned previously that Truffle & TestRPC are my development tools of choice for Ethereum based development.

truffle logo

It is exciting to see that there have been new releases of both Truffle & TestRPC. I have been hanging out in the Truffle Gitter channel, and been fielding lots of questions about installation issues on Windows. As Tim has previously blogged, there have been a number of issues with installation. The installation issues were mostly due to compiling C based libraries, and requiring a number of build tools on the local machine. These issues have now been removed as Truffle & TestRPC are both now built, and then released as a completely pre-packaged release. This also means that installation times have dropped from 10 minutes, to 10 seconds! (Which means I’ll need to go back and update some of my old tutorials )

 

Truffle

Highlights: More reliable installation. Makes it easier for everyone to jump in and start playing!

https://github.com/trufflesuite/truffle/releases/tag/v3.3.0

TestRPC

Highlights: Installs quicker. Reduced memory consumption. Ability to persist the blockchain to disk, meaning you can suspend and then resume if you like  (I’ll still be using it mostly as a throw away in memory style dev environment).

https://github.com/ethereumjs/testrpc/releases/tag/v4.0.0

Whats next?

I’ve been waiting in suspense for these updated installers to drop for many months now. There have been a couple of projects on my backlog that had been blocked until this came out. A short list of what I’ll be working on in the near term are:

Advertisements

How to install Truffle & TestRPC on Ubuntu or Windows 10 with “Windows subsystem for Linux”

I previously wrote how you can install Truffle & TestRPC on a windows machine, by using the Windows installers for Node & npm.
However I have found it is a much nicer experience to use the Windows Subsystem for Linux which provides a native Ubuntu shell with bash, which allows me to run all the Linux tools natively without issues. These install steps will work on an Ubuntu machine as well.

Prerequisite if running on Windows

  1. Enable Windows subsystem for Linux and install from Windows Store.Follow this short guide on how to enable it https://msdn.microsoft.com/en-us/commandline/wsl/install_guide 
  2. After following the steps in the guide above. Simply start the Ubuntu bash shellubuntu start

Install steps

Clean install on a machine without node

# (optional) Make sure Ubuntu is up to date
sudo apt-get update -y && sudo apt-get upgrade -y

# install nvm  https://github.com/creationix/nvm#install-script
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash

# restart bash to reload the path for nvm
exec bash

# install node and our npm packages
nvm install node
npm install -g truffle ethereumjs-testrpc

Install on a machine with node installed via nvm
You need at least node v8+ and npm 5.3.0+ (latest is better). you can check this with node -v; npm -v

# update nvm then install the tools
nvm install node

npm install -g truffle ethereumjs-testrpc

Another option if you have Node already installed is to use the dist-upgrade package

# Install the dist-upgrade package and run it to update to the latest node version
sudo npm -g install dist-upgrade
sudo dist-upgrade

npm install -g truffle ethereumjs-testrpc

 

now you should be able to create a folder, go into it and run `truffle init` to create a new project template.

imageimage

Additional things to do

Now that your machine has it installed, I recommend you follow my other guide to get Visual Studio code configured for Truffle development.

How to install Truffle & TestRPC on Windows for Blockchain development

UPDATE 2017/08/25:
Now that Truffle has made installation easier, I have cleaned up and streamlined the windows install steps below.
However I recommend that instead look at using the new feature in Windows 10 that lets you run Linux tools directly in Windows. This is how I’ve been doing my development for the last few months
https://davidburela.wordpress.com/2017/05/12/how-to-install-truffle-testrpc-on-ubuntu-or-windows-10-with-windows-subsystem-for-linux/

I have been doing a bunch of Blockchain development work, one of which was recently featured on the front page of the Australian Financial Review and on Microsoft’s news website.
One of the trickiest things has been trying to get Windows environments correctly configured, as the tools are npm based expect to be running on a Linux machine. Here is the simplest install steps I have found

Step 1. Install windows tools with chocolatey:

Open a PowerShell prompt as Administrator


choco install nodejs.install -y
choco install git -y
choco install VisualStudioCode -y #optional

Read more about configuring Visual Studio code for Blockchain development in my other post.

image

 

Step 2. Install the tools via npm:


Open a NEW PowerShell prompt as Administrator (to ensure that it reloads the path)


npm install -g npm
npm install -g --production windows-build-tools 
npm install -g ethereumjs-testrpc truffle

image

You may see some informational notes that optional components were skipped. You can run the commands truffle and testrpc.
image
image

 

Bonus Step: combining with Visual Studio Code

This is how I use Truffle & Visual Studio code together. Make sure you install and configure Visual Studio Code with the Solidity extensions.

If you navigate into the folder where your files are, typing “code .” will open Visual Studio Code in the current folder. Running the command after a truffle init gets you up and running quickly

image

image