Giter Club home page Giter Club logo

smart-contract-tutorial's Introduction

Smart Contract Tutorial

a beginner's tutorial for creating and deploying a simple smart contract using the truffle suite

1. Install Node.js

Node.js is a JavaScript run-time environment required for using Truffle.

2. Install Truffle

The Truffle Suite is a development environment for blockchains using the Ethereum Virtual Machine.

  • Use npm install -g truffle to install the Truffle package globally, or remove the tag to install locally
  • If you're using Ubuntu on a Windows machine and the previous command won't execute, try using Powershell instead
  • Check out the repo

3. Download and Install Ganache

Ganache is a personal blockchain for Ethereum development that allows you to test locally and much faster than major testnets like Ropsten and Rinkeby.

4. Download the starter code and fill out the functions

The Source Tracker smart contract represents a simplified supply chain for a given product shipment. Each time the shipment arrives at a new node in the supply chain, the contract adds another "node" to its supply chain array. On a larger scale, this example shows how blockchain can be used along with IoTs to make supply chains more safe and transparent.

  • Here's a list of functions that need to be implemented
  • If you like to develop in Visual Studio Code, you can download this extension for Solidity support
  • If you like to develop in Atom, you can download this extension for Solidity support

5. Debug your code using Remix

Remix is a web-based compiler/IDE that is one of the best options for testing your smart contracts with the compiler of your choice

6. Test your smart contract using Truffle and Ganache

7. Check your code with the solution code

8. For more practice, check out Truffle's Pet Shop Tutorial

smart-contract-tutorial's People

Contributors

alexandriapawlik avatar

Watchers

James Cloos 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.