Coder Social home page Coder Social logo

truffle_eth_class2's Introduction

Course Materials for DApp Development with Solidity

This is the official Repository for all the Code you write during our course.

The course can be found here for limited time for $15: https://www.udemy.com/blockchain-developer/?couponCode=REPO15

Scope

The scope of the Code is to show what you can achieve in Solidity, Ethereum, Web3, Truffle, Ethereum Studio, etc. In Particular:

  • demonstrate how to work with the Ethereum Blockchain
  • Web3
  • Listen and react to specific events
  • Write Test Cases
  • Deploy the DApp
  • Work with MIST
  • Work with Truffle and WebPack

Install Instructions

Developing for Ethereum is sometimes frustrating, because things change at fast pace. If something does not work as described here, please:

Update July 2017

On all platforms it should be easier to install truffle now. The truffle team has put together a package that doesn't need compilation:

npm install -g truffle@beta
npm install -g ethereumjs-testrpc@beta

It comes with one caveat: The initial course project with the MetaCoin and truffle-webpack seems to throw an error. The Truffle team is notified about it, we are waiting for the issue to resolve.

Update End

General

  1. try a google search as you are 100% not alone with your problem
  2. inform the instructors of the course so they can correct the problem
  3. if you have the time, it would be awesome if you'd make a pull-request here

Windows

  1. Download Python: https://www.python.org/downloads/release/python-2712/

  2. .Net Packages https://www.microsoft.com/en-US/download/details.aspx?id=49982

https://www.microsoft.com/en-us/download/details.aspx?id=30653

  1. SSL https://slproweb.com/products/Win32OpenSSL.html

  2. and eventually you also need the Visual Studio, because of the C++ Compiler: https://www.visualstudio.com/vs/

After downloading the Visual Studio make sure to open one time a new c++ project.

  1. Install the Git-Bash as it comes with a mingw: https://git-scm.com/downloads

  2. Install NodeJS and the Node Package Manager (NPM) https://nodejs.org/en/download/

Ubuntu

  1. Install necessary packages:
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install curl git vim build-essential
  1. Install NodeJS and NPM
 curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
 sudo apt-get install -y nodejs
 sudo npm install -g express

Mac

  1. Install node https://nodejs.org/en/download/

  2. Install a c++ compiler which typically comes with xCode.

  3. Install truffle from the command line as root/systems administrator

npm install -g truffle

Known Issues

Fatal: Error starting protocol stack: listen udp :30303: bind: address already in use

When this pops up using Mist on Mac while opening your private network, then you have to specify the exact path to the ipc file. The exact path is printed when geth is started in the command line!

For GETH:

geth attach ipc:/path/to/the/file/geth.ipc

For MIST:

/Applications/Mist.app/Contents/MacOS/Mist --rpc <path to chaindata>/geth.ipc

Error when running truffle test/migrate

If something like this pops up:

dependency_path = source.resolve_dependency_path(import_path, dependency_path);

or

/usr/lib/node_modules/truffle/node_modules/truffle-compile/profiler.js:120
        if (ancestors.length > 0) {
                     ^

TypeError: Cannot read property 'length' of undefined
    at walk_from (/usr/lib/node_modules/truffle/node_modules/truffle-compile/profiler.js:120:22)

then try to install truffle 3.1.9:

npm install -g [email protected]

Error when installing truffle

Something like

... receive errors including "MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe".

or

... node_modules\truffle\node_modules\sha3\build\sha3.vcxproj(20,3): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.".

When you have installed Visual Studio, make sure you have opened a c++ project once.

Then try npm config set msvs_version 2015 --global and in addition you can try to install the ms-build tools:

npm install --global --production windows-build-tools

Geth Attach

On Windows its simply possible to do a geth attach, but on MacOS it seems that you need to provide the actual ipc file. geth --datadir /media/user/sdcard/chaindata --ipcpath $HOME/.ethereum/geth.ipc console which is a problem posed here: http://ethereum.stackexchange.com/questions/4472/port-30303-error-in-mist-when-i-run-geth-with-a-different-datadir

Private Network

The way the private network is initialized changed in the past months and seems to keep changing. For better information on it, it is advised to directly see the correct instructions on: https://github.com/ethereum/go-ethereum

Usually it should work with:

geth init path/to/genesis.json --datadir=/path/to/some/folder

Solidity Compilation Errors/Warnings

Solidity is in active maintenance and things change all the time! The code throughout the course was written for the current version (at the time this Readme was written) 0.4.8.

Any Solidity Program can be "forced" to use another compiler version (older one) by using as first line in your program pragma solidity ^0.4.0; for version 0.4.0, change it to whatever version you might need.

The code here is updated to work with solidity 0.4.8.

Contact

If you run into any problems, don't hesitate to contact us on the course-forum at any time. If you use the forum-search function, there is a high chance that you find the answer to your problem already.

truffle_eth_class2's People

Contributors

tomw1808 avatar wsaults avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.