<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Blockchain Code School on Medium]]></title>
        <description><![CDATA[Stories by Blockchain Code School on Medium]]></description>
        <link>https://medium.com/@blockchain.codeschool?source=rss-4cd35bf77496------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*8N1Jo-We-XshJShdUjhKQA.png</url>
            <title>Stories by Blockchain Code School on Medium</title>
            <link>https://medium.com/@blockchain.codeschool?source=rss-4cd35bf77496------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 23:49:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@blockchain.codeschool/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Blockchain Code School: Let’s Get Started]]></title>
            <link>https://medium.com/@blockchain.codeschool/blockchain-code-school-lets-get-started-767e7445484e?source=rss-4cd35bf77496------2</link>
            <guid isPermaLink="false">https://medium.com/p/767e7445484e</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[solidity-tutorial]]></category>
            <category><![CDATA[truffle]]></category>
            <dc:creator><![CDATA[Blockchain Code School]]></dc:creator>
            <pubDate>Thu, 12 Dec 2019 16:47:58 GMT</pubDate>
            <atom:updated>2019-12-16T12:28:08.768Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Build a Sports Betting DApp (I)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*qENY65gBPlRyar7P1t9KhQ.png" /></figure><p>Probably countless tutorials are aiming at teaching you how to write your first DApp. However, I did some research and could find a good resource that walks the reader through all the required steps:</p><ul><li>setting up the environment</li><li>writing smart contracts</li><li>writing the front-end</li><li>testing</li><li>deploying</li></ul><p>That said, here’s what I want to achieve: write a series of easy to follow tutorials that teach you everything you need to know about building your first DApp on top of <strong>Ethereum</strong>.<br>Why Ethereum? Well, I have to start somewhere and, right now, Ethereum is the most popular platform for running DApps. This doesn’t mean we’re not going to cover other blockchains such as <strong>Tron</strong> or <strong>EOS</strong>. But we must start somewhere. Once we’re finished with Ethereum, we’ll move forward🏎.</p><p>So far so good. But what are we going to build?</p><p>Well… we’re going to be building a <strong>sport betting DApp</strong>😉.</p><p>Let’s get the ball rolling.</p><h3>Prerequisites</h3><h4>Vagrant</h4><p>Vagrant is an amazing tool that lets you easily configure your development environment. Simply put, Vagrant makes sure the code works just the same on all machines. Point your browser to <a href="https://www.vagrantup.com/downloads.html">this page</a> and install the package for your operating system.</p><p>Next, let’s download a virtual machine by firing up a terminal and entering the following command:</p><pre>vagrant init ubuntu/xenial64</pre><p>Spin up the virtual machine with:</p><pre>vagrant up</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sh3jmYWhlsnu7NjQx74dlQ.png" /></figure><p>At this point, an Ubuntu Xenial virtual machine is up and running on your computer. Let’s log in using ssh:</p><pre>vagrant ssh</pre><h4>Node.js</h4><p>Most of the tools we’ll use are written in JavaScript. Thus, before moving forward, we must install Node.js v10. To do so, run the following command:</p><pre>sudo apt-get install -y nodejs</pre><h4>Truffle</h4><p>Truffle is a tool that lets you compile, deploy, and test your smart contracts. Let’s create a new directory called SportBetting, cdinto it and install Truffle with:</p><pre>mkdir SportBetting &amp;&amp; cd SportBetting &amp;&amp; npm install truffle</pre><p>At this point, you’re almost ready to start writing your first smart contract. But before that, you must initialize your project by entering the following command:</p><pre>truffle init</pre><p>This above command creates a few files and directories and your directory structure should look something like this:</p><pre>.<br>|-- contracts<br>|-- migrations<br>|-- node_modules<br>|-- package-lock.json<br>|-- test<br>`-- truffle-config.js</pre><ul><li>contracts here you’ll put our smart contracts</li><li>migrations which tell Truffle how to deploy your smart contracts</li><li>test here you’ll place your tests.</li><li>truffle-config-js this is Truffle’s very own configuration file.</li></ul><p>Don’t worry too much about these directories and files right now. We’ll delve into details later.</p><h4>Your First Smart Contract🥳</h4><p>Let’s start with the most simple smart contract. Paste the following content into a file called contracts/SportBetting:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7472b6e57eb078e57d841a1d3349cd03/href">https://medium.com/media/7472b6e57eb078e57d841a1d3349cd03/href</a></iframe><p>Compiling this contract is as simple as typing:</p><pre>truffle compile</pre><p>If everything works, you’ll see something like this printed out to the console:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W5ldKA2iG7KUQ_IXdAg2Ag.png" /></figure><p>Awesome! You’ve just compiled your first smart contract.</p><p>Before we wrap up this first lesson, let’s take a quick look at what happened under the hood. So, besides compiling the SportBetting smart contract, running truffle compile created the build artifacts for your contract and saved them to the ./build/contracts directory.</p><p>Now you’re probably going to ask me what are the build artifacts, right?</p><p>Luckily, I saw that coming. Here’s the answer:</p><p>The build artifacts are comprised of the following:</p><ul><li><strong>The bytecode</strong>. The Ethereum Virtual Machine (EVM) can’t execute Solidity code so the compiler must “translate” the code into something that the computer can understand, usually called “bytecode”.</li><li><strong>The ABI</strong>. To execute a method of a smart contract, one must know the name of the method, the parameters said method expects, and what the method returns. All this stuff is put together into something called the <strong>Application Binary Interface</strong>. This way, your front-end or even other contracts “know” how to execute a method from the SportBetting smart contract.</li><li><strong>Truffle internal data</strong>. This helps Truffle deploy the code. You are better off if you just ignore it.</li></ul><p>Whoa! You’ve successfully compiled your first contract💪🏻. In the next lesson, we’ll start adding some basic functionalities.</p><p><strong>Until then, take care and keep on coding!</strong>🤓</p><p><em>If you enjoyed this lesson, give it a clap👏🏻. To go a step further and support my effort, please feel free to send me a small tip.</em></p><p><em>Ethereum: 0xc1b032442294d53857A8F717d7EcEfb0Cd7af22B</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=767e7445484e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>