If you are running into problem during the installation on your own computer you can jump over this and go straight to the Virtual Machine step described below.
The workshop is supposed to work on OSX, Windows and Linux. However it is much less tested on a windows environment, so if you are having problems we recommend using a virtual machine.
-
Make sure
gitis installed.- Download for Windows:
https://git-scm.com/download/win - Download for Mac:
https://git-scm.com/download/gui/mac - Download for Linux:
https://mirrors.edge.kernel.org/pub/software/scm/git/
- Download for Windows:
-
Install npm and node. Make sure to pick LTS to get node version 8.x. Download npm and node from: https://nodejs.org/en/download/current/
-
Install truffle and testrpc by running the following command
npm install -g truffle ethereumjs-testrpc -
Check that
truffleis installed by runningtruffle versionin the command line.
$ truffle version
Truffle v3.4.9 (core: 3.4.8)
Solidity v0.4.15 (solc-js)-
To run a local copy of the ethereum blockchain on your computer run the following command in another terminal window:
testrpc. To compile the smart contract writetruffle compileNB: Every time you want to test if your smart contract is correct, runtruffle test. -
Setting up the project
- Download the workshop repository by using the following command
git clone https://github.com/knowit/ethereum-workshop. - Enter the folder that you just cloned (
cd ethereum-workshop), Run the following commandsnpm installthentruffle migrate. - When everything has finished downloading you can run
npm run devto start the dev-server onlocalhost:8080, if this site is unreacheable (e.g 404) tryhttp://127.0.0.1:8080. - Make sure that the site is running OK. The functionality on the site is not working yet, but that is because we have to do some coding on our own :)
- Åpne prosjektet i din favoritt editor. Solidity, som er språket vi for det meste skal kode i, er støttet av de fleste IDE hvis man installerer en ekstra plugin.
- Open the project in your favorite editor. Solidity, which is the language we are going to do most of our work in is supported by most IDEs by installing a Solidity plugin.
- Download the workshop repository by using the following command
You can find the tasks for the workshop here under Tasks.md.
If you were able to install and run everything above in the Installation section you can go ahead and skip this part.
This part is meant as an alternative to the people that faced problems with the Installation section, or don't want to install everything on their own computer.
- Download Virtualbox and install virtualbox.
- Download the VM image that we have made ready for you.
- Follow the guide from Oracle on how to add the image to Virtualbox.
testrpcfails immediately with the following stacktrace/usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:30305 function VM (opts = {}) { ^ SyntaxError: Unexpected token = at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:374:25) at Object.Module._extensions..js (module.js:417:10) at Module.load (module.js:344:32) at Function.Module._load (module.js:301:12) at Function.Module.runMain (module.js:442:10) at startup (node.js:136:18) at node.js:966:3
- Reason: ethereumjs-vm uses ES6 after
node6.9.1 was LTS - Fix: Upgrade
nodeto the latest stable version$ npm cache clean -f $ npm install -g n $ n stable