8

I want to learn how to write and use Ethereum smart contracts. I have geth installed on my computer. I have experience with SQL and write some JavaScript and HTML. Other than that I know nothing about it. I need book or an organized set of tutorials to lead me through this. Are there any tutorials out there that start from the beginning and move to the advanced?

Thanks, John

1

3 Answers 3

12

I would suggest starting with the official tutorials on the Ethereum.org website. Follow the links in order: download the wallet, then click "Issue your token" for the first tutorial, etc.

After that, if you want a more in-depth explanation of Solidity, the official documentation has an "Introduction to Smart Contracts"

If you get through that, you should have a pretty good idea of how writing smart contracts works. At that point there will be two more things to learn. The first is the more practical side of actually doing day-to-day dapp development - using simulated blockchains for automated testing, deploying to the main chain, etc. For that, I recommend using a good framework. My favorite is Truffle, which has excellent documentation, but there are others including Embark and Dapple.

The last thing to learn is how to build a web-based frontend for your contracts. For that, I'm unfortunately not aware of any good tutorials, but the official documentation of web3.js is pretty comprehensive.

4

The Ethereum version of Hello World! is the greeter smart contract which helps new developers to get introduced to smart contracts and distributed applications. It's hosted at ethereum.org/greeter and basicly creates a contract on the blockchain which greets you back if you did it right:

contract mortal {
    /* Define variable owner of the type address*/
    address owner;

    /* this function is executed at initialization and sets the owner of the contract */
    function mortal() { owner = msg.sender; }

    /* Function to recover the funds on the contract */
    function kill() { if (msg.sender == owner) suicide(owner); }
}

contract greeter is mortal {
    /* define variable greeting of the type string */
    string greeting;

    /* this runs when the contract is executed */
    function greeter(string _greeting) public {
        greeting = _greeting;
    }

    /* main function */
    function greet() constant returns (string) {
        return greeting;
    }
}

The fastest way to test and deploy it, is using the online solidity compiler.

4

Eris Industries has a great multi-part tutorial on writing solidity contracts starting from simple to relatively advanced: https://docs.erisindustries.com/tutorials/solidity/

I wrote up an in-depth guide for a low-level understanding of the EVM: https://github.com/ebuchman/evm-tools/blob/master/analysis/guide.md

Not the answer you're looking for? Browse other questions tagged or ask your own question.