Learning ethereum and Solidity basics

Ethereum is a public blockchain system similar to Bitcoin, but it provides a comprehensive programming structure to write and deploy smart contracts, small programs that can be used for many use cases, from enforcing agreements between multiple parties to issuing your own cryptocurrency.  It has it’s own programming language called Solidity.  I recently started learning about Ethereum and got my hands dirty with some entry level coding and setting up a local Ethereum blockchain for learning.

The easiest way to get an understanding of Solidity, Ethereum and Smart contracts is to use Truffle, a framework that will let you compile and deploy simple smart contracts to play with.

The first steps are to install TestRPC which produces a local Ethereum blockchain and 10 addresses to play with, as well as nodejs, Truffle and a handful of dependencies.

The following is the video (by Jordon Leigh and Will) I used to get going. It provides a great walkthrough for making a basic contract and concludes with an intro on how Ethereum handles a token issuing contract (or Metacoin), which is a common scenario. Jordon plays the role of new learner in the video, although he clearly knows the stuff well, it’s a good style for learners!

 

 

I did need to spend a few hours resolving issues with installation of TestRPC and Truffle (the guys in the video are using a Mac) and I’ve left a few notes below the video on all the things I needed to install as dependencies.  You’ll (hopefully) find one or two of these things are already installed on your system.  The video does not cover the actual installation of TestRPC and Truffle.

1. Downloaded and installed node.js (which installed npm I guess)

2. Downloaded testrpc files,

https://github.com/ethereumjs/testrpc/wiki/Installing-TestRPC-on-Windows

3. Downloaded github for windows. (desktop.github.com) and install

4. Add the path of gitbub to PATH (Environment settings in Advanced settings – Control Panel)
e.g. C:\Users\Admin\AppData\Local\GitHub
\PortableGit_284a859b0e6deba86edc624fef1e4db2aa8241a9\cmd

5. Install Visual Studio community edition

https://www.visualstudio.com/downloads/

6. Install Python 2.7

https://www.python.org/download/releases/2.7/

7. Add Python 2.7 location to windows PATH

8. Install Open SSL

http://slproweb.com/products/Win32OpenSSL.html

9. Download/Install windows SDK 8.1 !!. (actually step 10 should achieve this as well)

10. Add VC++ files (from within Visual studio CE) to add the Cl.exe file

11. Try and install testrpc (https://github.com/ethereumjs/testrpc)

https://github.com/ethereumjs/testrpc/wiki/Installing-TestRPC-on-Windows

12. Install Truffle

https://medium.com/zeppelin-blog/the-hitchhikers-guide-to-smart-contracts-in-ethereum-848f08001f05#.tw652mkog

13. I ran from c:/Users/Admin

type truffle and should see list of truffle standard commands.

Note: If using standard windows command window and running truffle commands opens the js file instead of command, you may need to append’.cmd’ to the end,
e.g. truffle.cmd init. I heard that with Windows Powershell you may not need to do this.

 




You can leave a response, or trackback from your own site.

Leave a Reply (your comment will appear immediately)

Powered by WordPress